修改移交
This commit is contained in:
@@ -1,16 +1,141 @@
|
||||
using System;
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.Transfer.Chart
|
||||
{
|
||||
public partial class SystemstatusEdit : System.Web.UI.Page
|
||||
public partial class SystemstatusEdit : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
private string SystemNo
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["SystemNo"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["SystemNo"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Id"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Id"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack) {
|
||||
ProjectId = this.CurrUser.LoginProjectId;
|
||||
SystemNo = Request.Params["SystemNo"];
|
||||
var model = Funs.DB.Transfer_SystemControl.FirstOrDefault(x => x.ProjectId == ProjectId && x.SystemNo == SystemNo);
|
||||
if (model!=null)
|
||||
{
|
||||
Id = model.Id;
|
||||
txtPlanPWD.Text = model.PlanPWD.ToString();
|
||||
txtPlanJWD.Text = model.PlanJWD.ToString();
|
||||
txtMcPlan.Text = model.McPlan.ToString();
|
||||
txtSubmitPackage.Text = model.SubmitPackage;
|
||||
txtActualPWD.Text = model.ActualPWD.ToString();
|
||||
txtActualJWD.Text = model.ActualJWD.ToString();
|
||||
txtActualMC.Text = model.ActualMC.ToString();
|
||||
txtCommissioning.Text = model.Commissioning;
|
||||
txtIaQian.Text = model.IaQian;
|
||||
txtTcccQ.Text = model.TcccQ;
|
||||
ddlSystemStatus.SelectedValue = model.SystemStatus;
|
||||
txtTurnoverDescription.Text = model.TurnoverDescription;
|
||||
txtRemark.Text = model.Remark;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e) {
|
||||
var model = new Model.Transfer_SystemControl()
|
||||
{
|
||||
ProjectId=ProjectId,
|
||||
SystemNo=SystemNo,
|
||||
PlanPWD= Convert.ToDateTime(txtPlanPWD.Text),
|
||||
PlanJWD=Convert.ToDateTime(txtPlanJWD.Text),
|
||||
McPlan=Convert.ToDateTime(txtMcPlan.Text),
|
||||
SubmitPackage= txtSubmitPackage.Text,
|
||||
Commissioning= txtCommissioning.Text,
|
||||
IaQian= txtIaQian.Text,
|
||||
TcccQ= txtTcccQ.Text,
|
||||
SystemStatus= ddlSystemStatus.SelectedValue,
|
||||
TurnoverDescription= txtTurnoverDescription.Text,
|
||||
Remark= txtRemark.Text
|
||||
};
|
||||
if (!string.IsNullOrEmpty(txtActualPWD.Text))
|
||||
{
|
||||
model.ActualPWD = Convert.ToDateTime(txtActualPWD.Text);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtActualJWD.Text))
|
||||
{
|
||||
model.ActualJWD = Convert.ToDateTime(txtActualJWD.Text);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(txtActualMC.Text))
|
||||
{
|
||||
model.ActualMC = Convert.ToDateTime(txtActualMC.Text);
|
||||
}
|
||||
if (string.IsNullOrEmpty(Id))
|
||||
{
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
Funs.DB.Transfer_SystemControl.InsertOnSubmit(model);
|
||||
}
|
||||
else {
|
||||
model.Id = Id;
|
||||
var newModel = Funs.DB.Transfer_SystemControl.FirstOrDefault(p => p.Id == this.Id);
|
||||
newModel.PlanPWD = model.PlanPWD;
|
||||
newModel.PlanJWD = model.PlanJWD;
|
||||
newModel.McPlan = model.McPlan;
|
||||
newModel.SubmitPackage = model.SubmitPackage;
|
||||
newModel.Commissioning = model.Commissioning;
|
||||
newModel.IaQian = model.IaQian;
|
||||
newModel.TcccQ = model.TcccQ;
|
||||
newModel.SystemStatus = model.SystemStatus;
|
||||
newModel.TurnoverDescription = model.TurnoverDescription;
|
||||
newModel.Remark = model.Remark;
|
||||
newModel.ActualPWD = model.ActualPWD;
|
||||
newModel.ActualJWD = model.ActualJWD;
|
||||
newModel.ActualMC = model.ActualMC;
|
||||
}
|
||||
Funs.DB.SubmitChanges();
|
||||
ShowNotify("编辑成功", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user