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