1
This commit is contained in:
@@ -110,6 +110,64 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
txtSort.Text = num.ToString();
|
||||
}
|
||||
}
|
||||
else if (itemModel.ControlLevel == 3)
|
||||
{
|
||||
one.Hidden = false;
|
||||
two.Hidden = false;
|
||||
three.Hidden = false;
|
||||
var oneModel = parenLs.FirstOrDefault(p => p.ControlLevel == 1);
|
||||
if (oneModel != null)
|
||||
{
|
||||
lblOneDetectionItems.Text = oneModel.DetectionItems;
|
||||
}
|
||||
var twoModel = parenLs.FirstOrDefault(p => p.ControlLevel == 2);
|
||||
if (twoModel != null)
|
||||
{
|
||||
lblTwoDetectionItems.Text = twoModel.DetectionItems;
|
||||
}
|
||||
var threeModel = parenLs.FirstOrDefault(p => p.ControlLevel == 3);
|
||||
if (threeModel != null)
|
||||
{
|
||||
lblThreeDetectionItems.Text = threeModel.DetectionItems;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(this.ControlId))
|
||||
{
|
||||
num = Funs.DB.Control_PointCropping.Count() + 1;
|
||||
txtSort.Text = num.ToString();
|
||||
}
|
||||
}
|
||||
else if (itemModel.ControlLevel == 4)
|
||||
{
|
||||
one.Hidden = false;
|
||||
two.Hidden = false;
|
||||
three.Hidden = false;
|
||||
four.Hidden = false;
|
||||
var oneModel = parenLs.FirstOrDefault(p => p.ControlLevel == 1);
|
||||
if (oneModel != null)
|
||||
{
|
||||
lblOneDetectionItems.Text = oneModel.DetectionItems;
|
||||
}
|
||||
var twoModel = parenLs.FirstOrDefault(p => p.ControlLevel == 2);
|
||||
if (twoModel != null)
|
||||
{
|
||||
lblTwoDetectionItems.Text = twoModel.DetectionItems;
|
||||
}
|
||||
var threeModel = parenLs.FirstOrDefault(p => p.ControlLevel == 3);
|
||||
if (threeModel != null)
|
||||
{
|
||||
lblThreeDetectionItems.Text = threeModel.DetectionItems;
|
||||
}
|
||||
var fourModel = parenLs.FirstOrDefault(p => p.ControlLevel == 4);
|
||||
if (fourModel != null)
|
||||
{
|
||||
lblFourDetectionItems.Text = fourModel.DetectionItems;
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(this.ControlId))
|
||||
{
|
||||
num = Funs.DB.Control_PointCropping.Count() + 1;
|
||||
txtSort.Text = num.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,6 +202,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
/// </summary>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
int maxlevel = 3;
|
||||
var model = new Control_PointCropping();
|
||||
model.ControlId = this.FId;
|
||||
var oneControlId = string.Empty;
|
||||
@@ -174,6 +233,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
model.ParentId = oneModel.ControlId;
|
||||
model.PlanTypeId = model.ControlId;
|
||||
model.ControlLevel = 2;
|
||||
maxlevel = model.MaxLevel.Value;
|
||||
}
|
||||
var twoModel = parenLs.FirstOrDefault(p => p.ControlLevel == 2);
|
||||
if (twoModel != null)
|
||||
@@ -183,7 +243,31 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
model.PlanTypeId = twoModel.ControlId;
|
||||
model.SubItemsId = model.ControlId;
|
||||
model.ControlLevel = 3;
|
||||
maxlevel = model.MaxLevel.Value;
|
||||
}
|
||||
var threeModel = parenLs.FirstOrDefault(p => p.ControlLevel == 3);
|
||||
if (threeModel != null)
|
||||
{
|
||||
model.PlanId = threeModel.PlanId;
|
||||
model.ParentId = threeModel.ControlId;
|
||||
model.PlanTypeId = threeModel.ControlId;
|
||||
model.SubItemsId = model.ControlId;
|
||||
model.ControlLevel = 4;
|
||||
maxlevel = model.MaxLevel.Value;
|
||||
}
|
||||
|
||||
var fourModel = parenLs.FirstOrDefault(p => p.ControlLevel == 4);
|
||||
if (fourModel != null)
|
||||
{
|
||||
model.PlanId = fourModel.PlanId;
|
||||
model.ParentId = fourModel.ControlId;
|
||||
model.PlanTypeId = fourModel.ControlId;
|
||||
model.SubItemsId = model.ControlId;
|
||||
model.ControlLevel = 5;
|
||||
maxlevel = model.MaxLevel.Value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -200,6 +284,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
model.Partition = txtPartition.Text;
|
||||
model.ControlCode = txtControlCode.Text;
|
||||
model.Remark = txtRemark.Text;
|
||||
model.MaxLevel = maxlevel;
|
||||
if (string.IsNullOrWhiteSpace(this.ControlId)) Funs.DB.Control_PointCropping.InsertOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
@@ -229,6 +314,18 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
var itemCropping = Funs.DB.Control_PointCropping.FirstOrDefault(p => p.ControlId == parentId);
|
||||
if (itemCropping != null)
|
||||
{
|
||||
//仅土建为5级 其余的都是三级,此处特殊处理
|
||||
if (itemCropping.MaxLevel > 3)
|
||||
{
|
||||
var tsCropping = Funs.DB.Control_PointCropping.FirstOrDefault(p => p.ControlId == itemCropping.ParentId);
|
||||
if (tsCropping != null)
|
||||
{
|
||||
ids.Add(tsCropping.ControlId);
|
||||
ids.Add(tsCropping.ParentId);
|
||||
ids.Add(tsCropping.PlanId);
|
||||
ids.Add(tsCropping.PlanTypeId);
|
||||
}
|
||||
}
|
||||
ids.Add(itemCropping.ControlId);
|
||||
if (!string.IsNullOrWhiteSpace(itemCropping.PlanId))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user