| 
									
										
										
										
											2022-09-14 16:38:27 +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 PipelineMaterialSumList : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (this.CurrUser.UserId == BLL.Const.hfnbdId) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.btnGetAll.Hidden = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); | 
					
						
							| 
									
										
										
										
											2024-04-08 16:07:25 +08:00
										 |  |  |  |                 //var project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId); | 
					
						
							|  |  |  |  |                 //if (project.CLProjectCode != null) | 
					
						
							|  |  |  |  |                 //{ | 
					
						
							|  |  |  |  |                 //    MCSWebService.getProjectAllData(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getShelvesNo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getSubcontractor(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getMTODetailInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getContractListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getContractListSumInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getPipelineMaterialListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getPipelineMaterialCodeListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getPipelineSupplierListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getArrivalDetailListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getCheckOutDetailListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getPipelineMaterialSumListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //    //MCSWebService.getRequestDetailListInfo(project.CLProjectCode ?? 0); | 
					
						
							|  |  |  |  |                 //} | 
					
						
							| 
									
										
										
										
											2022-09-14 16:38:27 +08:00
										 |  |  |  |                 // 绑定表格 | 
					
						
							|  |  |  |  |                 this.BindGrid(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 进入软件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnUrl_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(String.Format("window.open('https://mat.cwcec.com');")); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取全部 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnGetAll_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BLL.MCSWebService.GetCLData(null, null); | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnGet_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BLL.MCSWebService.getPipelineMaterialSumListInfo(BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId)); | 
					
						
							|  |  |  |  |             this.BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 绑定数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private void BindGrid() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             string strSql = @"select *
 | 
					
						
							|  |  |  |  |                             from dbo.CLGL_PipelineMaterialSumList c  | 
					
						
							|  |  |  |  |                             where c.ProjectId=@ProjectId and c.Type=@Type order by c.C1 desc";
 | 
					
						
							|  |  |  |  |             List<SqlParameter> listStr = new List<SqlParameter>(); | 
					
						
							|  |  |  |  |             listStr.Add(new SqlParameter("@ProjectId", BLL.ProjectService.GetCLProjectCodeByProjectId(this.CurrUser.LoginProjectId))); | 
					
						
							|  |  |  |  |             listStr.Add(new SqlParameter("@Type", rblType.SelectedValue)); | 
					
						
							|  |  |  |  |             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(); | 
					
						
							|  |  |  |  |             if (rblType.SelectedValue == "M") | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.Grid1.Columns[1].Hidden = true; | 
					
						
							|  |  |  |  |                 this.Grid1.Columns[2].Hidden = true; | 
					
						
							|  |  |  |  |                 this.Grid1.Columns[3].Hidden = true; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.Grid1.Columns[1].Hidden = false; | 
					
						
							|  |  |  |  |                 this.Grid1.Columns[2].Hidden = false; | 
					
						
							|  |  |  |  |                 this.Grid1.Columns[3].Hidden = false; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #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 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void rblType_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             BindGrid(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |