Esempio n. 1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        EciRequest request = new EciRequest(MESService.MesBdBcSave);

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

        MES_BD_BC saveEntity = new MES_BD_BC();

        request.Entity = saveEntity;

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

        saveEntity.GUID = this.key;

        EciResponse response = SOA.Execute(request);

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

        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();
    }
Esempio n. 2
0
        public EntityBase Save(BLLContext context, EntityBase saveEntity, bool isAdd)
        {
            MES_BD_BC mesBdBc = new MES_BD_BC(MES_BD_BC.Fields.GUID);

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

            val.SaveValidate(context, mesBdBc, isAdd);

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

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

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

            return(mesBdBc);
        }
Esempio n. 3
0
    private void LoadRecord()
    {
        EciRequest request = new EciRequest(MESService.MesBdBcLoad);

        request.Key = this.key;

        EciResponse response = SOA.Execute(request);

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

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