移交优化
This commit is contained in:
parent
3984e18e6c
commit
20363206d7
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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,7 +485,8 @@ namespace FineUIPro.Web.Transfer
|
|||
Sn = Convert.ToInt32(snModel.SN + 1);
|
||||
model.SN = Sn;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
Sn += 1;
|
||||
model.SN = Sn;
|
||||
}
|
||||
|
@ -492,24 +494,25 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
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();
|
||||
|
|
|
@ -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,11 +92,12 @@ 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();
|
||||
}
|
||||
|
@ -104,25 +106,27 @@ namespace FineUIPro.Web.Transfer
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue