提交代码
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -73,6 +74,20 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
ViewState["CreateProject"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int TaskCount
|
||||
{
|
||||
|
||||
get
|
||||
{
|
||||
return (int)ViewState["TaskCount"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["TaskCount"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -84,6 +99,42 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
JArray teamGroupData = Grid1.GetMergedData();
|
||||
List<JObject> list = new List<JObject>();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
values.Add("Performance_ChildGid2", teamGroupRow.Value<string>("id"));
|
||||
list.Add(values);
|
||||
}
|
||||
JObject defaultObj = new JObject
|
||||
{ { "Performance_ChildGid2",Guid.NewGuid() },
|
||||
{ "TaskContent", "" },
|
||||
{ "ProjectQuantity", "" },
|
||||
{ "DemandPlan",""},
|
||||
{ "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteScript(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
||||
};
|
||||
list.Add(defaultObj);
|
||||
Grid1.DataSource = list;
|
||||
Grid1.DataBind();
|
||||
|
||||
#region 测试
|
||||
//stepIndex = 2;
|
||||
//SimpleForm1.Hidden = true;
|
||||
//SimpleForm2.Hidden = true;
|
||||
//SimpleForm3.Hidden = true;
|
||||
//SimpleForm4.Hidden = true;
|
||||
//SimpleForm5.Hidden = true;
|
||||
//SimpleForm6.Hidden = true;
|
||||
//SimpleForm7.Hidden = true;
|
||||
//pForm1.Hidden = false;
|
||||
//Form2.Hidden = false;
|
||||
//Form3.Hidden = false;
|
||||
//Form4.Hidden = false;
|
||||
//Form5.Hidden = false;
|
||||
//Form6.Hidden = false;
|
||||
#endregion
|
||||
|
||||
CreateDateMonth = Request.Params["CreateDateMonth"];
|
||||
|
||||
this.drpCompileDateMonth.Text = CreateDateMonth;
|
||||
@@ -213,7 +264,7 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
#region 插入子表1
|
||||
List<Model.CQMS_Performance_Child1> listC1 = new List<Model.CQMS_Performance_Child1>();
|
||||
Model.CQMS_Performance_Child1 modelP1 = new Model.CQMS_Performance_Child1();
|
||||
Performance_ChildGid1Sg= Guid.NewGuid().ToString();
|
||||
Performance_ChildGid1Sg = Guid.NewGuid().ToString();
|
||||
modelP1.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
modelP1.PerformanceGid = PerformanceGid;
|
||||
modelP1.PType = "进度、质量、费用管理综合";
|
||||
@@ -226,7 +277,7 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
listC1.Add(modelP1);
|
||||
|
||||
modelP1 = new Model.CQMS_Performance_Child1();
|
||||
Performance_ChildGid1Hse= Guid.NewGuid().ToString();
|
||||
Performance_ChildGid1Hse = Guid.NewGuid().ToString();
|
||||
modelP1.Performance_ChildGid1 = Performance_ChildGid1Hse;
|
||||
modelP1.PerformanceGid = PerformanceGid;
|
||||
modelP1.PType = "进度、质量、费用管理综合";
|
||||
@@ -265,7 +316,7 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
listC1.Add(modelP1);
|
||||
|
||||
modelP1 = new Model.CQMS_Performance_Child1();
|
||||
Performance_ChildGid1Gj= Guid.NewGuid().ToString();
|
||||
Performance_ChildGid1Gj = Guid.NewGuid().ToString();
|
||||
modelP1.Performance_ChildGid1 = Performance_ChildGid1Gj;
|
||||
modelP1.PerformanceGid = PerformanceGid;
|
||||
modelP1.PType = "进度、质量、费用管理综合";
|
||||
@@ -309,7 +360,7 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
string[] ValidateForms = { "SimpleForm2", "SimpleForm3", "SimpleForm4", "SimpleForm5", "SimpleForm6", "SimpleForm7" };
|
||||
Button2.ValidateForms = ValidateForms;
|
||||
}
|
||||
else if (stepIndex==1)
|
||||
else if (stepIndex == 1)
|
||||
{
|
||||
#region 判断参数
|
||||
if (string.IsNullOrEmpty(txtWorkArea.Text))
|
||||
@@ -409,21 +460,21 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
Button2.ValidateForms = ValidateForms;
|
||||
|
||||
}
|
||||
else if (stepIndex==2)
|
||||
else if (stepIndex == 2)
|
||||
{
|
||||
|
||||
#region 参数
|
||||
var TaskContent1 = txtTaskContent1.Text.Trim();
|
||||
var ProjectQuantity1 = txtProjectQuantity1.Text.Trim();
|
||||
var DemandPlan1 = txtDemandPlan1.Text.Trim();
|
||||
//var TaskContent1 = txtTaskContent1.Text.Trim();
|
||||
//var ProjectQuantity1 = txtProjectQuantity1.Text.Trim();
|
||||
//var DemandPlan1 = txtDemandPlan1.Text.Trim();
|
||||
|
||||
var TaskContent2 = txtTaskContent2.Text.Trim();
|
||||
var ProjectQuantity2 = txtProjectQuantity2.Text.Trim();
|
||||
var DemandPlan2 = txtDemandPlan2.Text.Trim();
|
||||
//var TaskContent2 = txtTaskContent2.Text.Trim();
|
||||
//var ProjectQuantity2 = txtProjectQuantity2.Text.Trim();
|
||||
//var DemandPlan2 = txtDemandPlan2.Text.Trim();
|
||||
|
||||
var TaskContent3 = txtTaskContent3.Text.Trim();
|
||||
var ProjectQuantity3 = txtProjectQuantity3.Text.Trim();
|
||||
var DemandPlan3 = txtDemandPlan3.Text.Trim();
|
||||
//var TaskContent3 = txtTaskContent3.Text.Trim();
|
||||
//var ProjectQuantity3 = txtProjectQuantity3.Text.Trim();
|
||||
//var DemandPlan3 = txtDemandPlan3.Text.Trim();
|
||||
|
||||
var TaskContentHse = txtTaskContentHse.Text.Trim();
|
||||
|
||||
@@ -436,11 +487,11 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
var TaskContentJf = txtTaskContentJf.Text.Trim();
|
||||
#endregion
|
||||
#region 判断参数
|
||||
if (string.IsNullOrEmpty(TaskContent1))
|
||||
{
|
||||
Alert.ShowInTop("施工进度管理-各周工作任务安排不能为空。", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//if (string.IsNullOrEmpty(TaskContent1))
|
||||
//{
|
||||
// Alert.ShowInTop("施工进度管理-各周工作任务安排不能为空。", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
if (string.IsNullOrEmpty(TaskContentHse))
|
||||
{
|
||||
Alert.ShowInTop("HSE管理-各周工作任务安排不能为空。", MessageBoxIcon.Warning);
|
||||
@@ -474,65 +525,94 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
{
|
||||
Month = datesConfig.Month + 1;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
nowYear += 1;
|
||||
}
|
||||
|
||||
var Child2SortIndex = 1;
|
||||
//按照日期查询是否有设置
|
||||
var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == nowYear.ToString() && x.SortIndex == Month);
|
||||
if (modelConfig!=null)
|
||||
if (modelConfig != null)
|
||||
{
|
||||
//根据设置的周数插入表格CQMS_Performance_Child2
|
||||
List<Model.CQMS_Performance_Child2> listChild2 = new List<Model.CQMS_Performance_Child2>();
|
||||
for (int i = 0; i < modelConfig.SetUpWeek; i++)
|
||||
{
|
||||
//施工进度管理
|
||||
Model.CQMS_Performance_Child2 modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
modelChild2.PerformanceGid = PerformanceGid;
|
||||
modelChild2.TaskContent = TaskContent1;
|
||||
modelChild2.ProjectQuantity = ProjectQuantity1;
|
||||
modelChild2.DemandPlan = DemandPlan1;
|
||||
modelChild2.NowWeek = (i + 1);
|
||||
#region 添加施工进度
|
||||
JArray teamGroupData = Grid1.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
modelChild2.PerformanceGid = PerformanceGid;
|
||||
modelChild2.TaskContent = values.Value<string>("TaskContent");
|
||||
modelChild2.ProjectQuantity = values.Value<string>("ProjectQuantity");
|
||||
modelChild2.DemandPlan = values.Value<string>("DemandPlan");
|
||||
modelChild2.NowWeek = (i + 1);
|
||||
modelChild2.SortIndex = Child2SortIndex;
|
||||
modelChild2.CreateMan = CreateUser;
|
||||
listChild2.Add(modelChild2);
|
||||
Child2SortIndex += 1;
|
||||
}
|
||||
var SgCountModel = db.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid);
|
||||
if (Child2SortIndex!=1)
|
||||
{
|
||||
Child2SortIndex = Child2SortIndex - 1;
|
||||
}
|
||||
SgCountModel.SgCount = Child2SortIndex;
|
||||
db.SubmitChanges();
|
||||
#endregion
|
||||
//施工进度管理
|
||||
|
||||
modelChild2.SortIndex= Child2SortIndex;
|
||||
modelChild2.CreateMan = CreateUser;
|
||||
listChild2.Add(modelChild2);
|
||||
//modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
//modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
//modelChild2.PerformanceGid = PerformanceGid;
|
||||
////modelChild2.TaskContent = TaskContent1;
|
||||
////modelChild2.ProjectQuantity = ProjectQuantity1;
|
||||
////modelChild2.DemandPlan = DemandPlan1;
|
||||
//modelChild2.NowWeek = (i + 1);
|
||||
|
||||
//modelChild2.SortIndex = Child2SortIndex;
|
||||
//modelChild2.CreateMan = CreateUser;
|
||||
//listChild2.Add(modelChild2);
|
||||
#region 判断如果施工进度下面2个有值,也要插入
|
||||
if (!string.IsNullOrEmpty(TaskContent2))
|
||||
{
|
||||
modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
modelChild2.PerformanceGid = PerformanceGid;
|
||||
modelChild2.TaskContent = TaskContent2;
|
||||
modelChild2.ProjectQuantity = ProjectQuantity2;
|
||||
modelChild2.DemandPlan = DemandPlan2;
|
||||
modelChild2.NowWeek = (i + 1);
|
||||
//if (!string.IsNullOrEmpty(TaskContent2))
|
||||
//{
|
||||
// modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
// modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
// modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
// modelChild2.PerformanceGid = PerformanceGid;
|
||||
// modelChild2.TaskContent = TaskContent2;
|
||||
// modelChild2.ProjectQuantity = ProjectQuantity2;
|
||||
// modelChild2.DemandPlan = DemandPlan2;
|
||||
// modelChild2.NowWeek = (i + 1);
|
||||
|
||||
Child2SortIndex += 1;
|
||||
modelChild2.CreateMan = CreateUser;
|
||||
modelChild2.SortIndex = Child2SortIndex;
|
||||
listChild2.Add(modelChild2);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(TaskContent3))
|
||||
{
|
||||
modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
modelChild2.PerformanceGid = PerformanceGid;
|
||||
modelChild2.TaskContent = TaskContent3;
|
||||
modelChild2.ProjectQuantity = ProjectQuantity3;
|
||||
modelChild2.DemandPlan = DemandPlan3;
|
||||
modelChild2.NowWeek = (i + 1);
|
||||
// Child2SortIndex += 1;
|
||||
// modelChild2.CreateMan = CreateUser;
|
||||
// modelChild2.SortIndex = Child2SortIndex;
|
||||
// listChild2.Add(modelChild2);
|
||||
//}
|
||||
//if (!string.IsNullOrEmpty(TaskContent3))
|
||||
//{
|
||||
// modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
// modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString();
|
||||
// modelChild2.Performance_ChildGid1 = Performance_ChildGid1Sg;
|
||||
// modelChild2.PerformanceGid = PerformanceGid;
|
||||
// modelChild2.TaskContent = TaskContent3;
|
||||
// modelChild2.ProjectQuantity = ProjectQuantity3;
|
||||
// modelChild2.DemandPlan = DemandPlan3;
|
||||
// modelChild2.NowWeek = (i + 1);
|
||||
|
||||
Child2SortIndex += 1;
|
||||
modelChild2.SortIndex = Child2SortIndex;
|
||||
modelChild2.CreateMan = CreateUser;
|
||||
listChild2.Add(modelChild2);
|
||||
}
|
||||
// Child2SortIndex += 1;
|
||||
// modelChild2.SortIndex = Child2SortIndex;
|
||||
// modelChild2.CreateMan = CreateUser;
|
||||
// listChild2.Add(modelChild2);
|
||||
//}
|
||||
#endregion
|
||||
//HSE管理
|
||||
modelChild2 = new Model.CQMS_Performance_Child2();
|
||||
@@ -638,7 +718,7 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
if (item.NowWeek == 4)
|
||||
{
|
||||
OneWeekDate2 = OneWeekDate1;
|
||||
for (var i = OneWeekDate2.AddDays(1); i <=EndDate; i=i.AddDays(1))
|
||||
for (var i = OneWeekDate2.AddDays(1); i <= EndDate; i = i.AddDays(1))
|
||||
{
|
||||
modelChild3 = new Model.CQMS_Performance_Child3();
|
||||
StartDate = i;
|
||||
@@ -673,7 +753,8 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
switch (item.NowWeek)
|
||||
{
|
||||
case 1:
|
||||
@@ -710,7 +791,7 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
case DayOfWeek.Saturday:
|
||||
Xhi = 9;
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
StartDate = Convert.ToDateTime(modelConfig.SetUpStartDate).AddDays(-1);
|
||||
@@ -791,10 +872,10 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
OneWeekDate3 = OneWeekDate2;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
db.CQMS_Performance_Child3.InsertAllOnSubmit(listChild3);
|
||||
db.SubmitChanges();
|
||||
@@ -807,5 +888,42 @@ namespace FineUIPro.Web.CQMS.Performance
|
||||
|
||||
}
|
||||
|
||||
protected void btnAdd_Click(object sender, EventArgs e)
|
||||
{
|
||||
JArray teamGroupData = Grid1.GetMergedData();
|
||||
List<JObject> list = new List<JObject>();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
values.Add("Performance_ChildGid2", teamGroupRow.Value<string>("id"));
|
||||
list.Add(values);
|
||||
}
|
||||
JObject defaultObj = new JObject
|
||||
{ { "Performance_ChildGid2",Guid.NewGuid() },
|
||||
{ "TaskContent", "" },
|
||||
{ "ProjectQuantity", "" },
|
||||
{ "DemandPlan",""},
|
||||
{ "Delete", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteScript(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
||||
};
|
||||
list.Add(defaultObj);
|
||||
Grid1.DataSource = list;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetDeleteScript()
|
||||
{
|
||||
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, Grid1.GetDeleteSelectedRowsReference(), String.Empty);
|
||||
}
|
||||
|
||||
protected void Grid1_PreDataBound(object sender, EventArgs e)
|
||||
{
|
||||
// 设置LinkButtonField的点击客户端事件
|
||||
LinkButtonField deleteField = Grid1.FindColumn("Delete") as LinkButtonField;
|
||||
deleteField.OnClientClick = GetDeleteScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user