Esempio n. 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (clientcode.Text.Trim() != null && clientcode.Text.Trim() != "")
     {
         HP_Client   model = new HP_Client();
         HPClientDAL dal   = new HPClientDAL();
         if (clientcode.Text.Trim() != null && clientcode.Text.Trim() != "")
         {
             model.ClientCode = clientcode.Text;
         }
         model.ID    = strID;
         model.IsDel = 0;
         if (dal.IsExist(clientcode.Text))
         {
             MessageBox.Show(this, "该信息已经存在,请不要重复添加!"); return;
         }
         if (dal.UpdateHPClient(model))
         {
             MessageBox.Show(this, "操作成功!");
         }
         else
         {
             MessageBox.Show(this, "操作失败!");
         }
     }
     else
     {
         MessageBox.Show(this, "名称不能为空!");
         return;
     }
 }
Esempio n. 2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (clientcode.Text.Trim() != null && clientcode.Text.Trim() != "")
     {
         HP_Client   model = new HP_Client();
         HPClientDAL dal   = new HPClientDAL();
         if (clientcode.Text.Trim() != null && clientcode.Text.Trim() != "")
         {
             model.ClientCode = clientcode.Text;
         }
         model.ID       = Guid.NewGuid().ToString("N").ToUpper();
         model.IsDel    = 0;
         model.SiteCode = Session["strSiteCode"].ToString();
         if (dal.IsExist(clientcode.Text))
         {
             MessageBox.Show(this, "该信息已经存在,请不要重复添加!"); return;
         }
         if (dal.AddHPClient(model))
         {
             MessageBox.Show(this, "操作成功!");
         }
         else
         {
             MessageBox.Show(this, "操作失败!");
         }
     }
     else
     {
         MessageBox.Show(this, "名称不能为空!");
         return;
     }
 }