diff --git a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs index 5880837..a691333 100644 --- a/SUBQHSE/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs @@ -1063,14 +1063,14 @@ namespace FineUIPro.Web.ProjectData { var obj = Grid1.SelectedRow.Values; string num = obj[0].ToString(); - string code = obj[1].ToString(); - string name = obj[2].ToString(); - string shortname = obj[3].ToString(); - string startdate = obj[4].ToString(); - string enddate = obj[5].ToString(); - string address = obj[6].ToString(); + string code = obj[1].ToString().Trim(); + string name = obj[2].ToString().Trim(); + string shortname = obj[3].ToString().Trim(); + string startdate = obj[4].ToString().Trim(); + string enddate = obj[5].ToString().Trim(); + string address = obj[6].ToString().Trim(); //string proaddtype = obj[7].ToString(); - string proaddtype = (Grid1.SelectedRow.FindControl("lblProaddtype") as AspNet.Label).Text; + string proaddtype = (Grid1.SelectedRow.FindControl("lblProaddtype") as AspNet.Label).Text.Trim(); var relatePro = Funs.DB.Base_Project.FirstOrDefault(x => x.MasterSysId == masterSysId && (x.ProjectId != this.ProjectId || (this.ProjectId == null && x.ProjectId != null))); if (relatePro != null) @@ -1083,26 +1083,40 @@ namespace FineUIPro.Web.ProjectData ShowNotify($"已存在相同名称、编号的项目:({relatePro.ProjectCode}){relatePro.ProjectName}!", MessageBoxIcon.Warning); } - this.txtProjectName.Text = name; - this.txtProjectCode.Text = code; - if (!string.IsNullOrWhiteSpace(shortname)) + //this.txtProjectName.Text = name; + //this.txtProjectCode.Text = code; + if (string.IsNullOrWhiteSpace(this.txtProjectName.Text.Trim())) + { + this.txtProjectName.Text = name; + } + if (string.IsNullOrWhiteSpace(this.txtProjectCode.Text.Trim())) + { + this.txtProjectCode.Text = code; + } + if (string.IsNullOrWhiteSpace(this.txtShortName.Text.Trim())) { this.txtShortName.Text = shortname; } - if (!string.IsNullOrWhiteSpace(address)) + if (string.IsNullOrWhiteSpace(this.txtProjectAddress.Text.Trim())) { this.txtProjectAddress.Text = address; } - if (!string.IsNullOrWhiteSpace(startdate)) + if (string.IsNullOrWhiteSpace(this.txtStartDate.Text.Trim())) { - this.txtStartDate.Text = startdate; + if (!string.IsNullOrWhiteSpace(startdate)) + { + this.txtStartDate.Text = startdate; + } } - if (!string.IsNullOrWhiteSpace(enddate)) + if (string.IsNullOrWhiteSpace(this.txtEndDate.Text.Trim())) { - this.txtEndDate.Text = enddate; - ChangeDuration(); + if (!string.IsNullOrWhiteSpace(enddate)) + { + this.txtEndDate.Text = enddate; + ChangeDuration(); + } } - if (proaddtype == "境外") + if (!string.IsNullOrWhiteSpace(proaddtype) && proaddtype == "境外") { this.ckbIsForeign.Checked = true; }