Example #1
0
        /// <summary>
        /// 辅助检查
        /// </summary>
        /// <param name="checkId"></param>
        /// <param name="checkName"></param>
        /// <param name="checkPrice"></param>
        /// <returns></returns>
        public static bool AddExamine(ExaminePrice examinePrice)
        {
            string sSql = $@"
IF NOT EXISTS(Select * from ExaminePrice where CheckID = '{examinePrice.CheckID}')
Begin
Insert into ExaminePrice(CheckID,CheckName,CheckPrice) values('{examinePrice.CheckID}','{examinePrice.CheckName}','{examinePrice.CheckPrice}')
End
ElSE
Begin
Update ExaminePrice set CheckName = '{examinePrice.CheckName}',CheckPrice = '{examinePrice.CheckPrice}'  where CheckID = '{examinePrice.CheckID}'
End 
";

            return(ExecuteNonQuery(sSql) > 0);
        }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(cmbCheckStyle.Text.Trim()))
     {
         ExaminePrice examinePrice = new ExaminePrice()
         {
             CheckID    = cmbCheckStyle.SelectedValue.ToString(),
             CheckName  = cmbCheckStyle.Text.Trim(),
             CheckPrice = Convert.ToDecimal(txtPrice.Text.Trim())
         };
         if (bllExaminePrice.AddExamine(examinePrice))
         {
             MessageBox.Show(@"修改保存成功!");
             cmbCheckStyle.SelectedIndex = 0;
         }
     }
 }
Example #3
0
 public bool AddExamine(ExaminePrice examinePrice)
 {
     return(ErpServer.AddExamine(examinePrice));
 }