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

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

        MES_BD_CITY saveEntity = new MES_BD_CITY();

        request.Entity = saveEntity;

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

        saveEntity.GUID = this.key;

        EciResponse response = SOA.Execute(request);

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

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

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

            val.SaveValidate(context, mesBdCity, isAdd);

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

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

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

            return(mesBdCity);
        }
Ejemplo n.º 3
0
    private void LoadRecord()
    {
        EciRequest request = new EciRequest(MESService.MesBdCityLoad);

        request.Key = this.key;

        EciResponse response = SOA.Execute(request);

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

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