protected void btnSave_Click(object sender, EventArgs e)
    {
        EciRequest request = new EciRequest(MESService.MesBdCpxsSave);

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

        MES_BD_CPXS saveEntity = new MES_BD_CPXS();

        request.Entity = saveEntity;

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

        saveEntity.GUID = this.key;

        EciResponse response = SOA.Execute(request);

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

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

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

            val.SaveValidate(context, mesBdCpxs, isAdd);

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

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

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

            return(mesBdCpxs);
        }
    private void LoadRecord()
    {
        EciRequest request = new EciRequest(MESService.MesBdCpxsLoad);

        request.Key = this.key;

        EciResponse response = SOA.Execute(request);

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

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