SGGL_SHJ/SGGL/FineUIPro.Web/CQMS/Technical/TechnicalDiscloseView.aspx.cs

135 lines
4.7 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.Technical
{
public partial class TechnicalDiscloseView : PageBase
{
/// <summary>
/// 主键
/// </summary>
public string TechnicalDiscloseId
{
get
{
return (string)ViewState["TechnicalDiscloseId"];
}
set
{
ViewState["TechnicalDiscloseId"] = 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)
{
TechnicalDiscloseId = Request.Params["TechnicalDiscloseId"];
BLL.SitePerson_PersonService.InitProjectUserListByProjectUnitTypeDropDownList(this.drpMainPartys, this.CurrUser.LoginProjectId, Const.ProjectUnitType_1, true);
if (!string.IsNullOrEmpty(TechnicalDiscloseId))
{
Model.Technical_TechnicalDisclose TechnicalDisclose = BLL.CQMS_TechnicalDiscloseService.GetTechnicalDiscloseById(TechnicalDiscloseId);
hdId.Text = this.TechnicalDiscloseId;
if (!string.IsNullOrEmpty(TechnicalDisclose.UnitId))
{
this.txtUnitName.Text = BLL.UnitService.GetUnitNameByUnitId(TechnicalDisclose.UnitId);
BindDiscloseMan(TechnicalDisclose.UnitId);
}
if (!string.IsNullOrEmpty(TechnicalDisclose.UnitWorkId))
{
txtUnitWork.Text = BLL.UnitWorkService.GetUnitWorkALLName(TechnicalDisclose.UnitWorkId);
}
txtDiscloseName.Text = TechnicalDisclose.DiscloseName;
txtDiscloseRequire.Text = TechnicalDisclose.DiscloseRequire;
if (!string.IsNullOrEmpty(TechnicalDisclose.DiscloseMan))
{
this.drpDiscloseMan.SelectedValue = TechnicalDisclose.DiscloseMan;
}
else
{
this.drpDiscloseMan.SelectedItem.Text = "";
}
if (TechnicalDisclose.DiscloseDate != null)
{
this.txtDiscloseDate.Text = string.Format("{0:yyyy-MM-dd}", TechnicalDisclose.DiscloseDate);
}
if (!string.IsNullOrEmpty(TechnicalDisclose.MainPartys))
{
this.drpMainPartys.SelectedValueArray = TechnicalDisclose.MainPartys.Split(',');
}
else
{
this.drpMainPartys.SelectedItem.Text = "";
}
}
}
}
private void BindDiscloseMan(string unitId)
{
this.drpDiscloseMan.DataTextField = "PersonName";
this.drpDiscloseMan.DataValueField = "PersonId";
this.drpDiscloseMan.DataSource = BLL.SitePerson_PersonService.GetSitePerson_PersonListByUnitIdsRoleIds(this.CurrUser.LoginProjectId, unitId, null);
this.drpDiscloseMan.DataBind();
Funs.FineUIPleaseSelect(this.drpDiscloseMan);
}
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;
}
}
protected void imgBtnFile_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(hdId.Text))
{
hdId.Text = SQLHelper.GetNewID();
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/Technical&menuId={1}", hdId.Text, BLL.Const.CQMSTechnicalDiscloseMenuId)));
}
}
}