CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/DataShow/GJSXItem.aspx.cs

132 lines
4.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Aspose.Words;
using BLL;
using Org.BouncyCastle.Asn1.Ocsp;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Text;
namespace FineUIPro.Web.DataShow
{
public partial class GJSXItem : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string projectId = Request.Params["projectId"];
this.txtProject.Text = ProjectService.GetProjectNameByProjectId(projectId);
Funs.DropDownPageSize(this.ddlPageSize);
btnClose.OnClientClick = ActiveWindow.GetHideReference();
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格t
BindGrid();
this.Panel1.Title = "关键事项数据(" + BLL.UnitService.GetUnitNameByUnitId(BLL.Const.UnitId_CWCEC) + "";
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = "and state <> '1'";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", Request.Params["projectId"]));
listStr.Add(new SqlParameter("@sql_where", strSql));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunProc("Sp_GJSX_getlist", parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
#endregion
/// <summary>
/// 获取检查人名称
/// </summary>
/// <param name="CarryUnitIds"></param>
/// <returns></returns>
protected string ConvertCheckMan(object CarryUnitIds)
{
var uname = BLL.UserService.getUserNamesUserIds(CarryUnitIds);
if (string.IsNullOrEmpty(uname))
{
uname = CarryUnitIds.ToString();
}
return uname;
}
protected string ConvertProgressDetail(object GJSXID)
{
string detailStr = string.Empty;
if (!string.IsNullOrEmpty(GJSXID.ToString()))
{
Model.GJSX_detail detail = (from x in Funs.DB.GJSX_detail where x.GJSXID == GJSXID.ToString() && x.Progress_detail != null && x.Progress_detail != "" orderby x.Date descending select x).FirstOrDefault();
if (detail != null)
{
detailStr = detail.Progress_detail;
}
}
return detailStr;
}
}
}