示例#1
0
 private bool Edit(SupplyUnitSalesman originalEntity)
 {
     try
     {
         FormSupplyUnitSalesmanEdit editor = new FormSupplyUnitSalesmanEdit(FormRunMode.Edit, originalEntity);
         SupplyUnitSalesman         entity;
         if (editor.ShowDialog() == DialogResult.OK)
         {
             entity = editor.Entity;
             string message = string.Empty;
             //加入核实信息
             if (string.IsNullOrWhiteSpace(entity.IDCheckType))
             {
                 entity.IDCheckType = "当面核实";
             }
             entity.IDCheckUserId = Guid.Empty;
             entity.IsChecked     = false;
             //加入核实信息
             bool result = PharmacyDatabaseService.SaveSupplyUnitSalesman(out message, entity);
             if (result && string.IsNullOrWhiteSpace(message))
             {
                 MessageBox.Show(string.Format("编辑供货商业务人员:{0}", "成功"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 buttonQuery_Click(null, null);
                 return(false);
             }
             else
             {
                 MessageBox.Show(string.Format("编辑供货商业务人员:{0}", "失败" + message), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         this.Log.Error(ex);
         MessageBox.Show(string.Format("编辑供货商业务人员:{0}", "失败" + ex.Message), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(false);
 }
示例#2
0
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     try
     {
         FormSupplyUnitSalesmanEdit editor = new FormSupplyUnitSalesmanEdit();
         SupplyUnitSalesman         entity;
         if (editor.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             entity = editor.Entity;
             string message = string.Empty;
             //加入核实信息
             if (string.IsNullOrWhiteSpace(entity.IDCheckType))
             {
                 entity.IDCheckType = "当面核实";
             }
             entity.IDCheckUserId = Guid.Empty;
             entity.IsChecked     = false;
             //加入核实信息
             bool result = PharmacyDatabaseService.AddSupplyUnitSalesman(out message, entity);
             if (result && string.IsNullOrWhiteSpace(message))
             {
                 MessageBox.Show(string.Format("添加供货商业务人员:{0}", "成功"), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
                 buttonQuery_Click(sender, e);
             }
             else
             {
                 MessageBox.Show(string.Format("添加供货商业务人员:{0}", "失败" + message), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
         this.Log.Error(ex);
         MessageBox.Show(string.Format("添加供货商业务人员:{0}", "失败" + ex.Message), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }