20230324新增集团查看数据跳转页面、现场人员卡号补漏按钮功能
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace FineUIPro.Web.DataShow
|
||||
{
|
||||
public partial class Project : PageBase
|
||||
{
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格t
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT Project.ProjectId,Project.ProjectCode,Project.ProjectName,unit.UnitName,Project.StartDate,Project.EndDate,Project.ProjectAddress,ShortName, ConstructionMoney
|
||||
, ProjectMoney, DATEDIFF(DAY, Project.StartDate, GETDATE()) AS DayCount, ProjectType.ProjectTypeName AS ProjectTypeName
|
||||
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
|
||||
WHERE 1 = 1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
if (this.ckState.SelectedValue != "0")
|
||||
{
|
||||
if (this.ckState.SelectedValue == "1")
|
||||
{
|
||||
strSql += " AND (ProjectState = '1' OR ProjectState IS NULL)";
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND (ProjectState = @states )";
|
||||
listStr.Add(new SqlParameter("@states", this.ckState.SelectedValue));
|
||||
}
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
Grid1.DataSource = this.GetPagedDataTable(Grid1, tb);
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭弹出窗
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 项目经理
|
||||
|
||||
/// <summary>
|
||||
/// 施工经理
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertConstructionManager(object projectId)
|
||||
{
|
||||
return SitePerson_PersonService.GetProjectPersonNameByRoleId(projectId.ToString(), BLL.Const.ConstructionManager);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 施工分包商
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertSubcontractor(object projectId)
|
||||
{
|
||||
string unitName = string.Empty;
|
||||
if (projectId != null)
|
||||
{
|
||||
unitName = ProjectService.getProjectUnitNameByUnitType(projectId.ToString(), Const.ProjectUnitType_2);
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
|
||||
protected string ConvertOwn(object projectId)
|
||||
{
|
||||
string unitName = string.Empty;
|
||||
if (projectId != null)
|
||||
{
|
||||
unitName = ProjectService.getProjectUnitNameByUnitType(projectId.ToString(), Const.ProjectUnitType_4);
|
||||
}
|
||||
return unitName;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region Grid双击事件 编辑
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
EditData();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("../ProjectData/ProjectSetView.aspx?ProjectId={0}", Grid1.SelectedRowID, "查看 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnView_Click(object sender, EventArgs e)
|
||||
{
|
||||
EditData();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user