91 lines
3.0 KiB
C#
91 lines
3.0 KiB
C#
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.JDGL.Check
|
|
{
|
|
public partial class ElectricalCompletionEdit : PageBase
|
|
{
|
|
/// <summary>
|
|
/// id
|
|
/// </summary>
|
|
public string ElectricalCompletionId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ElectricalCompletionId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ElectricalCompletionId"] = value;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 项目id
|
|
/// </summary>
|
|
public string ProjectId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ProjectId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ProjectId"] = value;
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
|
|
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
|
ElectricalCompletionId = Request.Params["ElectricalCompletionId"];
|
|
if (!string.IsNullOrEmpty(ElectricalCompletionId))
|
|
{
|
|
|
|
Model.JDGL_ElectricalCompletion ElectricalCompletion = BLL.ElectricalCompletionService.GetElectricalCompletionById(ElectricalCompletionId);
|
|
if (ElectricalCompletion != null)
|
|
{
|
|
this.ProjectId = ElectricalCompletion.ProjectId;
|
|
if (ElectricalCompletion.ThisNum != null)
|
|
{
|
|
this.txtThisNum.Text = ElectricalCompletion.ThisNum.ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
SaveData(true);
|
|
}
|
|
|
|
private void SaveData(bool bl)
|
|
{
|
|
string ElectricalCompletionId = Request.Params["ElectricalCompletionId"];
|
|
Model.JDGL_ElectricalCompletion ElectricalCompletion = new Model.JDGL_ElectricalCompletion();
|
|
if (!string.IsNullOrEmpty(this.txtThisNum.Text.Trim()))
|
|
{
|
|
ElectricalCompletion.ThisNum = Convert.ToDecimal(this.txtThisNum.Text.Trim());
|
|
}
|
|
if (!string.IsNullOrEmpty(ElectricalCompletionId))
|
|
{
|
|
ElectricalCompletion.ElectricalCompletionId = ElectricalCompletionId;
|
|
BLL.ElectricalCompletionService.UpdateElectricalCompletion(ElectricalCompletion);
|
|
}
|
|
else
|
|
{
|
|
ElectricalCompletion.ElectricalCompletionId = SQLHelper.GetNewID(typeof(Model.JDGL_ElectricalCompletion));
|
|
BLL.ElectricalCompletionService.AddElectricalCompletion(ElectricalCompletion);
|
|
}
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
}
|
|
} |