private bool Edit(PurchaseUnitBuyer originalEntity)
 {
     try
     {
         FormPurchaseUnitBuyerEdit editor = new FormPurchaseUnitBuyerEdit(FormRunMode.Edit, originalEntity);
         PurchaseUnitBuyer         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.SavePurchaseUnitBuyer(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);
 }
 private void buttonAdd_Click(object sender, EventArgs e)
 {
     try
     {
         FormPurchaseUnitBuyerEdit editor = new FormPurchaseUnitBuyerEdit();
         PurchaseUnitBuyer         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.AddPurchaseUnitBuyer(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);
     }
 }