Exemplo n.º 1
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (tb_std_config.Exists(txtstlgrd.Value, txtcustno.Value, txtcust_tech_prot.Text))
         {
             ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "alert('当前客户钢种协议号重复');", true);
         }
         else
         {
             Mod_TB_STD_CONFIG mod = new Mod_TB_STD_CONFIG();
             mod.C_STD_CODE       = dropstd.SelectedItem.Text;
             mod.C_STD_ID         = dropstd.SelectedItem.Value;
             mod.C_CUST_TECH_PROT = txtcust_tech_prot.Text;
             mod.C_ZYX1           = dropzyx1.SelectedItem.Text;
             mod.C_ZYX2           = dropzyx2.SelectedItem.Text;
             mod.C_STL_GRD        = txtstlgrd.Value;
             mod.C_EMP_ID         = ltlempid.Text;
             mod.C_CUST_NO        = txtcustno.Value;
             mod.C_CUST_NAME      = txtcustname.Value;
             mod.C_ZZS            = dropzzs.SelectedItem.Text;
             if (tb_matrl_main.InsertFree(mod))
             {
                 ScriptManager.RegisterStartupScript(UpdatePanel1, this.Page.GetType(), "", "alert('保存成功');", true);
             }
         }
     }
     catch (Exception ex)
     {
         WebMsg.MessageBox(ex.Message);
     }
 }