CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/TestRun/DriverRun/DriverRunView.aspx.cs

136 lines
4.8 KiB
C#
Raw Normal View History

2024-02-26 16:45:05 +08:00
using BLL;
using System;
namespace FineUIPro.Web.TestRun.DriverRun
{
public partial class DriverRunView : PageBase
{
/// <summary>
/// 办理类型
/// </summary>
public string State
{
get
{
return (string)ViewState["State"];
}
set
{
ViewState["State"] = value;
}
}
#region
/// <summary>
/// 页面加载
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BLL.UnitService.InitUnitDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true);
BLL.UnitWorkService.InitUnitWorkDropDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, true);
string id = Request.Params["id"];
if (!string.IsNullOrEmpty(id))
{
Model.DriverRun_DriverRun data = BLL.DriverRunService.GetDriverRunById(id);
if (data != null)
{
var dt = DriverRunApproveService.getListData(id);
gvApprove.DataSource = dt;
gvApprove.DataBind();
this.hdId.Text = id;
this.txtCode.Text = data.Code;
if (!string.IsNullOrEmpty(data.UnitId))
{
this.drpUnitId.SelectedValue = data.UnitId;
}
this.drpUnitWorkIds.SelectedValueArray = data.InstallationId.Split(',');
this.txtDescriptions.Text = data.Descriptions;
this.txtObjective.Text = data.Objective;
if (data.NeedCompletedDate != null)
{
this.txtNeedCompletedDate.Text = string.Format("{0:yyyy-MM-dd}", data.NeedCompletedDate);
}
if (data.RealCompletedDate != null)
{
this.txtRealCompletedDate.Text = string.Format("{0:yyyy-MM-dd}", data.RealCompletedDate);
}
if (!string.IsNullOrEmpty(data.State))
{
State = data.State;
}
else
{
State = BLL.Const.DriverRun_Compile;
}
}
}
else
{
State = Const.DriverRun_Compile;
}
}
}
#endregion
#region
/// <summary>
/// 附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttach_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
{
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRun));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRun&menuId={1}", this.hdId.Text, BLL.Const.DriverRunMenuId)));
}
#endregion
/// <summary>
/// 把状态转换代号为文字形式
/// </summary>
/// <param name="state"></param>
/// <returns></returns>
protected string ConvertState(object state)
{
if (state != null)
{
if (state.ToString() == BLL.Const.DriverRun_Compile)
{
return "编制";
}
else if (state.ToString() == BLL.Const.DriverRun_Audit1)
{
return "开车负责人审批";
}
else if (state.ToString() == BLL.Const.DriverRun_Audit2)
{
return "保运主任审批";
}
else if (state.ToString() == BLL.Const.DriverRun_Audit3)
{
return "保运主任确认完成";
}
else if (state.ToString() == BLL.Const.DriverRun_Audit4)
{
return "开车负责人确认完成";
}
else if (state.ToString() == BLL.Const.DriverRun_Complete)
{
return "流程闭环";
}
else
{
return "";
}
}
return "";
}
}
}