0813
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class CostControlEdit : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
LoadData();
|
||||
string id = Request.Params["Id"];
|
||||
string operating = Request.Params["operating"];
|
||||
if (operating == "add")
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(id);
|
||||
if (costControl != null)
|
||||
{
|
||||
this.txtCostControlCode.Text = costControl.CostControlCode;
|
||||
this.txtCostControlName.Text = costControl.CostControlName;
|
||||
this.txtUnit.Text = costControl.Unit;
|
||||
if (costControl.TotalNum != null)
|
||||
{
|
||||
this.txtTotalNum.Text = costControl.TotalNum.ToString();
|
||||
}
|
||||
if (costControl.RealPrice != null)
|
||||
{
|
||||
this.txtRealPrice.Text = costControl.RealPrice.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string id = Request.Params["Id"];
|
||||
string code = Request.Params["Code"];
|
||||
string operating = Request.Params["operating"];
|
||||
if (operating == "add")
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(id);
|
||||
Model.WBS_CostControl costControl = new WBS_CostControl();
|
||||
costControl.CostControlCode = txtCostControlCode.Text.Trim();
|
||||
costControl.CostControlName = txtCostControlName.Text.Trim();
|
||||
costControl.ProjectId = wbsSet.ProjectId;
|
||||
costControl.WbsSetId = wbsSet.WbsSetId;
|
||||
costControl.Unit = txtUnit.Text.Trim();
|
||||
costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim());
|
||||
costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim());
|
||||
BLL.CostControlService.AddCostControl(costControl);
|
||||
//增加对应关系内容
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = id;
|
||||
wbsSetMatchCostControl.CostControlCode = costControl.CostControlCode;
|
||||
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "增加费用清单项!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(id);
|
||||
if (costControl != null)
|
||||
{
|
||||
//更新对应关系内容
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = BLL.WbsSetMatchCostControlService.GetWbsSetMatchCostControlByWbsSetIdAndCostControlCode(code, costControl.CostControlCode);
|
||||
if (wbsSetMatchCostControl != null)
|
||||
{
|
||||
wbsSetMatchCostControl.WbsSetId = code;
|
||||
wbsSetMatchCostControl.CostControlCode = txtCostControlCode.Text.Trim();
|
||||
BLL.WbsSetMatchCostControlService.UpdateWbsSetMatchCostControl(wbsSetMatchCostControl);
|
||||
}
|
||||
costControl.CostControlCode = txtCostControlCode.Text.Trim();
|
||||
costControl.CostControlName = txtCostControlName.Text.Trim();
|
||||
costControl.Unit = txtUnit.Text.Trim();
|
||||
costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim());
|
||||
costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim());
|
||||
BLL.CostControlService.UpdateCostControl(costControl);
|
||||
}
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "修改费用清单项!");
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user