本文整理汇总了C#中BAL.ClsBAL.CheckUser方法的典型用法代码示例。如果您正苦于以下问题:C# ClsBAL.CheckUser方法的具体用法?C# ClsBAL.CheckUser怎么用?C# ClsBAL.CheckUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BAL.ClsBAL
的用法示例。
在下文中一共展示了ClsBAL.CheckUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnAgentLogin_Click
protected void btnAgentLogin_Click(object sender, EventArgs e)
{
try
{
ClsBAL objManabusBAL = new ClsBAL();
objManabusBAL.userName = Convert.ToString(txtAgentName.Text);
objManabusBAL.password = Convert.ToString(txtAgentPassword.Text);
if (objManabusBAL.CheckUser() == "Valid User")
{
if (Session["Role"] != null)
{
if (Session["Role"].ToString() == "Agent")
{
System.Data.DataSet ds = objManabusBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
Session["Balance"] = ds.Tables[0].Rows[0]["Balance"].ToString();
Session["View"] = "AgentView";
string ss = ds.Tables[0].Rows[0]["Status"].ToString();
if (ss.ToUpper().ToString() != "HOLD")
{
Response.Redirect("~/Default.aspx", false);
}
else
{
lblEmpMsg.Text = "Your account is on HOLD. Please contact the administrator.";
lblEmpMsg.ForeColor = System.Drawing.Color.Red;
Session["UserID"] = null;
}
}
else
{
lblEmpMsg.Text = "UserName / Password Is Incorrect.";
lblEmpMsg.ForeColor = System.Drawing.Color.Red;
}
}
}
else
{
lblEmpMsg.Text = "UserName / Password Is Incorrect.";
lblEmpMsg.ForeColor = System.Drawing.Color.Red;
}
}
catch (Exception ex)
{
lblMsg.Text = ex.Message;
throw ex;
}
}
示例2: Button2_Click
protected void Button2_Click(object sender, EventArgs e)
{
ClsBAL objManabusBAL = new ClsBAL();
objManabusBAL.userName = Convert.ToString(txtEmpLoginName.Text);
objManabusBAL.password = Convert.ToString(txtEmpPassword.Text);
if (objManabusBAL.CheckUser() == "Valid User")
{
if (Session["Role"] != null)
{
if (Session["Role"].ToString() == "Employee" || Session["Role"].ToString() == "BSD"||Session["Role"].ToString() == "CSE")
{
System.Data.DataSet ds = objManabusBAL.GetAgentByUserId(Convert.ToInt32(Session["UserID"].ToString()));
Session["Balance"] = ds.Tables[0].Rows[0]["Balance"].ToString();
Session["View"] = "AgentView";
string ss = ds.Tables[0].Rows[0]["Status"].ToString();
if (ss.ToUpper().ToString() != "HOLD")
{
Response.Redirect("~/Users/AdminDb/AdminDb.aspx", false);
}
else
{
lblEmpMsg.Text = "Your account is on HOLD. Please contact the administrator.";
lblEmpMsg.ForeColor = System.Drawing.Color.Red;
Session["UserID"] = null;
}
}
}
}
else
{
lblEmpMsg.Text = "UserName/Password Incorrect.";
lblEmpMsg.ForeColor = System.Drawing.Color.Red;
Session["Role"] = null;
Session["UserID"] = null;
}
}