171 lines
5.3 KiB
C#
171 lines
5.3 KiB
C#
using BLL;
|
|
using Newtonsoft.Json.Linq;
|
|
using System;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web.UI.WebControls;
|
|
using AspNet = System.Web.UI.WebControls;
|
|
|
|
namespace FineUIPro.Web.CQMS.Plan
|
|
{
|
|
public partial class MainPlanView : PageBase
|
|
{
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string MainPlanId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["MainPlanId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["MainPlanId"] = value;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 办理类型
|
|
/// </summary>
|
|
public string State
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["State"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["State"] = value;
|
|
}
|
|
}
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
MainPlanId = Request.Params["MainPlanId"];
|
|
this.drpPerson.DataTextField = "PersonName";
|
|
this.drpPerson.DataValueField = "PersonId";
|
|
this.drpPerson.DataSource = (from x in Funs.DB.Person_Persons where x.UnitId == Const.UnitId_SEDIN && x.DepartId == Const.Depart_constructionId && x.IsOffice == true select x).ToList();
|
|
this.drpPerson.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpPerson);
|
|
if (!string.IsNullOrEmpty(MainPlanId))
|
|
{
|
|
Model.Plan_MainPlan MainPlan = BLL.CQMS_MainPlanService.GetMainPlanByMainPlanId(MainPlanId);
|
|
hdId.Text = this.MainPlanId;
|
|
txtPlanCode.Text = MainPlan.PlanCode;
|
|
txtFileName.Text = MainPlan.FileName;
|
|
List<string> list = BLL.CQMS_MainPlanApproveService.GetAudit3PersonIds(MainPlanId);
|
|
if (list.Count > 0)
|
|
{
|
|
this.Audit.Hidden = false;
|
|
this.drpPerson.SelectedValueArray = list.ToArray();
|
|
}
|
|
gvApprove.DataSource = BLL.CQMS_MainPlanApproveService.getListData(this.MainPlanId);
|
|
gvApprove.DataBind();
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// 时间转换
|
|
/// </summary>
|
|
/// <param name="date"></param>
|
|
/// <returns></returns>
|
|
public string ConvertDate(object date)
|
|
{
|
|
if (date != null)
|
|
{
|
|
return string.Format("{0:yyyy-MM-dd}", Convert.ToDateTime(date));
|
|
}
|
|
else
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 把状态转换代号为文字形式
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
protected string ConvertState(object state)
|
|
{
|
|
if (state != null)
|
|
{
|
|
if (state.ToString() == BLL.Const.MainPlan_ReCompile)
|
|
{
|
|
return "重新编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Compile)
|
|
{
|
|
return "编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Audit1)
|
|
{
|
|
return "施工经理审核";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Audit2)
|
|
{
|
|
return "部门评审小组审核";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Audit3)
|
|
{
|
|
return "审核";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Audit4)
|
|
{
|
|
return "项目经理批准";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Audit5)
|
|
{
|
|
return "评审小组组长确认";
|
|
}
|
|
else if (state.ToString() == BLL.Const.MainPlan_Complete)
|
|
{
|
|
return "审批完成";
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
|
|
protected void imgBtnFile_Click(object sender, EventArgs e)
|
|
{
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/Plan&menuId={1}", hdId.Text, BLL.Const.MainPlanMenuId)));
|
|
}
|
|
|
|
private string GetStringByArray(string[] array)
|
|
{
|
|
string str = string.Empty;
|
|
foreach (var item in array)
|
|
{
|
|
if (item != BLL.Const._Null)
|
|
{
|
|
str += item + ",";
|
|
}
|
|
}
|
|
if (!string.IsNullOrEmpty(str))
|
|
{
|
|
str = str.Substring(0, str.LastIndexOf(","));
|
|
}
|
|
return str;
|
|
}
|
|
}
|
|
} |