20250329 工作台
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using NPOI.POIFS.Storage;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -10,6 +11,18 @@ namespace FineUIPro.Web.ProjectData
|
||||
{
|
||||
public partial class ProjectList : PageBase
|
||||
{
|
||||
public string projectLists
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["projectLists"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["projectLists"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -17,7 +30,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
@@ -26,8 +39,12 @@ namespace FineUIPro.Web.ProjectData
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
}
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
if (!string.IsNullOrEmpty(CurrUser.CompanyProjectId))
|
||||
{
|
||||
projectLists = CurrUser.CompanyProjectId;
|
||||
}
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
@@ -43,11 +60,11 @@ namespace FineUIPro.Web.ProjectData
|
||||
string strSql = "SELECT Project.ProjectId,Project.ProjectCode,Project.ProjectName,unit.UnitName,Project.StartDate,Project.EndDate,Project.ProjectAddress,ShortName, ConstructionMoney,"
|
||||
+ @" (CASE WHEN ProjectState='" + BLL.Const.ProjectState_2 + "' THEN '暂停中' WHEN ProjectState='" + BLL.Const.ProjectState_3 + "' THEN '已完工' ELSE '施工中' END) AS ProjectStateName,Project.ProjectState"
|
||||
+ @" ,ProjectMoney,DATEDIFF(DAY,Project.StartDate,GETDATE()) AS DayCount,ProjectType.ProjectTypeName AS ProjectTypeName,sysConst.ConstText as ProjectStateName2"
|
||||
+ @" FROM Base_Project AS Project LEFT JOIN Base_Unit as unit on unit.UnitId=Project.UnitId "
|
||||
+ @" FROM Base_Project AS Project LEFT JOIN Base_Unit as unit on unit.UnitId=Project.UnitId "
|
||||
+ @" LEFT JOIN Base_ProjectType AS ProjectType ON Project.ProjectType =ProjectType.ProjectTypeId"
|
||||
+ @" LEFT JOIN Sys_Const AS sysConst ON Project.ProjectState2 =sysConst.ConstValue AND sysConst.GroupId= '" + BLL.ConstValue.GroupId_ProjectState + "' "
|
||||
+ @" WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.txtProjectName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND ProjectName LIKE @ProjectName";
|
||||
@@ -69,9 +86,14 @@ namespace FineUIPro.Web.ProjectData
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
Grid1.DataSource = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataBind();
|
||||
|
||||
if (!string.IsNullOrEmpty(projectLists))
|
||||
{
|
||||
Grid1.SelectedRowIDArray = projectLists.Split(',').ToArray();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -151,7 +173,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
@@ -160,6 +182,14 @@ namespace FineUIPro.Web.ProjectData
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(projectLists))
|
||||
{
|
||||
projectLists = projectLists + "," + string.Join(",", this.Grid1.SelectedRowIDArray);
|
||||
}
|
||||
else
|
||||
{
|
||||
projectLists = string.Join(",", this.Grid1.SelectedRowIDArray);
|
||||
}
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
@@ -185,7 +215,7 @@ namespace FineUIPro.Web.ProjectData
|
||||
string unitName = string.Empty;
|
||||
if (projectId != null)
|
||||
{
|
||||
unitName =ProjectService.getProjectUnitNameByUnitType(projectId.ToString(), Const.ProjectUnitType_2);
|
||||
unitName = ProjectService.getProjectUnitNameByUnitType(projectId.ToString(), Const.ProjectUnitType_2);
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
@@ -235,5 +265,23 @@ namespace FineUIPro.Web.ProjectData
|
||||
ShowNotify("请选择项目进入!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSure_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(projectLists))
|
||||
{
|
||||
CurrUser.CompanyProjectId = string.Join(",", this.Grid1.SelectedRowIDArray) + "," + projectLists;
|
||||
}
|
||||
else
|
||||
{
|
||||
CurrUser.CompanyProjectId = string.Join(",", this.Grid1.SelectedRowIDArray);
|
||||
}
|
||||
|
||||
PageContext.Redirect("~/index.aspx", "_top");
|
||||
}
|
||||
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user