This commit is contained in:
2026-05-18 18:59:48 +08:00
parent 2c25bb3484
commit 2b1edf17c1
16 changed files with 26 additions and 236 deletions
@@ -39,17 +39,12 @@ namespace FineUIPro.Web.ProjectData
this.ProjectId = Request.QueryString["ProjectId"];
UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true);
BindGrid();
this.drpUnit.SelectedValue = Const.UnitId_SEDIN;
if (!String.IsNullOrEmpty(this.ProjectId))
{
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;
@@ -105,15 +100,6 @@ namespace FineUIPro.Web.ProjectData
}
this.txtCity.Text = project.City;
this.txtEnglishRemark.Text = project.EnglishRemark;
this.txtProjectRealCode.Text = project.ProjectRealCode;
if (project.IsCNCECShow == true)
{
this.rbIsCNCECShow.SelectedValue = "True";
}
else
{
this.rbIsCNCECShow.SelectedValue = "False";
}
}
}
else
@@ -155,13 +141,7 @@ namespace FineUIPro.Web.ProjectData
Country = this.txtCountry.Text.Trim(),
City = this.txtCity.Text.Trim(),
EnglishRemark = this.txtEnglishRemark.Text.Trim(),
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());
@@ -304,56 +284,5 @@ 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();
}
}
}