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.Infrastructure.Common; using CY.Model; namespace CY.WebForm.Pages.sysInquiry { public partial class CargageList : BasePage { #region 变量 CargageBLL _cargageBLL = new CargageBLL(); #endregion #region 属性 #endregion #region 方法 /// /// 初始化绑定页面 /// private void BindPage() { int cargageTypeId = ddlCargageType.SelectedValue.ToInt32().Value; Inquiry_Cargage model = _cargageBLL.GetModel(InquiryConditionObj.InquiryId, cargageTypeId); if (model != null) { this.txtCargageValue.Value = model.CargageValue.ToDecimal2Yen(); this.txtStartPrice.Value = model.StartPrice.ToDecimal2Yen(); } else { this.txtCargageValue.Value = "0"; this.txtStartPrice.Value = "0"; } } #endregion #region 事件 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindPage(); } } protected void ddlCargageType_SelectedIndexChanged(object sender, EventArgs e) { BindPage(); } /// /// 保存事件 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { bool isSuccess = true; Inquiry_Cargage model = new Inquiry_Cargage(); model.FirmId = InquiryConditionObj.ActualFirmId; model.CargageValue = this.txtCargageValue.Value.ToDecimal2().Value; model.StartPrice = this.txtStartPrice.Value.ToDecimal2().Value; model.Operater = CurrentUser.ShortName; model.OperateTime = DateTime.Now; model.LastUpdateTime = DateTime.Now; model.CargateTypeId = ddlCargageType.SelectedValue.ToInt32().Value; isSuccess = _cargageBLL.SaveModel(model,InquiryConditionObj); if (isSuccess) { JavaScript.MessageBox("保存成功", this); } else { JavaScript.MessageBox("保存失败", this); } } #endregion } }