CNCEC_SUBQHSE_WUHUAN/SGGL/FineUIPro.Web/JDGL/Check/SteelStructureCompletion.as...

100 lines
3.1 KiB
C#
Raw Normal View History

2021-05-20 17:16:01 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using BLL;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.JDGL.Check
{
public partial class SteelStructureCompletion : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//GetButtonPower();
BindGrid();
}
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == BLL.Const._Null)
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.SteelStructureCompletionMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
}
}
}
#endregion
/// <summary>
/// 加载Grid
/// </summary>
private void BindGrid()
{
string strSql = @"select *
from dbo.View_JDGL_SteelStructureCompletion qc
where qc.ProjectId=@ProjectId order by qc.UnitName";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#region
/// <summary>
/// 月份选择事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtMonths_TextChanged(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 导入按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SteelStructureCompletionIn.aspx?ProjectId={0}", this.CurrUser.LoginProjectId, "导入 - ")));
}
/// <summary>
/// 关闭导入弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
}
}