示例#1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        EciRequest request = new EciRequest(MESService.MesBdMjSave);

        request.IsAdd = this.key.NullOrEmpty();

        MES_BD_MJ saveEntity = new MES_BD_MJ();

        request.Entity = saveEntity;

        saveEntity.Data = this.GetEntityFromUI().Data;

        saveEntity.GUID = this.key;

        EciResponse response = SOA.Execute(request);

        MES_BD_MJ data = response.Entity.Upgrade <MES_BD_MJ>();

        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();
    }
示例#2
0
        public EntityBase Save(BLLContext context, EntityBase saveEntity, bool isAdd)
        {
            MES_BD_MJ mesBdMj = new MES_BD_MJ(MES_BD_MJ.Fields.GUID);

            mesBdMj.Data = saveEntity.Data;
            mesBdMj.EffectDataFields();

            val.SaveValidate(context, mesBdMj, isAdd);

            if (isAdd)
            {
                mesBdMj.GUID = Guid.NewGuid().ToString("N");
                mesBdMj.AddUserInfo(context, isAdd);

                mesBdMj.Validate();
                mesBdMj.Insert(context.Transaction);
            }
            else
            {
                mesBdMj.AddUserInfo(context, isAdd);
                mesBdMj.NotSave("CREATE_DATE,CREATE_USER");

                mesBdMj.Validate();
                mesBdMj.Update(context.Transaction);
            }

            return(mesBdMj);
        }
示例#3
0
    private void LoadRecord()
    {
        EciRequest request = new EciRequest(MESService.MesBdMjLoad);

        request.Key = this.key;

        EciResponse response = SOA.Execute(request);

        MES_BD_MJ data = response.DataTable.ToEntity <MES_BD_MJ>();

        this.Bind(data);
    }
示例#4
0
 /// <summary>
 /// 保存验证
 /// </summary>
 /// <param name="context"></param>
 /// <param name="eciDataGroup"></param>
 /// <param name="isAdd"></param>
 public void SaveValidate(BLLContext context, MES_BD_MJ mesBdMj, bool isAdd)
 {
 }