Пример #1
0
        /// <summary>
        /// Update
        /// </summary>
        private void UpdateData()
        {
            BD_FeeGroupData data = new BD_FeeGroupData();
            ITransaction tran = factory.GetLoadObject(data, hidId.Value);
            Execute(tran);
            if (!HasError)
            {
                //Get Data
                data = (BD_FeeGroupData)tran.Result;
                data.Name = txtName.Text;
                data.VAT = txtVAT.Text;
                data.OtherFee01 = txtOtherFee1.Text;
                data.OtherFee02 = txtOtherFee2.Text;

                data.Comment = txtComment.Text.Trim();
                data.FeeGroup = hidFeeGroup.Value;

                data.ModifiedBy = Page.User.Identity.Name;
                data.Modified = DateTime.Now.ToString("yyyyMMddHHmmss");
                data.BuildingId = Func.ParseString(Session["__BUILDINGID__"]);

                tran = factory.GetUpdateObject(data);

                Execute(tran);

                if (!HasError)
                {
                    OperationLogger.WriteInfo(Constants.LogOperationAlbumId, Constants.LogActionUpdateId, updateSuccess, Page.User.Identity.Name);
                    mvMessage.SetCompleteMessage(updateSuccess);
                    ScriptManager.RegisterClientScriptBlock(this.btnRegister, this.GetType(), key, postback, true);

                    lblCreated.Text = !"".Equals(data.Created) ? data.CreatedBy + "(" + Func.Formatdmyhms(data.Created) + ")" : "";
                    lblModified.Text = !"".Equals(data.Modified) ? data.ModifiedBy + "(" + Func.Formatdmyhms(data.Modified) + ")" : "";

                    ShowData();
                }
                else
                {
                    OperationLogger.WriteError(Constants.LogOperationAlbumId, Constants.LogActionUpdateId, updateUnSuccess, Page.User.Identity.Name);
                    mvMessage.AddError(updateUnSuccess);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Load data
        /// </summary>
        private void LoadData()
        {
            BD_FeeGroupData data = new BD_FeeGroupData();
            ITransaction tran = factory.GetLoadObject(data, hidId.Value);
            Execute(tran);
            if (!HasError)
            {
                //Get Data
                data = (BD_FeeGroupData)tran.Result;
                txtName.Text = data.Name;
                txtVAT.Text = data.VAT;
                txtOtherFee1.Text = data.OtherFee01;
                txtOtherFee2.Text = data.OtherFee02;

                txtComment.Text = data.Comment;

                lblCreated.Text = !"".Equals(data.Created) ? data.CreatedBy + "(" + Func.Formatdmyhms(data.Created) + ")" : "";
                lblModified.Text = !"".Equals(data.Modified) ? data.ModifiedBy + "(" + Func.Formatdmyhms(data.Modified) + ")" : "";

                hidId.Value = id;
                ShowData();
            }
        }