本文整理汇总了C#中Customers.ChckCustNBStById方法的典型用法代码示例。如果您正苦于以下问题:C# Customers.ChckCustNBStById方法的具体用法?C# Customers.ChckCustNBStById怎么用?C# Customers.ChckCustNBStById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers.ChckCustNBStById方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ButtonCustLogin_Click
protected void ButtonCustLogin_Click(object sender, EventArgs e)
{
string CustID = TextBoxCustId.Text;
string CustPass = TextBoxPass.Text;
Customers ChckCustID = new Customers();
bool ChckCust = ChckCustID.ChckCustById(Convert.ToInt32(CustID));
bool ChckCustNB = ChckCustID.ChckCustNetBankingById(Convert.ToInt32(CustID));
bool ChckCustNBSt = ChckCustID.ChckCustNBStById(Convert.ToInt32(CustID));
if (ChckCust != true)
{
LabelError.Text = "You entered wrong customer ID.";
}
else if (ChckCustNB != true)
{
LabelError.Text = "1st aplly for it.";
}
else if (ChckCustNBSt != true)
{
LabelError.Text = "Your request stil panding.";
}
else
{
Connection con = new Connection();
string strConnString = con.GetConnString();
using (SqlConnection SqlCon = new SqlConnection(strConnString))
{
SqlCommand SqlComm = new SqlCommand("", SqlCon);
SqlCon.Open();
string query = string.Format("SELECT nb_pass FROM net_banking WHERE nb_cid='" + Convert.ToInt32(CustID) + "'");
SqlComm.CommandText = query;
string dbPass = (String)SqlComm.ExecuteScalar();
if (dbPass == CustPass)
{
Session["Cust_Id"] = Convert.ToInt32(CustID);
Response.Redirect("~/users/Default.aspx");
}
else
{
LabelError.Text = "Wrong password.";
}
}
}
}