diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs index 3d141719..3459f9a5 100644 --- a/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs @@ -86,7 +86,7 @@ else CONVERT(DECIMAL(10,2),100*(ISNULL(TtScount,0)*1.0/ISNULL(TtCount,0))) end ts.PlanPWD,PlanJWD,McPlan,SubmitPackage,ActualPWD,ActualJWD,ActualMC,Commissioning,IaQian,TcccQ,SystemStatus,TurnoverDescription,ts.Remark from( -SELECT SubCommissioningsystem as SubSysNo,Type,ProjectId FROM Transfer_LHCSystemList where ProjectId = @ProjectId group by SubCommissioningsystem,Type,ProjectId +SELECT SubCommissioningsystem as SubSysNo,SN,Type,ProjectId FROM Transfer_LHCSystemList where ProjectId = @ProjectId group by SubCommissioningsystem,SN,Type,ProjectId ) f left join Transfer_SystemControl ts on f.ProjectId=ts.ProjectId and f.SubSysNo=ts.SystemNo --piping @@ -176,7 +176,7 @@ where f.ProjectId = @ProjectId "; //strSql += " order by f.Type "; //strSql += " order by f.SubSysNo "; - strSql += " order by f.Type,f.SubSysNo "; + strSql += " order by f.Type,f.SN "; SqlParameter[] parameter = listStr.ToArray(); return SQLHelper.GetDataTableRunText(strSql, parameter); } diff --git a/SGGL/FineUIPro.Web/Transfer/LHCSystemListDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/LHCSystemListDataIn.aspx.cs index 62a27f36..d056a59a 100644 --- a/SGGL/FineUIPro.Web/Transfer/LHCSystemListDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/LHCSystemListDataIn.aspx.cs @@ -226,7 +226,8 @@ namespace FineUIPro.Web.Transfer } } } - else { + else + { string row4 = pds.Rows[i][5].ToString(); if (!string.IsNullOrEmpty(row4)) { @@ -472,9 +473,9 @@ namespace FineUIPro.Web.Transfer //根据项目id查询sn var snModel = Funs.DB.Transfer_LHCSystemList.Where(x => x.ProjectId == CurrUser.LoginProjectId && x.Type == Type).OrderByDescending(x => x.SN).FirstOrDefault(); - if (snModel == null && Sn==0) + if (snModel == null && Sn == 0) { - Sn = 1001; + Sn = Type == "0" ? 1001 : 2001; model.SN = Sn; } else @@ -484,32 +485,34 @@ namespace FineUIPro.Web.Transfer Sn = Convert.ToInt32(snModel.SN + 1); model.SN = Sn; } - else { + else + { Sn += 1; model.SN = Sn; } - + } model.SystemNo = pds.Rows[i][0].ToString().Trim(); - model.Commissioningsystemcode= pds.Rows[i][1].ToString().Trim(); - + model.Commissioningsystemcode = pds.Rows[i][1].ToString().Trim(); + model.CommissioningCodeDescription = pds.Rows[i][2].ToString().Trim(); if (Type == "0") { model.SubCommissioningsystem = pds.Rows[i][3].ToString().Trim(); //model.Turnover_Code= pds.Rows[i][4].ToString().Trim(); - DateTime t1, t2,t3; + DateTime t1, t2, t3; if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString())) model.PlanStartofTestingDate = t1; if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString())) model.PlanFinishofTestingDate = t2; - model.Status= pds.Rows[i][6].ToString().Trim(); + model.Status = pds.Rows[i][6].ToString().Trim(); if (DateTime.TryParse(pds.Rows[i][7].ToString(), out t3) && !string.IsNullOrEmpty(pds.Rows[i][7].ToString())) model.ActualFinishedDate = t3; } - else { + else + { model.Describe = pds.Rows[i][3].ToString().Trim(); model.SubCommissioningsystem = pds.Rows[i][4].ToString().Trim(); //model.Turnover_Code = pds.Rows[i][5].ToString().Trim(); diff --git a/SGGL/FineUIPro.Web/Transfer/LHCSystemListEdit.aspx.cs b/SGGL/FineUIPro.Web/Transfer/LHCSystemListEdit.aspx.cs index 4d39540a..583050a4 100644 --- a/SGGL/FineUIPro.Web/Transfer/LHCSystemListEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/LHCSystemListEdit.aspx.cs @@ -54,10 +54,11 @@ namespace FineUIPro.Web.Transfer #endregion protected void Page_Load(object sender, EventArgs e) { - if (!IsPostBack) { + if (!IsPostBack) + { Id = Request.Params["Id"]; ProjectId = this.CurrUser.LoginProjectId; - Type= Request.Params["Type"]; + Type = Request.Params["Type"]; if (Type == "1") Type1.Hidden = false; else @@ -91,38 +92,41 @@ namespace FineUIPro.Web.Transfer ddlSStatus.SelectedValue = model.Status; } } - else { + else + { var model = Funs.DB.Transfer_LHCSystemList.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId - && x.Type==Type); + && x.Type == Type); if (model == null) - txtSN.Text = "1001"; + txtSN.Text = Type == "0" ? "1001" : "2001"; else txtSN.Text = (Convert.ToInt32(model.SN) + 1).ToString(); } - + } } - protected void btnSave_Click(object sender, EventArgs e) { - var model = new Model.Transfer_LHCSystemList() { - ProjectId=ProjectId, - Type=Type, - SN=Convert.ToInt32(txtSN.Text), - SystemNo= txtSystem_No.Text, - Commissioningsystemcode= txtCommissioningsystemcode.Text, - CommissioningCodeDescription= txtCommissioningCodeDescription.Text, - SubCommissioningsystem= txtSubCommissioningsystem.Text, + protected void btnSave_Click(object sender, EventArgs e) + { + var model = new Model.Transfer_LHCSystemList() + { + ProjectId = ProjectId, + Type = Type, + SN = Convert.ToInt32(txtSN.Text), + SystemNo = txtSystem_No.Text, + Commissioningsystemcode = txtCommissioningsystemcode.Text, + CommissioningCodeDescription = txtCommissioningCodeDescription.Text, + SubCommissioningsystem = txtSubCommissioningsystem.Text, PlanStartofTestingDate = Funs.GetNewDateTime(this.txtPlanStartofTestingDate.Text), - Describe=txtDescribe.Text, + Describe = txtDescribe.Text, PlanFinishofTestingDate = Funs.GetNewDateTime(this.txtPlanFinishofTestingDate.Text), ActualFinishedDate = Funs.GetNewDateTime(this.txtActualFinishedDate.Text), - Status=ddlSStatus.SelectedValue + Status = ddlSStatus.SelectedValue }; if (!string.IsNullOrEmpty(Id)) { var newModel = Funs.DB.Transfer_LHCSystemList.FirstOrDefault(x => x.Id == Id); - if (newModel!=null) + if (newModel != null) { newModel.SN = model.SN; newModel.SystemNo = model.SystemNo; @@ -137,7 +141,8 @@ namespace FineUIPro.Web.Transfer newModel.UpdateTime = DateTime.Now; } } - else { + else + { model.Id = Guid.NewGuid().ToString(); Funs.DB.Transfer_LHCSystemList.InsertOnSubmit(model); }