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

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

        MES_BD_CPXS_MJ saveEntity = new MES_BD_CPXS_MJ();

        request.Entity = saveEntity;

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

        saveEntity.GUID = this.key;

        EciResponse response = SOA.Execute(request);

        MES_BD_CPXS_MJ data = response.Entity.Upgrade <MES_BD_CPXS_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();
    }
Exemplo n.º 2
0
        public EntityBase Save(BLLContext context, EntityBase saveEntity, bool isAdd)
        {
            MES_BD_CPXS_MJ mesBdCpxsMj = new MES_BD_CPXS_MJ(MES_BD_CPXS_MJ.Fields.GUID);

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

            val.SaveValidate(context, mesBdCpxsMj, isAdd);

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

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

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

            return(mesBdCpxsMj);
        }
Exemplo n.º 3
0
    private void LoadRecord()
    {
        EciRequest request = new EciRequest(MESService.MesBdCpxsMjLoad);

        request.Key = this.key;

        EciResponse response = SOA.Execute(request);

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

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