SGGL_SHJ/SGGL/FineUIPro.Web/CQMS/Material/ConstructionTestView.aspx.cs

139 lines
4.8 KiB
C#
Raw Normal View History

2022-09-05 16:36:31 +08:00
using BLL;
using System;
namespace FineUIPro.Web.CQMS.Material
{
public partial class ConstructionTestView : PageBase
{
/// <summary>
/// 主键
/// </summary>
public string ConstructionTestId
{
get
{
return (string)ViewState["ConstructionTestId"];
}
set
{
ViewState["ConstructionTestId"] = 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)
{
BLL.UnitService.InitUnitDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, true);
BLL.UnitService.InitUnitDropDownList(this.drpCheckUnit, this.CurrUser.LoginProjectId, true);
2022-09-05 16:36:31 +08:00
BLL.ConstructionTestTypeService.InitConstructionTestType(this.drpConstructionTestType, true);
BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpWitness, this.CurrUser.LoginProjectId, string.Empty, string.Empty, true);
ConstructionTestId = Request.Params["ConstructionTestId"];
if (!string.IsNullOrEmpty(ConstructionTestId))
{
Model.Material_ConstructionTest ConstructionTest = BLL.CQMS_ConstructionTestService.GetConstructionTestByConstructionTestId(ConstructionTestId);
this.txtConstructionTestName.Text = ConstructionTest.ConstructionTestName;
this.hdId.Text = ConstructionTestId;
if (!string.IsNullOrEmpty(ConstructionTest.UnitId))
{
drpUnit.SelectedValue = ConstructionTest.UnitId;
}
if (!string.IsNullOrEmpty(ConstructionTest.ConstructionTestTypeId))
{
drpConstructionTestType.SelectedValue = ConstructionTest.ConstructionTestTypeId;
}
this.txtSpotCheckRate.Text = ConstructionTest.SpotCheckRate;
this.txtSpotCheckNum.Text = ConstructionTest.SpotCheckNum;
if (!string.IsNullOrEmpty(ConstructionTest.Witness))
{
string[] strs = ConstructionTest.Witness.Split(',');
this.drpWitness.SelectedValueArray = strs;
}
if (ConstructionTest.CheckResult != null)
{
if (ConstructionTest.CheckResult == true)
{
this.rblCheckResult.SelectedValue = "True";
}
else
{
this.rblCheckResult.SelectedValue = "False";
}
}
if (!string.IsNullOrEmpty(ConstructionTest.CheckUnit))
{
drpCheckUnit.SelectedValue = ConstructionTest.CheckUnit;
}
}
}
}
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(this.hdId.Text))
{
this.hdId.Text = SQLHelper.GetNewID();
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/ConstructionTest&menuId={1}", this.hdId.Text, BLL.Const.ConstructionTestMenuId)));
}
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;
}
}
}