SGGL_SHJ/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineFinish.aspx.cs

103 lines
3.8 KiB
C#

using BLL;
using System;
namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class PipelineFinish : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string pipelineId = Request.Params["PipelineId"];
if (!string.IsNullOrEmpty(pipelineId))
{
var pipe = BLL.PipelineService.GetPipelineByPipelineId(pipelineId);
lbPipelineCode.Text = pipe.PipelineCode;
if (pipe.IsFinished == true)
{
drpIsFinish.SelectedValue = "1";
}
else
{
drpIsFinish.SelectedValue = "0";
}
txtWBSId.Text = pipe.WBSId;
txtPlanStartDate.Text = pipe.PlanStartDate != null ? string.Format("{0:yyyy-MM-dd}", pipe.PlanStartDate) : "";
txtPlanEndDate.Text = pipe.PlanEndDate != null ? string.Format("{0:yyyy-MM-dd}", pipe.PlanEndDate) : "";
txtActStartDate.Text = pipe.ActStartDate != null ? string.Format("{0:yyyy-MM-dd}", pipe.ActStartDate) : "";
txtActEndDate.Text = pipe.ActEndDate != null ? string.Format("{0:yyyy-MM-dd}", pipe.ActEndDate) : "";
// wbsid列待做
if (string.IsNullOrEmpty(pipe.WBSId))
{
string unitworkId = pipe.UnitWorkId;
}
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.HJGL_PipelineMenuId, Const.BtnSave))
{
if (!string.IsNullOrEmpty(Request.Params["PipelineId"]))
{
DateTime? planStartDate = null;
DateTime? planEndDate = null;
DateTime? actStartDate = null;
DateTime? actEndDate = null;
bool? isFinished = null;
if (txtPlanStartDate.Text != "")
{
planStartDate = Convert.ToDateTime(txtPlanStartDate.Text.Trim());
}
if (txtPlanEndDate.Text != "")
{
planEndDate = Convert.ToDateTime(txtPlanEndDate.Text.Trim());
}
if (txtActStartDate.Text != "")
{
actStartDate = Convert.ToDateTime(txtActStartDate.Text.Trim());
}
if (txtActEndDate.Text != "")
{
actEndDate = Convert.ToDateTime(txtActEndDate.Text.Trim());
isFinished = true;
}
BLL.PipelineService.UpdatePipelinePlan(Request.Params["PipelineId"], txtWBSId.Text.Trim(), planStartDate, planEndDate, actStartDate, actEndDate, isFinished);
}
else
{
ShowNotify("请选择要完成的管线!", MessageBoxIcon.Warning);
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
protected void txtActEndDate_TextChanged(object sender, EventArgs e)
{
if (txtActEndDate.Text == "")
{
drpIsFinish.SelectedValue = "0";
}
else
{
drpIsFinish.SelectedValue = "1";
}
}
}
}