本文整理汇总了C#中Profile.AddSupplier方法的典型用法代码示例。如果您正苦于以下问题:C# Profile.AddSupplier方法的具体用法?C# Profile.AddSupplier怎么用?C# Profile.AddSupplier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profile
的用法示例。
在下文中一共展示了Profile.AddSupplier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnAdd_Click
protected void btnAdd_Click(object sender, EventArgs e)
{
lblEMsg.Visible = false;
string[] Supp;
try
{
string sql = "SELECT COUNT(*) FROM SUPPLIER WHERE SUPPLIER_NAME = '" + txtSName.Text + "' And Status = 'A'";
SqlDataReader sdr;
Profile pro = new Profile();
sdr = pro.ReturnMDetails(sql);
sdr.Read();
int RegNo = (int)sdr[0];
if (RegNo > 0)
{
lblEMsg.Text = "Supplier Name already exists.";
lblEMsg.Visible = true;
sdr.Close();
return;
}
else
{
Supp = new string[15];
Supp[0] = txtSupplier.Text;
Supp[1] = txtSName.Text;
Supp[2] = txtAdd.Text;
Supp[3] = txtPhone.Text;
Supp[4] = txtFax.Text;
Supp[5] = txtemail.Text;
if (chkStatus.Checked == true)
{
Supp[6] = "A";
}
else
{
Supp[7] = "I";
}
bool status;
status = pro.AddSupplier(Supp);
if (status == false)
{
lblEMsg.Visible = true;
lblEMsg.Text = "Supplier creation Failed";
}
lblEMsg.Visible = true;
lblEMsg.Text = "Supplier added.";
ReadSupplier();
txtSName.Text = "";
txtAdd.Text = "";
txtPhone.Text = "";
txtFax.Text = "";
txtemail.Text = "";
}
}
catch (Exception ex)
{
throw ex;
}
}