using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DALBlueWhale.Entities;
using System.Data.SqlClient;
using DALBlueWhale;
using System.Web.Security;
public partial class login : System.Web.UI.Page
{
Users _users;
DBWrapper _db = new DBWrapper();
DataTable dtusers;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
Page.Validate();
if (!Page.IsValid)
return;
if (FormsAuthentication.Authenticate(txtuserLogin.Text, txtPassword.Text))
{
FormsAuthentication.RedirectFromLoginPage(txtuserLogin.Text, false);
}
else
{
lblMsg.Text = "Invalid User Name Or Password!";
}
Response.Redirect("AddEmployee.aspx");
if (txtuserLogin.Text != string.Empty)
{
if (txtPassword.Text != string.Empty)
{
lblMsg.Text = string.Empty;
}
else
{
lblMsg.Visible = true;
lblMsg.Text = "Please Enter User ID And Password";
_db = new DBWrapper();
dtusers = _db.GetDataSet(@"SELECT tblUsers.userlogin, tblUsers.password,
tblUsers.userfullName,UserRoles.RoleID, UserRoles.Role
FROM tblUsers INNER JOIN
UserRoles ON tblUsers.RoleID = UserRoles.RoleID
where tblUsers.userlogin='" + txtuserLogin + "' and tblUsers.password='" + txtPassword + "'").Tables[0];
}
Response.Redirect("AddEmployee.aspx");
}
else
{
lblMsg.Visible = true;
lblMsg.Text = "Please Enter ID And Password";
}
}
protected void btnPass_Click(object sender, EventArgs e)
{
}
}
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DALBlueWhale.Entities;
using System.Data.SqlClient;
using DALBlueWhale;
using System.Web.Security;
public partial class login : System.Web.UI.Page
{
Users _users;
DBWrapper _db = new DBWrapper();
DataTable dtusers;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
Page.Validate();
if (!Page.IsValid)
return;
if (FormsAuthentication.Authenticate(txtuserLogin.Text, txtPassword.Text))
{
FormsAuthentication.RedirectFromLoginPage(txtuserLogin.Text, false);
}
else
{
lblMsg.Text = "Invalid User Name Or Password!";
}
Response.Redirect("AddEmployee.aspx");
if (txtuserLogin.Text != string.Empty)
{
if (txtPassword.Text != string.Empty)
{
lblMsg.Text = string.Empty;
}
else
{
lblMsg.Visible = true;
lblMsg.Text = "Please Enter User ID And Password";
_db = new DBWrapper();
dtusers = _db.GetDataSet(@"SELECT tblUsers.userlogin, tblUsers.password,
tblUsers.userfullName,UserRoles.RoleID, UserRoles.Role
FROM tblUsers INNER JOIN
UserRoles ON tblUsers.RoleID = UserRoles.RoleID
where tblUsers.userlogin='" + txtuserLogin + "' and tblUsers.password='" + txtPassword + "'").Tables[0];
}
Response.Redirect("AddEmployee.aspx");
}
else
{
lblMsg.Visible = true;
lblMsg.Text = "Please Enter ID And Password";
}
}
protected void btnPass_Click(object sender, EventArgs e)
{
}
}
0 comments:
Post a Comment