ChengDa_English/SGGL/FineUIPro.Web/HSSE/License/ApplyView.aspx.cs

91 lines
3.2 KiB
C#
Raw Normal View History

2022-03-15 17:36:38 +08:00
namespace FineUIPro.Web.HSSE.License
{
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
public partial class ApplyView : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string LicenseApplyId
{
get
{
return (string)ViewState["LicenseApplyId"];
}
set
{
ViewState["LicenseApplyId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.SimpleForm1.Title = UnitService.GetUnitNameByUnitId(Const.UnitId_CD) + this.Title;
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.LicenseApplyId = Request.Params["LicenseApplyId"];
if (!string.IsNullOrEmpty(this.LicenseApplyId))
{
var getApply = LicensePublicService.GetApplyById(this.LicenseApplyId);
if (getApply != null)
{
this.txtApplyUnit.Text = UnitService.GetUnitNameByUnitId(getApply.ApplyUnitId);
this.txtApplyManName.Text = UserService.GetUserNameByUserId(getApply.ApplyManId);
if (!string.IsNullOrEmpty(getApply.LicenseTypeId))
{
this.txtType.Text = LicenseTypeService.GetLicenseTypeById(getApply.LicenseTypeId).LicenseTypeName;
}
if (getApply.ApplyStartTime.HasValue)
{
this.txtApplyDate.Text = getApply.ApplyStartTime.Value.ToString("yyyy-MM-dd HH:mm");
}
}
}
this.BindGrid();
}
}
#endregion
#region
/// <summary>
/// 流程列表绑定数据
/// </summary>
private void BindGrid()
{
DataTable getDataTable = new DataTable();
if (!string.IsNullOrEmpty(this.LicenseApplyId))
{
string strSql = @"SELECT FlowOperateId,MenuId,DataId,SortIndex,AuditFlowName,OperaterId,Users.UserName AS OperaterName,OperaterTime,Opinion,IsClosed "
+ @" FROM dbo.Sys_FlowOperate LEFT JOIN Sys_User AS Users ON OperaterId = Users.UserId"
+ @" WHERE IsClosed = 1 AND DataId=@DataId ORDER BY SortIndex DESC";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@DataId", this.LicenseApplyId));
SqlParameter[] parameter = listStr.ToArray();
getDataTable = SQLHelper.GetDataTableRunText(strSql, parameter);
}
Grid1.DataSource = getDataTable;
Grid1.DataBind();
}
#endregion
}
}