2021-12-02 10:52:43 +08:00
|
|
|
|
using BLL;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.UI;
|
|
|
|
|
using System.Web.UI.WebControls;
|
|
|
|
|
|
|
|
|
|
namespace FineUIPro.Web.CLGL
|
|
|
|
|
{
|
|
|
|
|
public partial class PurchaseRequisition : PageBase
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 加载页面
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!IsPostBack)
|
|
|
|
|
{
|
|
|
|
|
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
|
|
|
|
// 绑定表格
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-02 16:13:37 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void btnGet_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BLL.MCSWebService.getReqDetails(BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId));
|
|
|
|
|
this.BindGrid();
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-02 10:52:43 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 绑定数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void BindGrid()
|
|
|
|
|
{
|
|
|
|
|
string strSql = @"select *
|
|
|
|
|
from dbo.CLGL_PurchaseRequisition c
|
|
|
|
|
where c.ProjectId=@ProjectId order by c.PurchaseRequisitionCode desc";
|
|
|
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
2021-12-02 16:13:37 +08:00
|
|
|
|
listStr.Add(new SqlParameter("@ProjectId", BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId)));
|
2021-12-02 10:52:43 +08:00
|
|
|
|
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 Grid1_PageIndexChange(object sender, GridPageEventArgs 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();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 排序
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="sender"></param>
|
|
|
|
|
/// <param name="e"></param>
|
|
|
|
|
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
BindGrid();
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|