移交管理

This commit is contained in:
2024-11-18 15:14:57 +08:00
parent 6c7bb34357
commit 9d4672a210
53 changed files with 4021 additions and 2409 deletions
+40 -18
View File
@@ -45,9 +45,10 @@ namespace FineUIPro.Web.Transfer
{
Id = Request.Params["Id"];
ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Id)) {
if (!string.IsNullOrEmpty(Id))
{
var model = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.Id == Id);
if (model!=null)
if (model != null)
{
txtPIPINGLINENUMBER.Text = model.PIPINGLINENUMBER;
txtSYSTEM.Text = model.SYSTEM;
@@ -65,9 +66,9 @@ namespace FineUIPro.Web.Transfer
//ddlSystemreinstalled.SelectedValue = model.Systemreinstalled;
//txtBlowingReport.Text = model.BlowingReport;
txtTotalFactor.Text = model.TotalFactor;
txtCompleteFactor.Text = model.CompleteFactor;
txtCompleteProportion.Text = model.CompleteProportion;
txtTotalFactor.Text = model.TotalFactor.ToString();
txtCompleteFactor.Text = model.CompleteFactor.ToString();
txtCompleteProportion.Text = model.CompleteProportion.ToString();
ddlPressureTestCompleted.SelectedValue = model.PressureTestCompleted;
ddlRinseAndBlowClean.SelectedValue = model.RinseAndBlowClean;
ddlReduction.SelectedValue = model.Reduction;
@@ -78,8 +79,10 @@ namespace FineUIPro.Web.Transfer
}
}
protected void btnSave_Click(object sender, EventArgs e) {
var model = new Model.Transfer_Piping() {
protected void btnSave_Click(object sender, EventArgs e)
{
var model = new Model.Transfer_Piping()
{
ProjectId = ProjectId,
PIPINGLINENUMBER = txtPIPINGLINENUMBER.Text,
SYSTEM = txtSYSTEM.Text,
@@ -96,9 +99,9 @@ namespace FineUIPro.Web.Transfer
//Systemreinstalled= ddlSystemreinstalled.SelectedValue,
//BlowingReport= txtBlowingReport.Text,
TotalFactor = txtTotalFactor.Text,
CompleteFactor = txtCompleteFactor.Text,
CompleteProportion = txtCompleteProportion.Text,
TotalFactor = Convert.ToDecimal(txtTotalFactor.Text.Trim()),
CompleteFactor = Convert.ToDecimal(txtCompleteFactor.Text.Trim()),
CompleteProportion = Convert.ToDecimal(txtCompleteProportion.Text.Trim()),
PressureTestCompleted = ddlPressureTestCompleted.SelectedValue,
RinseAndBlowClean = ddlRinseAndBlowClean.SelectedValue,
Reduction = ddlReduction.SelectedValue,
@@ -131,13 +134,13 @@ namespace FineUIPro.Web.Transfer
if (listObj.Where(x => x == "NA" || x == "Completed").ToList().Count == 3)
{
model.FINALStatus = "Completed";
}
//如果全是Not Start 就是 Not Start
else if (listObj.Where(x => x == "Not Start").ToList().Count == 3)
{
model.FINALStatus = "Not Start";
}
//如果其中有一项是In progress 或Not Start 是 In progress
else if (listObj.Where(x => x == "In progress" || x == "Not Start").ToList().Count >= 1)
@@ -145,7 +148,7 @@ namespace FineUIPro.Web.Transfer
model.FINALStatus = "In progress";
}
#endregion
if (!string.IsNullOrEmpty(Id))
@@ -166,9 +169,9 @@ namespace FineUIPro.Web.Transfer
//newModel.Systemreinstalled = ddlSystemreinstalled.SelectedValue;
//newModel.BlowingReport = txtBlowingReport.Text;
newModel.TotalFactor = txtTotalFactor.Text;
newModel.CompleteFactor = txtCompleteFactor.Text;
newModel.CompleteProportion = txtCompleteProportion.Text;
newModel.TotalFactor = Convert.ToDecimal(txtTotalFactor.Text.Trim());
newModel.CompleteFactor = Convert.ToDecimal(txtCompleteFactor.Text.Trim());
newModel.CompleteProportion = Convert.ToDecimal(txtCompleteProportion.Text.Trim());
newModel.PressureTestCompleted = ddlPressureTestCompleted.SelectedValue;
newModel.RinseAndBlowClean = ddlRinseAndBlowClean.SelectedValue;
newModel.Reduction = ddlReduction.SelectedValue;
@@ -178,8 +181,9 @@ namespace FineUIPro.Web.Transfer
newModel.FINALStatus = model.FINALStatus;
newModel.Descriptions = txtDescriptions.Text;
}
else {
model.Id=Id = Guid.NewGuid().ToString();
else
{
model.Id = Id = Guid.NewGuid().ToString();
Funs.DB.Transfer_Piping.InsertOnSubmit(model);
}
Funs.DB.SubmitChanges();
@@ -188,5 +192,23 @@ namespace FineUIPro.Web.Transfer
}
protected void TextBox_OnTextChanged(object sender, EventArgs e)
{
decimal num1 = 0, num2 = 0;
if (!string.IsNullOrEmpty(this.txtTotalFactor.Text.Trim()))
{
num1 = Convert.ToDecimal(this.txtTotalFactor.Text.Trim());
}
if (!string.IsNullOrEmpty(this.txtCompleteFactor.Text.Trim()))
{
num2 = Convert.ToDecimal(this.txtCompleteFactor.Text.Trim());
}
if (num1 > 0 && num2 > 0)
{
var dCompleteProportion = Math.Round(((num2 / num1) * 100), 2);
this.txtCompleteProportion.Text = dCompleteProportion.ToString();
}
}
}
}