提交代码

This commit is contained in:
2024-12-25 15:43:38 +08:00
parent 0a2f9ea3a7
commit c0b489aaf4
79 changed files with 8536 additions and 1546 deletions
@@ -4,6 +4,7 @@ using System;
using System.Linq;
using System.ServiceModel;
using System.Text.RegularExpressions;
using System.Data;
namespace FineUIPro.Web.ProjectData
{
@@ -45,6 +46,10 @@ namespace FineUIPro.Web.ProjectData
var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
if (project != null)
{
if (!string.IsNullOrEmpty(project.MasterSysId))
{
this.drpMasterBox1.Value = project.MasterSysId;
}
this.txtProjectCode.Text = project.ProjectCode;
this.txtProjectName.Text = project.ProjectName;
this.txtProjectAddress.Text = project.ProjectAddress;
@@ -153,7 +158,10 @@ namespace FineUIPro.Web.ProjectData
ProjectRealCode = this.txtProjectRealCode.Text.Trim(),
IsCNCECShow = Convert.ToBoolean(this.rbIsCNCECShow.SelectedValue),
};
if (!string.IsNullOrWhiteSpace(this.drpMasterBox1.Text))
{
project.MasterSysId = this.drpMasterBox1.Value;
}
if (!string.IsNullOrEmpty(txtStartDate.Text.Trim()))
{
project.StartDate = Funs.GetNewDateTime(this.txtStartDate.Text.Trim());
@@ -296,5 +304,56 @@ namespace FineUIPro.Web.ProjectData
///安全经理
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpHSSEManager, null, unitId, null, true);
}
private void BindGrid()
{
var list = ProjectService.GetMasterProjectInfos();
string code = ttbCodeSearch.Text.Trim();
string name = ttbNameSearch.Text.Trim();
if (!string.IsNullOrWhiteSpace(code))
{
list = list.Where(x => x.PrjCode.Contains(code)).ToList();
}
if (!string.IsNullOrWhiteSpace(name))
{
list = list.Where(x => x.PrjName.Contains(name)).ToList();
}
// 1.设置总项数(特别注意:数据库分页一定要设置总记录数RecordCount
Grid1.RecordCount = list.Count();
// 2.获取当前分页数据
DataTable table = Funs.LINQToDataTable(list);
// 3.绑定到Grid
Grid1.DataSource = table;
Grid1.DataBind();
}
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
BindGrid();
}
protected void ttbCodeSearch_Trigger1Click(object sender, EventArgs e)
{
ttbCodeSearch.Text = string.Empty;
ttbCodeSearch.ShowTrigger1 = false;
BindGrid();
}
protected void ttbCodeSearch_Trigger2Click(object sender, EventArgs e)
{
ttbCodeSearch.ShowTrigger1 = true;
BindGrid();
}
protected void ttbNameSearch_Trigger1Click(object sender, EventArgs e)
{
ttbNameSearch.Text = string.Empty;
ttbNameSearch.ShowTrigger1 = false;
BindGrid();
}
protected void ttbNameSearch_Trigger2Click(object sender, EventArgs e)
{
ttbNameSearch.ShowTrigger1 = true;
BindGrid();
}
}
}