protected void btnSave_Click(object sender, EventArgs e) { EciRequest request = new EciRequest(MESService.MesBdGysSave); request.IsAdd = this.key.NullOrEmpty(); MES_BD_GYS saveEntity = new MES_BD_GYS(); request.Entity = saveEntity; saveEntity.Data = this.GetEntityFromUI().Data; saveEntity.GUID = this.key; EciResponse response = SOA.Execute(request); MES_BD_GYS data = response.Entity.Upgrade <MES_BD_GYS>(); 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_GYS mesBdGys = new MES_BD_GYS(MES_BD_GYS.Fields.GUID); mesBdGys.Data = saveEntity.Data; mesBdGys.EffectDataFields(); val.SaveValidate(context, mesBdGys, isAdd); if (isAdd) { mesBdGys.GUID = Guid.NewGuid().ToString("N"); mesBdGys.AddUserInfo(context, isAdd); mesBdGys.Validate(); mesBdGys.Insert(context.Transaction); } else { mesBdGys.AddUserInfo(context, isAdd); mesBdGys.NotSave("CREATE_DATE,CREATE_USER"); mesBdGys.Validate(); mesBdGys.Update(context.Transaction); } return(mesBdGys); }
private void LoadRecord() { EciRequest request = new EciRequest(MESService.MesBdGysLoad); request.Key = this.key; EciResponse response = SOA.Execute(request); MES_BD_GYS data = response.DataTable.ToEntity <MES_BD_GYS>(); this.Bind(data); }
/// <summary> /// 保存验证 /// </summary> /// <param name="context"></param> /// <param name="eciDataGroup"></param> /// <param name="isAdd"></param> public void SaveValidate(BLLContext context, MES_BD_GYS mesBdGys, bool isAdd) { }