using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL.Inquiry; using CY.Model; using CY.Infrastructure.Common; namespace CY.WebForm.Pages.sysInquiry { public partial class AdhesivePaperPrice : BasePage { #region 变量 AdhesivePaperPriceBLL _adhesivePaperPriceBLL = new AdhesivePaperPriceBLL(); #endregion #region 属性 #endregion #region 方法 /// /// 初始化绑定页面 /// private void BindPage() { Inquiry_AdhesivePaperPrice model = _adhesivePaperPriceBLL.GetModel(InquiryConditionObj.InquiryId); if (model != null) { this.txtPrice.Value = model.Price.ToString("0.00"); ViewState["Model"] = model; } } #endregion #region 事件 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindPage(); } } /// /// 保存事件 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { bool isSuccess = true; Inquiry_AdhesivePaperPrice model = ViewState["Model"] as Inquiry_AdhesivePaperPrice; if (model == null) { model = new Inquiry_AdhesivePaperPrice(); } model.FirmId = InquiryConditionObj.ActualFirmId; model.Price = this.txtPrice.Value.ToDecimal2().Value; model.Operater = CurrentUser.ShortName; model.OperateTime = DateTime.Now; model.LastUpdateTime = DateTime.Now; isSuccess = _adhesivePaperPriceBLL.SaveModel(model, InquiryConditionObj); if (isSuccess) { JavaScript.MessageBox("保存成功", this); } else { JavaScript.MessageBox("保存失败", this); } } #endregion } }