protected void btnSave_Click(object sender, EventArgs e) { EciRequest request = new EciRequest(MESService.MesBdCpxsCcSave); request.IsAdd = this.key.NullOrEmpty(); MES_BD_CPXS_CC saveEntity = new MES_BD_CPXS_CC(); request.Entity = saveEntity; saveEntity.Data = this.GetEntityFromUI().Data; saveEntity.GUID = this.key; EciResponse response = SOA.Execute(request); MES_BD_CPXS_CC data = response.Entity.Upgrade <MES_BD_CPXS_CC>(); if (request.IsAdd) { this.key = data.GUID; this.btnAdd.Enabled = true; //this.txtCreateDate.Text = DateTime.Now.ToFullString(); //this.txtCreateUser.Text = this.UserInfo.UserName; } //this.txtUpdateDate.Text = DateTime.Now.ToFullString(); //this.txtUpdateUser.Text = this.UserInfo.UserName; response.Message.Tip(); }
public EntityBase Save(BLLContext context, EntityBase saveEntity, bool isAdd) { MES_BD_CPXS_CC mesBdCpxsCc = new MES_BD_CPXS_CC(MES_BD_CPXS_CC.Fields.GUID); mesBdCpxsCc.Data = saveEntity.Data; mesBdCpxsCc.EffectDataFields(); val.SaveValidate(context, mesBdCpxsCc, isAdd); if (isAdd) { mesBdCpxsCc.GUID = Guid.NewGuid().ToString("N"); mesBdCpxsCc.AddUserInfo(context, isAdd); mesBdCpxsCc.Validate(); mesBdCpxsCc.Insert(context.Transaction); } else { mesBdCpxsCc.AddUserInfo(context, isAdd); mesBdCpxsCc.NotSave("CREATE_DATE,CREATE_USER"); mesBdCpxsCc.Validate(); mesBdCpxsCc.Update(context.Transaction); } return(mesBdCpxsCc); }
private void LoadRecord() { EciRequest request = new EciRequest(MESService.MesBdCpxsCcLoad); request.Key = this.key; EciResponse response = SOA.Execute(request); MES_BD_CPXS_CC data = response.DataTable.ToEntity <MES_BD_CPXS_CC>(); this.Bind(data); }
/// <summary> /// 保存验证 /// </summary> /// <param name="context"></param> /// <param name="eciDataGroup"></param> /// <param name="isAdd"></param> public void SaveValidate(BLLContext context, MES_BD_CPXS_CC mesBdCpxsCc, bool isAdd) { }