本文整理汇总了C#中Customers.ChckCustById方法的典型用法代码示例。如果您正苦于以下问题:C# Customers.ChckCustById方法的具体用法?C# Customers.ChckCustById怎么用?C# Customers.ChckCustById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customers
的用法示例。
在下文中一共展示了Customers.ChckCustById方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChckCustId
protected void ChckCustId()
{
string cust_id = Request.QueryString["cust_id"];
if (cust_id != null)
{
Customers ChckCust = new Customers();
bool result = ChckCust.ChckCustById(Convert.ToInt32(cust_id));
bool CustNb = ChckCust.ChckCustNetBankingById(Convert.ToInt32(cust_id));
if (result != false)
{
if (CustNb != false)
{
Panel2.Visible = true;
Panel1.Visible = false;
NetBanking NBCustDataById = NetBanking.NBData_ByCustId(Convert.ToInt32(cust_id));
if (NBCustDataById.NB_Status == "1")
{
ButtonAllowNB.Visible = false;
}
}
else
{
Panel1.Visible = true;
}
}
else
{
Panel1.Visible = true;
}
}
}
示例2: ButtonSubmit_Click
protected void ButtonSubmit_Click(object sender, EventArgs e)
{
int CustID = Convert.ToInt32(TextBoxCustId.Text);
Customers ChckCustID = new Customers();
bool ChckCust = ChckCustID.ChckCustById(CustID);
bool ChckCustNB = ChckCustID.ChckCustNetBankingById(CustID);
if(ChckCust != true)
{
LabelError.Text = "You enter wrong customer ID.";
}
else if (ChckCustNB != false)
{
LabelError.Text = "You already apply for it.";
}
else if (TextBoxPass.Text.Length < 6)
{
LabelError.Text = "Your password must be at least 6 characters.";
}
else if (TextBoxPass.Text != TextBoxConfirmPass.Text)
{
LabelError.Text = "Your confirm password did not match.";
}
else
{
Connection con = new Connection();
string strConnString = con.GetConnString();
using (SqlConnection SqlCon = new SqlConnection(strConnString))
{
SqlCommand SqlComm = new SqlCommand("", SqlCon);
SqlCon.Open();
string ReqDate = DateTime.Now.ToString();
string Status = "0";
string query = string.Format("INSERT INTO net_banking(nb_cid, nb_pass, nb_date, nb_status) VALUES('" + CustID + "', '" + TextBoxPass.Text + "', '" + ReqDate + "', '" + Status + "')");
SqlComm.CommandText = query;
SqlComm.ExecuteNonQuery();
/*string SetStatus = string.Format("UPDATE cust_details SET c_net_banking='1' WHERE c_id='" + CustID + "'");
SqlComm.CommandText = SetStatus;
SqlComm.ExecuteNonQuery();*/
}
Panel1.Visible = false;
Panel2.Visible = true;
}
}
示例3: 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.";
}
}
}
}
示例4: ChckCustId
protected void ChckCustId()
{
string CustId = Request.QueryString["CustId"];
if (CustId != null)
{
Customers ChckCust = new Customers();
bool result = ChckCust.ChckCustById(Convert.ToInt32(CustId));
if (result != false)
{
Panel1.Visible = false;
Panel2.Visible = true;
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 COUNT(*) FROM account WHERE ac_cid='" + Convert.ToInt32(CustId) + "'");
SqlComm.CommandText = query;
int ac_result = (int)SqlComm.ExecuteScalar();
if (ac_result == 0)
{
Panel3.Visible = true;
Panel2.Visible = false;
}
}
}
else
{
Panel1.Visible = true;
Panel2.Visible = false;
}
}
else
{
Response.Redirect("Default.aspx");
}
}