using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Web;
|
using System.Web.UI;
|
using System.Web.UI.WebControls;
|
using CY.Infrastructure.Common;
|
using CY.BLL.Inquiry;
|
using CY.Model;
|
|
namespace CY.WebForm.Pages.sysInquiry
|
{
|
public partial class TaxationCostList : BasePage
|
{
|
#region 变量
|
TaxationCostBLL _taxationCostBLL = new TaxationCostBLL();
|
#endregion
|
|
#region 属性
|
#endregion
|
|
#region 方法
|
/// <summary>
|
/// 初始化绑定页面
|
/// </summary>
|
private void BindPage()
|
{
|
IList<Inquiry_TaxationCost> list = _taxationCostBLL.GetTaxationCostList(InquiryConditionObj.InquiryId);
|
if (list != null && list.Count > 0)
|
{
|
Inquiry_TaxationCost model = list.Single<Inquiry_TaxationCost>(p => p.TaxType == 2);
|
this.txtPlainnvoice.Text = model.TaxVale.ToDecimal2Yen();
|
model = list.Single<Inquiry_TaxationCost>(p => p.TaxType == 3);
|
this.txtAddnvoice.Text = model.TaxVale.ToDecimal2Yen();
|
}
|
}
|
|
#endregion
|
|
#region 事件
|
protected void Page_Load(object sender, EventArgs e)
|
{
|
if (!IsPostBack)
|
{
|
BindPage();
|
}
|
}
|
|
/// <summary>
|
/// 保存事件
|
/// </summary>
|
/// <param name="sender"></param>
|
/// <param name="e"></param>
|
protected void btnSave_Click(object sender, EventArgs e)
|
{
|
|
IList<Inquiry_TaxationCost> list = new List<Inquiry_TaxationCost>();
|
Inquiry_TaxationCost model = null;
|
model = new Inquiry_TaxationCost();
|
model.FirmId = InquiryConditionObj.ActualFirmId;
|
model.TaxType = 2;
|
model.TaxVale = Convert.ToDecimal(this.txtPlainnvoice.Text);
|
model.Operater = CurrentUser.ShortName;
|
model.OperateTime = DateTime.Now;
|
model.LastUpdateTime = DateTime.Now;
|
list.Add(model);
|
model = new Inquiry_TaxationCost();
|
model.FirmId = InquiryConditionObj.ActualFirmId;
|
model.TaxType = 3;
|
model.TaxVale = Convert.ToDecimal(this.txtAddnvoice.Text);
|
model.Operater = CurrentUser.ShortName;
|
model.OperateTime = DateTime.Now;
|
model.LastUpdateTime = DateTime.Now;
|
|
list.Add(model);
|
bool isSuccess = _taxationCostBLL.SaveTaxationCost(list,InquiryConditionObj);
|
if (isSuccess)
|
{
|
JavaScript.MessageBox("保存成功", this);
|
}
|
else
|
{
|
JavaScript.MessageBox("保存失败", this);
|
}
|
}
|
#endregion
|
|
|
}
|
}
|