private CuContactPersonEntity PrepareFormData()
 {
     //TODO:需要校验参数的合法性
     var entity = new CuContactPersonEntity();
     entity.CuId = hdCuId.Value;
     entity.CpId = int.Parse(hdCpId.Value);
     entity.CpName = txtCpName.Text;
     entity.Mobile = txtMobile.Text;
     entity.Phone = txtPhone.Text;
     entity.IsDefault = rYes.Checked;
     return entity;
 }
Exemplo n.º 2
0
 public void AddNewCuContactPerson(CuContactPersonEntity entity)
 {
     entity.CpId = null;
     entity.QQ = string.Empty;
     entity.WeChat = string.Empty;
     entity.Weibo = string.Empty;
     entity.Email = string.Empty;
     entity.Other = string.Empty;
     entity.Remark = string.Empty;
     entity.DeleteFlag = false;
     entity.Insert();
 }
Exemplo n.º 3
0
 public void UpdateCuContactPerson(CuContactPersonEntity entity)
 {
     if (entity.IsDefault == true)
     {
         using (var ts = new TransactionScope())
         {
             ClearDefault(entity.CuId);
             entity.Update();
             ts.Complete();
         }
     }
     else
     {
         entity.Update();
     }
 }
Exemplo n.º 4
0
 public void DeleteCuContactPerson(int cpId)
 {
     CuContactPersonEntity entity = new CuContactPersonEntity() {CpId = cpId, DeleteFlag = true};
     entity.Update();
 }