using BLL; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.PHTGL.InvoiceManage { public partial class InvoiceStandingBookEdit : PageBase { #region /// /// 主键 /// public string InvoiceId { get { return (string)ViewState["InvoiceId"]; } set { ViewState["InvoiceId"] = value; } } #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.InvoiceId = Request.Params["InvoiceId"]; this.DropContractCode.DataTextField = "ContractNum"; this.DropContractCode.DataValueField = "ContractId"; this.DropContractCode.DataSource = BLL.PHTGL_ContractReviewService.GetContractReview_CompleteData(this.CurrUser.LoginProjectId); this.DropContractCode.DataBind(); if (!string.IsNullOrEmpty(this.InvoiceId)) { Model.PHTGL_Invoice model = BLL.PhtglInvoiceService.GetPHTGL_InvoiceById(this.InvoiceId); if (model != null) { this.txtInvoiceCode.Text = model.InvoiceCode; this.txtInvoiceNumber.Text = model.InvoiceNumber; this.txtSellerName.Text = model.SellerName; this.txtInvoiceDate.Text = model.InvoiceDate; this.txtAmountExcludingTax.Text = model.AmountExcludingTax.ToString(); this.txtTotalTax.Text = model.TotalTax.ToString(); this.txtRemark.Text = model.Remark; this.txtImagePath.Text = model.ImagePath; this.txtSellerTaxNumber.Text = model.SellerTaxNumber; this.txtInvoiceAmount.Text = model.InvoiceAmount.ToString(); DropContractCode.SelectedValue = model.ContractId; } } } } /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.InvoiceId)) { ShowNotify("暂不支持新增",MessageBoxIcon.Warning); } else { var model = PhtglInvoiceService.GetPHTGL_InvoiceById(InvoiceId); model.ContractId= DropContractCode.SelectedValue; BLL.PhtglInvoiceService.UpdatePHTGL_Invoice(model); } PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } } }