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

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

        MES_BD_ZY_DOC saveEntity = new MES_BD_ZY_DOC();

        request.Entity = saveEntity;

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

        saveEntity.GUID = this.key;

        EciResponse response = SOA.Execute(request);

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

        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_ZY_DOC mesBdZyDoc = new MES_BD_ZY_DOC(MES_BD_ZY_DOC.Fields.GUID);

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

            val.SaveValidate(context, mesBdZyDoc, isAdd);

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

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

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

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

        request.Key = this.key;

        EciResponse response = SOA.Execute(request);

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

        if (!data.IsNull())
        {
            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_ZY_DOC mesBdZyDoc, bool isAdd)
 {
 }