SGGL_SHJ/SGGL/FineUIPro.Web/PHTGL/InvoiceManage/InvoiceStandingBookEdit.asp...

83 lines
2.9 KiB
C#

using BLL;
using System;
namespace FineUIPro.Web.PHTGL.InvoiceManage
{
public partial class InvoiceStandingBookEdit : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
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;
}
}
}
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
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());
}
}
}