diff --git a/DataBase/版本日志/SGGLDB_WH_2023-10-25.sql b/DataBase/版本日志/SGGLDB_WH_2023-10-25.sql new file mode 100644 index 00000000..cb4274ba Binary files /dev/null and b/DataBase/版本日志/SGGLDB_WH_2023-10-25.sql differ diff --git a/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs b/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs new file mode 100644 index 00000000..a15c8e23 --- /dev/null +++ b/SGGL/BLL/API/CQMS/Performance/PerformanceService.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class PerformanceService + { + /// + /// 根据年月删除 + /// + /// + public static void Delete(string CreateDateMonth) + { + Model.SGGLDB db = Funs.DB; + List list = db.CQMS_Performance.Where(e => e.CreateDateMonth == CreateDateMonth).ToList(); + if (list.Count > 0) + { + ///删除主表记录 + db.CQMS_Performance.DeleteAllOnSubmit(list); + + //删除子表1数据 + var child1List = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == list[0].PerformanceGid).ToList(); + if (child1List.Count > 0) + { + //删除子表2数据 + var child2List = db.CQMS_Performance_Child2.Where(x => x.PerformanceGid == list[0].PerformanceGid).ToList(); + if (child2List.Count > 0) + { + //删除子表3数据 + var child3List = db.CQMS_Performance_Child3.Where(x => x.PerformanceGid == list[0].PerformanceGid).ToList(); + if (child3List.Count > 0) + { + db.CQMS_Performance_Child3.DeleteAllOnSubmit(child3List); + } + db.CQMS_Performance_Child2.DeleteAllOnSubmit(child2List); + } + db.CQMS_Performance_Child1.DeleteAllOnSubmit(child1List); + } + db.SubmitChanges(); + } + } + + /// + /// 修改每周计划 + /// + /// + public static void UpdateChild2(Model.CQMS_Performance_Child2 model) + { + Model.SGGLDB db = Funs.DB; + var NewModel = db.CQMS_Performance_Child2.FirstOrDefault(x => x.Performance_ChildGid2 == model.Performance_ChildGid2); + NewModel.TaskCompletContent = model.TaskCompletContent; + db.SubmitChanges(); + } + + + /// + /// 用户下拉框 + /// + /// 下拉框名字 + /// 项目id + /// 是否显示请选择 + public static void InitUserDropDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease) + { + dropName.DataValueField = "CreateMan"; + dropName.DataTextField = "CreateManName"; + dropName.DataSource = GetProjectUserListByProjectId(projectId); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public class PerformanceUser { + public string CreateMan { get; set; } + + public string CreateManName { get; set; } + } + + public static List GetProjectUserListByProjectId(string projectId) { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { + var list = (from x in db.CQMS_Performance + join y in db.Sys_User on x.CreateMan equals y.UserId + where x.ProjectId==projectId && x.States=="1" + select new PerformanceUser + { + CreateMan=x.CreateMan, + CreateManName=BLL.UserService.GetUserByUserId(x.CreateMan).UserName + }).ToList(); + return list; + } + } + + } +} diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 81372eff..54226bc7 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -96,6 +96,7 @@ + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx new file mode 100644 index 00000000..27b41993 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx @@ -0,0 +1,112 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MonthTargetEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.MonthTargetEdit" %> + + + + + + + 月节点目标修改页面 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx.cs new file mode 100644 index 00000000..df2540e1 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx.cs @@ -0,0 +1,91 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class MonthTargetEdit : PageBase + { + //主键 + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + /// + /// 页面加载 + /// + /// + /// + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //主键 + PerformanceGid = Request.Params["PerformanceGid"]; + //根据主键加载CQMS_Performance_Child1 + var child1List = Funs.DB.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).OrderBy(x => x.SortIndex).ToList(); + if (child1List.Count > 0) + { + txtWorkArea.Text = child1List[0].WorkArea.ToString(); + txtMonthTarget1.Text= child1List[0].MonthTarget.ToString(); + + txtMonthTarget2.Text = child1List[1].MonthTarget.ToString(); + txtMonthTarget3.Text = child1List[2].MonthTarget.ToString(); + txtMonthTarget4.Text = child1List[3].MonthTarget.ToString(); + txtMonthTarget5.Text = child1List[4].MonthTarget.ToString(); + txtMonthTarget6.Text = child1List[5].MonthTarget.ToString(); + } + else { + ShowNotify("未查询到月节点目标数据,请重新生成。", MessageBoxIcon.Warning); + return; + } + } + } + + /// + /// 确认修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + //依次修改6个类别的月节点目标 + var child2Model1 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1); + child2Model1.WorkArea = txtWorkArea.Text.Trim(); + child2Model1.MonthTarget = txtMonthTarget1.Text.Trim(); + db.SubmitChanges(); + var child2Model2 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 2); + child2Model2.MonthTarget = txtMonthTarget2.Text.Trim(); + db.SubmitChanges(); + var child2Model3 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 3); + child2Model3.MonthTarget = txtMonthTarget3.Text.Trim(); + db.SubmitChanges(); + var child2Model4 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 4); + child2Model4.MonthTarget = txtMonthTarget4.Text.Trim(); + db.SubmitChanges(); + var child2Model5 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 5); + child2Model5.MonthTarget = txtMonthTarget5.Text.Trim(); + db.SubmitChanges(); + var child2Model6 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 6); + child2Model6.MonthTarget = txtMonthTarget6.Text.Trim(); + db.SubmitChanges(); + + ShowNotify("修改成功。", MessageBoxIcon.Success); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx.designer.cs new file mode 100644 index 00000000..5133120a --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/MonthTargetEdit.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class MonthTargetEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// SimpleForm2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm2; + + /// + /// txtWorkArea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkArea; + + /// + /// txtMonthTarget1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget1; + + /// + /// SimpleForm3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm3; + + /// + /// txtMonthTarget2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget2; + + /// + /// SimpleForm4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm4; + + /// + /// txtMonthTarget3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget3; + + /// + /// SimpleForm5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm5; + + /// + /// txtMonthTarget4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget4; + + /// + /// SimpleForm6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm6; + + /// + /// txtMonthTarget5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget5; + + /// + /// SimpleForm7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm7; + + /// + /// txtMonthTarget6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget6; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx new file mode 100644 index 00000000..a2040d55 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx @@ -0,0 +1,477 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Performance.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.Performance" %> + + + + + + + 施工绩效管理 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx.cs new file mode 100644 index 00000000..880cce48 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx.cs @@ -0,0 +1,1820 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Web.UI.WebControls; +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class Performance : PageBase + { + #region 定义项 + /// + /// 主键 + /// + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + public string CompileDateMonth + { + get + { + return (string)ViewState["CompileDateMonth"]; + } + set + { + ViewState["CompileDateMonth"] = value; + } + } + + public string CreateUser + { + get + { + return (string)ViewState["CreateUser"]; + } + set + { + ViewState["CreateUser"] = value; + } + } + + + #endregion + + + + + /// + /// 页面加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CreateUser = CurrUser.UserId; + BindGrid(); + + OutputSummaryData(); + } + } + + private void OutputSummaryData() + { + decimal EvaScore = 0; + EvaScore = Funs.DB.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).Sum(x => x.EvaScore) ?? 0; + + JObject summary = new JObject(); + //summary.Add("Major", "全部合计"); + summary.Add("EvaScore", EvaScore.ToString("F2")); + + + Grid1.SummaryData = summary; + + } + + /// + /// 加载表头 + /// + protected void Page_Init(object sender, EventArgs e) + { + CreateUser = CurrUser.UserId; + drpCompileDateMonth.Text = DateTime.Now.ToString(); + if (string.IsNullOrEmpty(CompileDateMonth)) + { + CompileDateMonth = Request.QueryString["CompileDateMonth"]; + if (!string.IsNullOrEmpty(CompileDateMonth)) + { + drpCompileDateMonth.Text = CompileDateMonth; + } + } + else { + drpCompileDateMonth.Text = CompileDateMonth; + } + + + InitGrid(); + + } + + #region 加载表头 + string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; + + private void InitGrid() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var NowDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + var Month = 1; + if (NowDate.Month != 12) + { + Month = NowDate.Month + 1; + } + + //获取配置 + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == NowDate.Year.ToString() && x.SortIndex == Month); + if (modelConfig != null) + { + int child3Index = 1; + //先加载周,再加载周里面的天数 + for (int i = 1; i <= modelConfig.SetUpWeek; i++) + { + #region 第?周任务安排、工程量、人材机资源需求计划 + BoundField bf = new BoundField(); + bf.Width = Unit.Pixel(150); + bf.DataField = "TaskContent" + i.ToString(); + bf.ColumnID = "TaskContent" + i.ToString(); + bf.HeaderText = "第" + i.ToString() + "周施工工作任务安排"; + bf.TextAlign = TextAlign.Center; + Grid1.Columns.Add(bf); + + bf = new BoundField(); + bf.Width = Unit.Pixel(100); + bf.DataField = "ProjectQuantity" + i.ToString(); + bf.ColumnID = "ProjectQuantity" + i.ToString(); + bf.HeaderText = "工程量"; + Grid1.Columns.Add(bf); + + bf = new BoundField(); + bf.Width = Unit.Pixel(150); + bf.DataField = "DemandPlan" + i.ToString(); + bf.ColumnID = "DemandPlan" + i.ToString(); + bf.HeaderText = "人材机资源需求计划"; + Grid1.Columns.Add(bf); + #endregion + + var month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + if (Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month.ToString().Length == 1) + { + month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-0" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + } + //1.先获取主表的基础数据 + var modelCQMS_Performance = db.CQMS_Performance.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId + && x.CreateDateMonth == month && x.CreateMan == CreateUser); + if (modelCQMS_Performance != null) + { + PerformanceGid = modelCQMS_Performance.PerformanceGid; + } + else { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + + + var Child2Model = db.CQMS_Performance_Child2.FirstOrDefault(x => x.NowWeek == i && x.CreateMan == CreateUser && x.PerformanceGid== PerformanceGid); + if (Child2Model==null) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + //获取当前周的gid + var Child2Gid = Child2Model.Performance_ChildGid2; + //根据周gid获取天数 + var listChild3 = db.CQMS_Performance_Child3.Where(x => x.Performance_ChildGid2 == Child2Gid + && x.CreateMan==CreateUser).OrderBy(x => x.CurrentDate).ToList(); + + if (listChild3.Count==0) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + + foreach (var item in listChild3) + { + var Cdate = Convert.ToDateTime(item.CurrentDate); + string week = Day[Convert.ToInt32(Cdate.DayOfWeek.ToString("d"))].ToString(); + //头部 + GroupField p = new GroupField(); + p.Width = Unit.Pixel(200); + p.HeaderText = week + "(" + Cdate.Month + "月" + Cdate.Day + "日)"; + p.TextAlign = TextAlign.Left; + + BoundField gzjh = new BoundField(); + gzjh.Width = Unit.Pixel(200); + gzjh.HeaderText = "本日工作计划"; + gzjh.DataField = "WorkPlan" + child3Index.ToString(); + gzjh.ColumnID = "WorkPlan" + child3Index.ToString(); + gzjh.TextAlign = TextAlign.Center; + + BoundField wcqk = new BoundField(); + wcqk.Width = Unit.Pixel(200); + wcqk.HeaderText = "本日完成情况"; + wcqk.DataField = "CompletStatus" + child3Index.ToString(); + wcqk.ColumnID = "CompletStatus" + child3Index.ToString(); + p.Columns.Add(gzjh); + p.Columns.Add(wcqk); + + Grid1.Columns.Add(p); + child3Index += 1; + } + bf = new BoundField(); + bf.Width = Unit.Pixel(150); + bf.DataField = "TaskCompletContent" + i.ToString(); + bf.ColumnID = "TaskCompletContent" + i.ToString(); + bf.HeaderText = "本周工作任务完成情况"; + Grid1.Columns.Add(bf); + } + } + else { + ShowNotify("当前日期未设置规则,请前往施工绩效设置页面进行操作。", MessageBoxIcon.Warning); + PageContext.RegisterStartupScript("CloseRefresh()"); + return; + } + + } + + } + #endregion + + #region 合并单元格定义项 + /// + /// 第一行的gid 为了合并单元格用 + /// + public string OneGid + { + get + { + return (string)ViewState["OneGid"]; + } + set + { + ViewState["OneGid"] = value; + } + } + + public string Gid2 + { + get + { + return (string)ViewState["Gid2"]; + } + set + { + ViewState["Gid2"] = value; + } + } + + public string Gid3 + { + get + { + return (string)ViewState["Gid3"]; + } + set + { + ViewState["Gid3"] = value; + } + } + + public string Gid4 + { + get + { + return (string)ViewState["Gid4"]; + } + set + { + ViewState["Gid4"] = value; + } + } + + public string Gid5 + { + get + { + return (string)ViewState["Gid5"]; + } + set + { + ViewState["Gid5"] = value; + } + } + + public string Gid6 + { + get + { + return (string)ViewState["Gid6"]; + } + set + { + ViewState["Gid6"] = value; + } + } + + public int child2Count + { + get + { + return Convert.ToInt32(ViewState["child2Count"]); + } + set + { + ViewState["child2Count"] = value; + } + } + #endregion + + #region 加载表格数据 + /// + /// 加载表格的实体类 + /// + public class GridModels { + public string Performance_ChildGid1 { get; set; } + public string PerformanceGid { get; set; } + public string PType { get; set; } + + public decimal? EvaScore { get; set; } + public string Itemize { get; set; } + public string WorkArea { get; set; } + public string MonthTarget { get; set; } + + public int? SortIndex { get; set; } + + #region 任务安排 下标9;工程量 14;材机资源需求计划 19 + public string Performance_ChildGid2 { get; set; } + + //任务安排 下标9 + public string TaskContent1 { get; set; } + public string TaskContent2 { get; set; } + public string TaskContent3 { get; set; } + public string TaskContent4 { get; set; } + public string TaskContent5 { get; set; } + + //工程量 14 + public string ProjectQuantity1 { get; set; } + public string ProjectQuantity2 { get; set; } + public string ProjectQuantity3 { get; set; } + public string ProjectQuantity4 { get; set; } + public string ProjectQuantity5 { get; set; } + + //材机资源需求计划 19 + public string DemandPlan1 { get; set; } + public string DemandPlan2 { get; set; } + public string DemandPlan3 { get; set; } + public string DemandPlan4 { get; set; } + public string DemandPlan5 { get; set; } + + //本周工作任务完成情况 24 + public string TaskCompletContent1 { get; set; } + public string TaskCompletContent2 { get; set; } + public string TaskCompletContent3 { get; set; } + public string TaskCompletContent4 { get; set; } + public string TaskCompletContent5 { get; set; } + #endregion + + #region 每天任务完成情况 下标29 + public string WorkPlan1 { get; set; } + public string WorkPlan2 { get; set; } + public string WorkPlan3 { get; set; } + public string WorkPlan4 { get; set; } + public string WorkPlan5 { get; set; } + public string WorkPlan6 { get; set; } + public string WorkPlan7 { get; set; } + public string WorkPlan8 { get; set; } + public string WorkPlan9 { get; set; } + public string WorkPlan10 { get; set; } + public string WorkPlan11 { get; set; } + public string WorkPlan12 { get; set; } + public string WorkPlan13 { get; set; } + public string WorkPlan14 { get; set; } + public string WorkPlan15 { get; set; } + public string WorkPlan16 { get; set; } + public string WorkPlan17 { get; set; } + public string WorkPlan18 { get; set; } + public string WorkPlan19 { get; set; } + public string WorkPlan20 { get; set; } + public string WorkPlan21 { get; set; } + public string WorkPlan22 { get; set; } + public string WorkPlan23 { get; set; } + public string WorkPlan24 { get; set; } + public string WorkPlan25 { get; set; } + public string WorkPlan26 { get; set; } + public string WorkPlan27 { get; set; } + public string WorkPlan28 { get; set; } + public string WorkPlan29 { get; set; } + public string WorkPlan30 { get; set; } + public string WorkPlan31 { get; set; } + public string WorkPlan32 { get; set; } + public string WorkPlan33 { get; set; } + #endregion + + #region 本日完成情况 下标 62 + public string CompletStatus1 { get; set; } + public string CompletStatus2 { get; set; } + public string CompletStatus3 { get; set; } + public string CompletStatus4 { get; set; } + public string CompletStatus5 { get; set; } + public string CompletStatus6 { get; set; } + public string CompletStatus7 { get; set; } + public string CompletStatus8 { get; set; } + public string CompletStatus9 { get; set; } + public string CompletStatus10 { get; set; } + public string CompletStatus11 { get; set; } + public string CompletStatus12 { get; set; } + public string CompletStatus13 { get; set; } + public string CompletStatus14 { get; set; } + public string CompletStatus15 { get; set; } + public string CompletStatus16 { get; set; } + public string CompletStatus17 { get; set; } + public string CompletStatus18 { get; set; } + public string CompletStatus19 { get; set; } + public string CompletStatus20 { get; set; } + public string CompletStatus21 { get; set; } + public string CompletStatus22 { get; set; } + public string CompletStatus23 { get; set; } + public string CompletStatus24 { get; set; } + public string CompletStatus25 { get; set; } + public string CompletStatus26 { get; set; } + public string CompletStatus27 { get; set; } + public string CompletStatus28 { get; set; } + public string CompletStatus29 { get; set; } + public string CompletStatus30 { get; set; } + public string CompletStatus31 { get; set; } + public string CompletStatus32 { get; set; } + public string CompletStatus33 { get; set; } + #endregion + + #region 定义索引 + //定义索引器,name 字段的索引值为 0 ,password 字段的索引值为 1 + public string this[int index] + { + #region get + get + { + if (index == 0) + { + return WorkPlan1; + } + else if (index == 1) + { + return WorkPlan2; + } + else if (index == 2) + { + return WorkPlan3; + } + else if (index == 3) + { + return WorkPlan4; + } + else if (index == 4) + { + return WorkPlan5; + } + else if (index == 5) + { + return WorkPlan6; + } + else if (index == 6) + { + return WorkPlan7; + } + else if (index == 7) + { + return WorkPlan8; + } + else if (index == 8) + { + return WorkPlan9; + } + else if (index == 9) + { + return WorkPlan10; + } + else if (index == 10) + { + return WorkPlan11; + } + else if (index == 11) + { + return WorkPlan12; + } + else if (index == 12) + { + return WorkPlan13; + } + else if (index == 13) + { + return WorkPlan14; + } + else if (index == 14) + { + return WorkPlan15; + } + else if (index == 15) + { + return WorkPlan16; + } + else if (index == 16) + { + return WorkPlan17; + } + else if (index == 17) + { + return WorkPlan18; + } + else if (index == 18) + { + return WorkPlan19; + } + else if (index == 19) + { + return WorkPlan20; + } + else if (index == 20) + { + return WorkPlan21; + } + else if (index == 21) + { + return WorkPlan22; + } + else if (index == 22) + { + return WorkPlan23; + } + else if (index == 23) + { + return WorkPlan24; + } + else if (index == 24) + { + return WorkPlan25; + } + else if (index == 25) + { + return WorkPlan26; + } + else if (index == 26) + { + return WorkPlan27; + } + else if (index == 27) + { + return WorkPlan28; + } + else if (index == 28) + { + return WorkPlan29; + } + else if (index == 29) + { + return WorkPlan30; + } + else if (index == 30) + { + return WorkPlan31; + } + else if (index == 31) + { + return WorkPlan32; + } + else if (index == 32) + { + return CompletStatus1; + } + else if (index == 33) + { + return CompletStatus2; + } + else if (index == 34) + { + return CompletStatus3; + } + else if (index == 35) + { + return CompletStatus4; + } + else if (index == 36) + { + return CompletStatus5; + } + else if (index == 37) + { + return CompletStatus6; + } + else if (index == 38) + { + return CompletStatus7; + } + else if (index == 39) + { + return CompletStatus8; + } + else if (index == 40) + { + return CompletStatus9; + } + else if (index == 41) + { + return CompletStatus10; + } + else if (index == 42) + { + return CompletStatus11; + } + else if (index == 43) + { + return CompletStatus12; + } + else if (index == 44) + { + return CompletStatus13; + } + else if (index == 45) + { + return CompletStatus14; + } + else if (index == 46) + { + return CompletStatus15; + } + else if (index == 47) + { + return CompletStatus16; + } + else if (index == 48) + { + return CompletStatus17; + } + else if (index == 49) + { + return CompletStatus18; + } + else if (index == 50) + { + return CompletStatus19; + } + else if (index == 51) + { + return CompletStatus20; + } + else if (index == 52) + { + return CompletStatus21; + } + else if (index == 53) + { + return CompletStatus22; + } + else if (index == 54) + { + return CompletStatus23; + } + else if (index == 55) + { + return CompletStatus24; + } + else if (index == 56) + { + return CompletStatus25; + } + else if (index == 57) + { + return CompletStatus26; + } + else if (index == 58) + { + return CompletStatus27; + } + else if (index == 59) + { + return CompletStatus28; + } + else if (index == 60) + { + return CompletStatus29; + } + else if (index == 61) + { + return CompletStatus30; + } + else if (index == 62) + { + return CompletStatus31; + } + else if (index == 63) + { + return CompletStatus32; + } + + else { return null; } + #endregion + + } + set + { + if (index == 0) + { + WorkPlan1 = value; + } + else if (index == 1) + { + WorkPlan2 = value; + } + else if (index == 2) + { + WorkPlan3 = value; + } + else if (index == 3) + { + WorkPlan4 = value; + } + else if (index == 4) + { + WorkPlan5 = value; + } + else if (index == 5) + { + WorkPlan6 = value; + } + else if (index == 6) + { + WorkPlan7 = value; + } + else if (index == 7) + { + WorkPlan8 = value; + } + else if (index == 8) + { + WorkPlan9 = value; + } + else if (index == 9) + { + WorkPlan10 = value; + } + else if (index == 10) + { + WorkPlan11 = value; + } + else if (index == 11) + { + WorkPlan12 = value; + } + else if (index == 12) + { + WorkPlan13 = value; + } + else if (index == 13) + { + WorkPlan14 = value; + } + else if (index == 14) + { + WorkPlan15 = value; + } + else if (index == 15) + { + WorkPlan16 = value; + } + else if (index == 16) + { + WorkPlan17 = value; + } + else if (index == 17) + { + WorkPlan18 = value; + } + else if (index == 18) + { + WorkPlan19 = value; + } + else if (index == 19) + { + WorkPlan20 = value; + } + else if (index == 20) + { + WorkPlan21 = value; + } + else if (index == 21) + { + WorkPlan22 = value; + } + else if (index == 22) + { + WorkPlan23 = value; + } + else if (index == 23) + { + WorkPlan24 = value; + } + else if (index == 24) + { + WorkPlan25 = value; + } + else if (index == 25) + { + WorkPlan26 = value; + } + else if (index == 26) + { + WorkPlan27 = value; + } + else if (index == 27) + { + WorkPlan28 = value; + } + else if (index == 28) + { + WorkPlan29 = value; + } + else if (index == 29) + { + WorkPlan30 = value; + } + else if (index == 30) + { + WorkPlan31 = value; + } + else if (index == 31) + { + WorkPlan32 = value; + } + else if (index == 32) + { + CompletStatus1 = value; + } + else if (index == 33) + { + CompletStatus2 = value; + } + else if (index == 34) + { + CompletStatus3 = value; + } + else if (index == 35) + { + CompletStatus4 = value; + } + else if (index == 36) + { + CompletStatus5 = value; + } + else if (index == 37) + { + CompletStatus6 = value; + } + else if (index == 38) + { + CompletStatus7 = value; + } + else if (index == 39) + { + CompletStatus8 = value; + } + else if (index == 40) + { + CompletStatus9 = value; + } + else if (index == 41) + { + CompletStatus10 = value; + } + else if (index == 42) + { + CompletStatus11 = value; + } + else if (index == 43) + { + CompletStatus12 = value; + } + else if (index == 44) + { + CompletStatus13 = value; + } + else if (index == 45) + { + CompletStatus14 = value; + } + else if (index == 46) + { + CompletStatus15 = value; + } + else if (index == 47) + { + CompletStatus16 = value; + } + else if (index == 48) + { + CompletStatus17 = value; + } + else if (index == 49) + { + CompletStatus18 = value; + } + else if (index == 50) + { + CompletStatus19 = value; + } + else if (index == 51) + { + CompletStatus20 = value; + } + else if (index == 52) + { + CompletStatus21 = value; + } + else if (index == 53) + { + CompletStatus22 = value; + } + else if (index == 54) + { + CompletStatus23 = value; + } + else if (index == 55) + { + CompletStatus24 = value; + } + else if (index == 56) + { + CompletStatus25 = value; + } + else if (index == 57) + { + CompletStatus26 = value; + } + else if (index == 58) + { + CompletStatus27 = value; + } + else if (index == 59) + { + CompletStatus28 = value; + } + else if (index == 60) + { + CompletStatus29 = value; + } + else if (index == 61) + { + CompletStatus30 = value; + } + else if (index == 62) + { + CompletStatus31 = value; + } + else if (index == 63) + { + CompletStatus32 = value; + } + + } + } + #endregion + + } + + private void BindGrid() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + if (Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month.ToString().Length==1) + { + month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-0" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + } + //1.先获取主表的基础数据 + var modelCQMS_Performance = db.CQMS_Performance.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId + && x.CreateDateMonth == month && x.CreateMan== CreateUser); + if (modelCQMS_Performance != null) + { + + Grid1.Title= "五环责任人:" + modelCQMS_Performance.HeadUserid + ";本月完成专业产值:" + + modelCQMS_Performance.ProOutputValue + "万元;分包商负责人:" + + modelCQMS_Performance.SubUserids + ";分包工程师、班组长:" + modelCQMS_Performance.SubpackageUserids; + PerformanceGid = modelCQMS_Performance.PerformanceGid; + //根据主键查询CQMS_Performance_Child1 + var listChild1 = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).OrderBy(x => x.SortIndex) + .Select(x=> new GridModels { + Performance_ChildGid1=x.Performance_ChildGid1, + PerformanceGid=x.PerformanceGid, + PType=x.PType, + EvaScore=x.EvaScore, + Itemize=x.Itemize, + WorkArea=x.WorkArea, + MonthTarget=x.MonthTarget, + SortIndex=x.SortIndex + }).ToList(); + #region 合并单元格参数 + //获取各行的gid + OneGid = listChild1[0].Performance_ChildGid1; + Gid2 = listChild1[1].Performance_ChildGid1; + Gid3 = listChild1[2].Performance_ChildGid1; + Gid4 = listChild1[3].Performance_ChildGid1; + Gid5 = listChild1[4].Performance_ChildGid1; + Gid6 = listChild1[5].Performance_ChildGid1; + //获取CQMS_Performance_Child2 表中的数据 + int child2Count = db.CQMS_Performance_Child2.Where(x => x.NowWeek == 1 && x.PerformanceGid == PerformanceGid).ToList().Count(); + #endregion + + + //加载各周任务、工程量、人材机、完成情况 + + //根据gid获取CQMS_Performance_Child2 施工进度管理的子表数据,大于一条,就要多增加数据到List中 + var ChildSgjdCount = db.CQMS_Performance_Child2.Where(x => x.NowWeek == 1 && x.PerformanceGid == PerformanceGid + &&x.Performance_ChildGid1== OneGid).ToList().Count(); + var addList = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid && x.SortIndex==1) + .Select(x => new GridModels + { + Performance_ChildGid1 = x.Performance_ChildGid1, + PerformanceGid = x.PerformanceGid, + PType = x.PType, + EvaScore = x.EvaScore, + Itemize = x.Itemize, + WorkArea = x.WorkArea, + MonthTarget = x.MonthTarget, + SortIndex = x.SortIndex + }).ToList(); + if (ChildSgjdCount == 2) + { + addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one"; + listChild1.InsertRange(1, addList); + } + else if (ChildSgjdCount == 3) + { + var pgid = addList[0].Performance_ChildGid1; + addList[0].Performance_ChildGid1 = pgid + "one"; + listChild1.InsertRange(1, addList); + addList[0].Performance_ChildGid1 = pgid + "two"; + listChild1.InsertRange(2, addList); + } + + //循环list给每周任务、工程量、资源需求计划、本周工作任务完成情况 ,每日工作计划、完成情况赋值 + //获取周数 + var NowDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + var Month = 1; + if (NowDate.Month != 12) + { + Month = NowDate.Month + 1; + } + + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == NowDate.Year.ToString() && x.SortIndex == Month); + + for (int i = 0; i < listChild1.Count; i++) + { + var CompletStatusIndex = 32; + var zIndex = 0; + //循环周数- + for (int y = 0; y < modelConfig.SetUpWeek; y++) + { + var chilGid = listChild1[i].Performance_ChildGid1; + if (chilGid.IndexOf("one")>-1|| chilGid.IndexOf("two") > -1) + { + chilGid = chilGid.Substring(0, chilGid.Length - 3); + } + + //根据周数获取数据 + var Child2ListNew = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == listChild1[i].PerformanceGid + && x.Performance_ChildGid1 == chilGid && x.NowWeek == (y + 1) && x.SortIndex == (i + 1)); + //将list中的周数数据插入 + if (Child2ListNew==null) + { + ShowNotify("数据有误。请重新生成", MessageBoxIcon.Warning); + return; + } + switch (y) + { + case 0: + listChild1[i].TaskContent1 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity1 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan1 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent1= Child2ListNew.TaskCompletContent; + break; + case 1: + listChild1[i].TaskContent2 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity2 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan2 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent2 = Child2ListNew.TaskCompletContent; + break; + case 2: + listChild1[i].TaskContent3 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity3 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan3 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent3 = Child2ListNew.TaskCompletContent; + break; + case 3: + listChild1[i].TaskContent4 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity4 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan4 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent4 = Child2ListNew.TaskCompletContent; + break; + case 4: + listChild1[i].TaskContent5 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity5 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan5 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent5 = Child2ListNew.TaskCompletContent; + break; + } + + #region 根据周id获取日 + var Child3ListNew = db.CQMS_Performance_Child3.Where(x => x.Performance_ChildGid2 == Child2ListNew.Performance_ChildGid2) + .OrderBy(x => x.CurrentDate).ToList(); + + for (var z = 0; z < Child3ListNew.Count; z++) + { + listChild1[i][zIndex] = Child3ListNew[z].WorkPlan; + listChild1[i][CompletStatusIndex] = Child3ListNew[z].CompletStatus; + CompletStatusIndex += 1; + zIndex += 1; + + } + #endregion + } + } + + + //重新给list设置 序号 + int sindex = 1; + listChild1.ForEach(x => + { + x.SortIndex = sindex; + sindex += 1; + }); + var table = ToDataTable(listChild1); + Grid1.DataSource = table; + Grid1.DataBind(); + + + #region 合并单元格 + + + + var DateIffs = DateDiff(Convert.ToDateTime(modelConfig.SetUpStartDate), Convert.ToDateTime(modelConfig.SetUpEndDate))+1; + if (ChildSgjdCount > 1) + { + //合并单元格方法 + PageContext.RegisterStartupScript("onGridDataLoad('" + OneGid + "','" + child2Count + "','" + Gid2 + "','" + + Gid3 + "','" + Gid4 + "','" + Gid5 + "','" + Gid6 + "','"+ ChildSgjdCount + "','"+ modelConfig.SetUpWeek + "',"+ DateIffs + ")"); + } + else { + //合并单元格方法 + PageContext.RegisterStartupScript("onGridDataLoad('" + OneGid + "','" + child2Count + "','" + Gid2 + "','" + + Gid3 + "','" + Gid4 + "','" + Gid5 + "','" + Gid6 + "',0,'" + modelConfig.SetUpWeek + "'," + DateIffs + ")"); + } + #endregion + + } + else + { + if (string.IsNullOrEmpty(CurrUser.LoginProjectId)) + { + ShowNotify("未查询到当前项目,请刷新页面重试。", MessageBoxIcon.Warning); + + } + else + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + } + } + } + } + + /// + /// 计算日期之间的天数 + /// + /// + /// + /// + private int DateDiff(DateTime dateStart, DateTime dateEnd) + + { + + DateTime start = Convert.ToDateTime(dateStart.ToShortDateString()); + + DateTime end = Convert.ToDateTime(dateEnd.ToShortDateString()); + + TimeSpan sp = end.Subtract(start); + + return sp.Days; + } + #endregion + /// + /// 查询绑定数据 + /// + /// + /// + protected void btnBindGrid(object sender, EventArgs e) + { + var Rurl = Request.Url.ToString(); + if (Rurl.IndexOf("?")>-1) + { + Rurl = Rurl.Substring(0, Rurl.IndexOf("?")); + } + //重定向当前页面传值 + Response.Redirect(Rurl + "?CompileDateMonth="+ drpCompileDateMonth.Text); + //BindGrid(); + } + + /// + /// 判断生成操作 + /// + protected void btnNew_Juge(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.drpCompileDateMonth.Text.Trim())) + { + ShowNotify("日期不能为空。", MessageBoxIcon.Warning); + PageContext.RegisterStartupScript("CloseRefresh()"); + return; + } + var dates = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + var Month = 1; + if (dates.Month != 12) + { + Month = dates.Month + 1; + } + + //按照日期查询是否有设置 + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == dates.Year.ToString() && x.SortIndex == Month); + if (modelConfig == null) + { + ShowNotify("当前日期未设置规则,请前往施工绩效设置页面进行操作。", MessageBoxIcon.Warning); + PageContext.RegisterStartupScript("CloseRefresh()"); + return; + } + //根据日期查询是否有数据 + var modelSum = Funs.DB.CQMS_Performance.Where(x => x.CreateDateMonth == drpCompileDateMonth.Text.Trim() && x.ProjectId == CurrUser.LoginProjectId&&x.CreateMan== CreateUser).FirstOrDefault(); + //查到数据,二次确认 + if (modelSum != null) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("该日期已生成数据,是否确认重新生成?", String.Empty, MessageBoxIcon.Question, + PageManager1.GetCustomEventReference("Confirmgd_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + //PageContext.RegisterStartupScript("CloseRefresh()"); + } + else + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PerformanceEdit.aspx?CreateDateMonth=" + drpCompileDateMonth.Text.Trim(), ""), + "新增", Unit.Parse("1000px"), Unit.Parse("800px"))); + } + + } + + /// + /// 确认按钮 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirmgd_OK") + { + // 根据日期查询是否有数据 + var modelSum = Funs.DB.CQMS_Performance.Where(x => x.CreateDateMonth == drpCompileDateMonth.Text.Trim()).FirstOrDefault(); + if (modelSum != null) + { + //删除数据 + PerformanceService.Delete(modelSum.CreateDateMonth); + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PerformanceEdit.aspx?CreateDateMonth=" + + drpCompileDateMonth.Text.Trim(), ""), "新增", Unit.Parse("1000px"), Unit.Parse("800px"))); + } + + //BindGrid(); + //btnNew_Click(); + } + } + + #region list转换datatable + /// + /// Convert a List{T} to a DataTable. + /// + private DataTable ToDataTable(List items) + { + var tb = new DataTable(typeof(T).Name); + + PropertyInfo[] props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance); + + foreach (PropertyInfo prop in props) + { + Type t = GetCoreType(prop.PropertyType); + tb.Columns.Add(prop.Name, t); + } + + foreach (T item in items) + { + var values = new object[props.Length]; + + for (int i = 0; i < props.Length-1; i++) + { + values[i] = props[i].GetValue(item, null); + } + + tb.Rows.Add(values); + } + + return tb; + } + + /// + /// Determine of specified type is nullable + /// + public static bool IsNullable(Type t) + { + return !t.IsValueType || (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)); + } + + /// + /// Return underlying type if type is Nullable otherwise return the type + /// + public static Type GetCoreType(Type t) + { + if (t != null && IsNullable(t)) + { + if (!t.IsValueType) + { + return t; + } + else + { + return Nullable.GetUnderlyingType(t); + } + } + else + { + return t; + } + } + #endregion + + protected void Window1_Close(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 修改月节点目标 + /// + /// + /// + + protected void btnMonthTarget(object sender, EventArgs e) { + if (string.IsNullOrEmpty(PerformanceGid)) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else { + //查询状态是否是0 不是0的不允许修改 + var model = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + if (model == null) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else { + if (CurrUser.UserId != Const.sysglyId && CurrUser.UserId != Const.hfnbdId) + { + if (model.States != "0") + { + ShowNotify("当前数据已经提交,不允许修改。", MessageBoxIcon.Warning); + return; + } + } + } + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthTargetEdit.aspx?PerformanceGid=" + PerformanceGid, ""), + "修改月节点目标", Unit.Parse("1000px"), Unit.Parse("800px"))); + } + } + + /// + /// 修改各周工作任务 + /// + /// + /// + protected void btnTaskContent(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(PerformanceGid)) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else + { + //查询状态是否是0 不是0的不允许修改 + var model = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + if (model == null) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else + { + if (CurrUser.UserId != Const.sysglyId && CurrUser.UserId != Const.hfnbdId) + { + if (model.States != "0") + { + ShowNotify("当前数据已经提交,不允许修改。", MessageBoxIcon.Warning); + return; + } + } + } + + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TaskContentEdit.aspx?PerformanceGid=" + PerformanceGid+ "&CreateDateMonth="+ drpCompileDateMonth.Text.Trim(), ""), + "修改各周工作任务", Unit.Parse("1000px"), Unit.Parse("800px"))); + } + } + + /// + /// + /// + /// + /// + + protected void btnWorkPlan(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(PerformanceGid)) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else + { + //查询状态是否是0 不是0的不允许修改 + var model = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + if (model == null) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else + { + if (CurrUser.UserId != Const.sysglyId && CurrUser.UserId != Const.hfnbdId) + { + if (model.States != "0") + { + ShowNotify("当前数据已经提交,不允许修改。", MessageBoxIcon.Warning); + return; + } + } + } + + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkPlanEdit.aspx?PerformanceGid=" + PerformanceGid + "&CreateDateMonth=" + drpCompileDateMonth.Text.Trim(), ""), + "填写每日工作计划", Unit.Parse("1000px"), Unit.Parse("800px"))); + } + } + + /// + /// 提交打分 + /// + /// + /// + protected void btnSubmit(object sender, EventArgs e) { + if (string.IsNullOrEmpty(PerformanceGid)) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else { + var model = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + if (model.States == "1") + { + ShowNotify("无需重复提交。", MessageBoxIcon.Warning); + return; + } + else { + model.States = "1"; + Funs.DB.SubmitChanges(); + ShowNotify("提交成功,请等待领导打分。", MessageBoxIcon.Success); + } + } + } + #region 导出excel + + + /// + /// 格式化html + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + + MultiHeaderTable mht = new MultiHeaderTable(); + mht.ResolveMultiHeaderTable(Grid1.Columns); + + + sb.Append(""); + + + sb.Append(""); + + ////列数 + //var rowCount = ""; + //var list = Funs.DB.Base_Project.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).OrderBy(x => x.ProjectCode).ToList(); + //for (int i = 0; i < list.Count; i++) + //{ + // rowCount+="{}" + //} + + foreach (List rows in mht.MultiTable) + { + sb.Append(""); + foreach (object[] cell in rows) + { + int rowspan = Convert.ToInt32(cell[0]); + int colspan = Convert.ToInt32(cell[1]); + GridColumn column = cell[2] as GridColumn; + + sb.AppendFormat("{3}", + rowspan != 1 ? " rowspan=\"" + rowspan + "\"" : "", + colspan != 1 ? " colspan=\"" + colspan + "\"" : "", + colspan != 1 ? " style=\"text-align:center;\"" : "", + column.HeaderText); + } + sb.Append(""); + } + + int i = 0; + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + + string MenuC = ""; + int y = 1; + foreach (GridColumn column in mht.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("spanNumber") as System.Web.UI.HtmlControls.HtmlGenericControl).InnerText; + } + else if (column.ColumnID == "tfGender") + { + html = (row.FindControl("labGender") as AspNet.Label).Text; + } + else if (column.ColumnID == "MenuC") + { + MenuC = html; + } + #region 合并单元格 + //合并类别 + else if (column.ColumnID == "PType" && i == 0) + { + sb.AppendFormat("", html); + } + else if (column.ColumnID == "PType" && i != 0) + { + + } + //合并分项 + else if (column.ColumnID== "Itemize"&& row.Values[column.ColumnIndex].ToString().IndexOf("施工进度管理")==-1) + { + sb.AppendFormat("", html); + } + //施工区域不显示 + else if (column.ColumnID == "WorkArea" && row.Values[column.ColumnIndex - 1].ToString().IndexOf("施工进度管理") == -1) + { + + } + //合并施工工作任务安排 + else if (column.ColumnID.IndexOf("TaskContent")!=-1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + sb.AppendFormat("", html); + } + else if (column.ColumnID.IndexOf("ProjectQuantity") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + + } + else if (column.ColumnID.IndexOf("DemandPlan") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + + } + //合并本日工作计划 + else if (column.ColumnID.IndexOf("WorkPlan") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + sb.AppendFormat("", html); + } + else if (column.ColumnID.IndexOf("CompletStatus") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + + } + else + { + sb.AppendFormat("", html); + } + + #endregion + + + + y += 1; + } + i += 1; + sb.Append(""); + } + + sb.Append("
{0}{0}{0}{0}{0}
"); + + return sb.ToString(); + } + + + public static string MidStrEx(string sourse, string startstr, string endstr) + { + string result = string.Empty; + int startindex, endindex; + try + { + startindex = sourse.IndexOf(startstr); + if (startindex == -1) + return result; + string tmpstr = sourse.Substring(startindex + startstr.Length); + endindex = tmpstr.IndexOf(endstr); + if (endindex == -1) + return result; + result = tmpstr.Remove(endindex); + } + catch (Exception ex) + { + + } + return result; + } + + + #region 多表头处理 + + /// + /// 处理多表头的类 + /// + public class MultiHeaderTable + { + // 包含 rowspan,colspan 的多表头,方便生成 HTML 的 table 标签 + public List> MultiTable = new List>(); + // 最终渲染的列数组 + public List Columns = new List(); + + + public void ResolveMultiHeaderTable(GridColumnCollection columns) + { + List row = new List(); + foreach (GridColumn column in columns) + { + object[] cell = new object[4]; + cell[0] = 1; // rowspan + cell[1] = 1; // colspan + cell[2] = column; + cell[3] = null; + + row.Add(cell); + } + + ResolveMultiTable(row, 0); + + ResolveColumns(row); + } + + private void ResolveColumns(List row) + { + foreach (object[] cell in row) + { + GroupField groupField = cell[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + List subrow = new List(); + foreach (GridColumn column in groupField.Columns) + { + subrow.Add(new object[] + { + 1, + 1, + column, + groupField + }); + } + + ResolveColumns(subrow); + } + else + { + Columns.Add(cell[2] as GridColumn); + } + } + + } + + private void ResolveMultiTable(List row, int level) + { + List nextrow = new List(); + + foreach (object[] cell in row) + { + GroupField groupField = cell[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + // 如果当前列包含子列,则更改当前列的 colspan,以及增加父列(向上递归)的colspan + cell[1] = Convert.ToInt32(groupField.Columns.Count); + PlusColspan(level - 1, cell[3] as GridColumn, groupField.Columns.Count - 1); + + foreach (GridColumn column in groupField.Columns) + { + nextrow.Add(new object[] + { + 1, + 1, + column, + groupField + }); + } + } + } + + MultiTable.Add(row); + + // 如果当前下一行,则增加上一行(向上递归)中没有子列的列的 rowspan + if (nextrow.Count > 0) + { + PlusRowspan(level); + + ResolveMultiTable(nextrow, level + 1); + } + } + + private void PlusRowspan(int level) + { + if (level < 0) + { + return; + } + + foreach (object[] cells in MultiTable[level]) + { + GroupField groupField = cells[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + // ... + } + else + { + cells[0] = Convert.ToInt32(cells[0]) + 1; + } + } + + PlusRowspan(level - 1); + } + + private void PlusColspan(int level, GridColumn parent, int plusCount) + { + if (level < 0) + { + return; + } + + foreach (object[] cells in MultiTable[level]) + { + GridColumn column = cells[2] as GridColumn; + if (column == parent) + { + cells[1] = Convert.ToInt32(cells[1]) + plusCount; + + PlusColspan(level - 1, cells[3] as GridColumn, plusCount); + } + } + } + + } + #endregion + #endregion + /// + /// 导出exccel + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) { + Response.ClearContent(); + var projectname = ProjectService.GetProjectNameByProjectId(CurrUser.LoginProjectId); + var excelDate = Convert.ToDateTime(drpCompileDateMonth.Text).Year + "年" + Convert.ToDateTime(drpCompileDateMonth.Text).Month + "月"; + + + var FileName = projectname+"项目"+ excelDate+ "施工工程师绩效考核数据表(暨施工日报表)"; + Response.AddHeader("content-disposition", "attachment; filename=" + FileName + ".xls"); + Response.ContentType = "application/vnd.ms-excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx.designer.cs new file mode 100644 index 00000000..c58f9ccb --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/Performance.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class Performance + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpCompileDateMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker drpCompileDateMonth; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnUpdateMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdateMonth; + + /// + /// btnUpdateTaskContent 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnUpdateTaskContent; + + /// + /// btnAddWorkPlan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAddWorkPlan; + + /// + /// Button1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button1; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx new file mode 100644 index 00000000..0a84c8e8 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx @@ -0,0 +1,485 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PerformanceAudit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.PerformanceAudit" %> + + + + + + + 施工绩效审批打分 + + +
+ + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx.cs new file mode 100644 index 00000000..d0dc9f00 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx.cs @@ -0,0 +1,1700 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Web.UI.WebControls; +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class PerformanceAudit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + public string CompileDateMonth + { + get + { + return (string)ViewState["CompileDateMonth"]; + } + set + { + ViewState["CompileDateMonth"] = value; + } + } + + public string CreateUser + { + get + { + return (string)ViewState["CreateUser"]; + } + set + { + ViewState["CreateUser"] = value; + } + } + + + + + #endregion + + + + + /// + /// 页面加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //CreateUser = CurrUser.UserId; + //BindGrid(); + if (drpUser.SelectedValue!=BLL.Const._Null) + { + BindGrid(); + OutputSummaryData(); + } + } + } + + private void OutputSummaryData() + { + decimal EvaScore = 0; + EvaScore = Funs.DB.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).Sum(x => x.EvaScore) ?? 0; + + JObject summary = new JObject(); + //summary.Add("Major", "全部合计"); + summary.Add("EvaScore", EvaScore.ToString("F2")); + + + Grid1.SummaryData = summary; + + } + + /// + /// 加载表头 + /// + protected void Page_Init(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(CurrUser.LoginProjectId)) + { + if (string.IsNullOrEmpty(CurrUser.LoginProjectId)) + { + ShowNotify("未查询到当前项目,请刷新页面重试。", MessageBoxIcon.Warning); + + } + } + //根据projectid加载CQMS_Performance表中成功的user数据 + BLL.PerformanceService.InitUserDropDownList(drpUser, CurrUser.LoginProjectId, true); + CreateUser = Request.QueryString["CreateUser"]; + if (!string.IsNullOrEmpty(CreateUser)) + { + drpUser.SelectedValue = CreateUser; + } + + drpCompileDateMonth.Text = DateTime.Now.ToString(); + if (string.IsNullOrEmpty(CompileDateMonth)) + { + CompileDateMonth = Request.QueryString["CompileDateMonth"]; + if (!string.IsNullOrEmpty(CompileDateMonth)) + { + drpCompileDateMonth.Text = CompileDateMonth; + } + } + else + { + drpCompileDateMonth.Text = CompileDateMonth; + } + + + InitGrid(); + + } + + #region 加载表头 + string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; + + private void InitGrid() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var NowDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + var Month = 1; + if (NowDate.Month != 12) + { + Month = NowDate.Month + 1; + } + + //获取配置 + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == NowDate.Year.ToString() && x.SortIndex == Month); + if (modelConfig != null) + { + int child3Index = 1; + //先加载周,再加载周里面的天数 + for (int i = 1; i <= modelConfig.SetUpWeek; i++) + { + #region 第?周任务安排、工程量、人材机资源需求计划 + BoundField bf = new BoundField(); + bf.Width = Unit.Pixel(150); + bf.DataField = "TaskContent" + i.ToString(); + bf.ColumnID = "TaskContent" + i.ToString(); + bf.HeaderText = "第" + i.ToString() + "周施工工作任务安排"; + bf.TextAlign = TextAlign.Center; + Grid1.Columns.Add(bf); + + bf = new BoundField(); + bf.Width = Unit.Pixel(100); + bf.DataField = "ProjectQuantity" + i.ToString(); + bf.ColumnID = "ProjectQuantity" + i.ToString(); + bf.HeaderText = "工程量"; + Grid1.Columns.Add(bf); + + bf = new BoundField(); + bf.Width = Unit.Pixel(150); + bf.DataField = "DemandPlan" + i.ToString(); + bf.ColumnID = "DemandPlan" + i.ToString(); + bf.HeaderText = "人材机资源需求计划"; + Grid1.Columns.Add(bf); + #endregion + + var month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + if (Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month.ToString().Length == 1) + { + month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-0" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + } + //1.先获取主表的基础数据 + var modelCQMS_Performance = db.CQMS_Performance.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId + && x.CreateDateMonth == month && x.CreateMan == CreateUser); + if (modelCQMS_Performance != null) + { + PerformanceGid = modelCQMS_Performance.PerformanceGid; + } + else + { + PerformanceGid = ""; + //ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + + + var Child2Model = db.CQMS_Performance_Child2.FirstOrDefault(x => x.NowWeek == i && x.CreateMan == CreateUser && x.PerformanceGid == PerformanceGid); + if (Child2Model == null) + { + PerformanceGid = ""; + //ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + //获取当前周的gid + var Child2Gid = Child2Model.Performance_ChildGid2; + //根据周gid获取天数 + var listChild3 = db.CQMS_Performance_Child3.Where(x => x.Performance_ChildGid2 == Child2Gid + && x.CreateMan == CreateUser).OrderBy(x => x.CurrentDate).ToList(); + + if (listChild3.Count == 0) + { + PerformanceGid = ""; + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + + foreach (var item in listChild3) + { + var Cdate = Convert.ToDateTime(item.CurrentDate); + string week = Day[Convert.ToInt32(Cdate.DayOfWeek.ToString("d"))].ToString(); + //头部 + GroupField p = new GroupField(); + p.Width = Unit.Pixel(200); + p.HeaderText = week + "(" + Cdate.Month + "月" + Cdate.Day + "日)"; + p.TextAlign = TextAlign.Left; + + BoundField gzjh = new BoundField(); + gzjh.Width = Unit.Pixel(200); + gzjh.HeaderText = "本日工作计划"; + gzjh.DataField = "WorkPlan" + child3Index.ToString(); + gzjh.ColumnID = "WorkPlan" + child3Index.ToString(); + gzjh.TextAlign = TextAlign.Center; + + BoundField wcqk = new BoundField(); + wcqk.Width = Unit.Pixel(200); + wcqk.HeaderText = "本日完成情况"; + wcqk.DataField = "CompletStatus" + child3Index.ToString(); + wcqk.ColumnID = "CompletStatus" + child3Index.ToString(); + p.Columns.Add(gzjh); + p.Columns.Add(wcqk); + + Grid1.Columns.Add(p); + child3Index += 1; + } + bf = new BoundField(); + bf.Width = Unit.Pixel(150); + bf.DataField = "TaskCompletContent" + i.ToString(); + bf.ColumnID = "TaskCompletContent" + i.ToString(); + bf.HeaderText = "本周工作任务完成情况"; + Grid1.Columns.Add(bf); + } + } + else + { + ShowNotify("当前日期未设置规则,请前往施工绩效设置页面进行操作。", MessageBoxIcon.Warning); + PageContext.RegisterStartupScript("CloseRefresh()"); + return; + } + + } + + } + #endregion + + #region 合并单元格定义项 + /// + /// 第一行的gid 为了合并单元格用 + /// + public string OneGid + { + get + { + return (string)ViewState["OneGid"]; + } + set + { + ViewState["OneGid"] = value; + } + } + + public string Gid2 + { + get + { + return (string)ViewState["Gid2"]; + } + set + { + ViewState["Gid2"] = value; + } + } + + public string Gid3 + { + get + { + return (string)ViewState["Gid3"]; + } + set + { + ViewState["Gid3"] = value; + } + } + + public string Gid4 + { + get + { + return (string)ViewState["Gid4"]; + } + set + { + ViewState["Gid4"] = value; + } + } + + public string Gid5 + { + get + { + return (string)ViewState["Gid5"]; + } + set + { + ViewState["Gid5"] = value; + } + } + + public string Gid6 + { + get + { + return (string)ViewState["Gid6"]; + } + set + { + ViewState["Gid6"] = value; + } + } + + public int child2Count + { + get + { + return Convert.ToInt32(ViewState["child2Count"]); + } + set + { + ViewState["child2Count"] = value; + } + } + #endregion + + #region 加载表格数据 + /// + /// 加载表格的实体类 + /// + public class GridModels + { + public string Performance_ChildGid1 { get; set; } + public string PerformanceGid { get; set; } + public string PType { get; set; } + + public decimal? EvaScore { get; set; } + public string Itemize { get; set; } + public string WorkArea { get; set; } + public string MonthTarget { get; set; } + + public int? SortIndex { get; set; } + + #region 任务安排 下标9;工程量 14;材机资源需求计划 19 + public string Performance_ChildGid2 { get; set; } + + //任务安排 下标9 + public string TaskContent1 { get; set; } + public string TaskContent2 { get; set; } + public string TaskContent3 { get; set; } + public string TaskContent4 { get; set; } + public string TaskContent5 { get; set; } + + //工程量 14 + public string ProjectQuantity1 { get; set; } + public string ProjectQuantity2 { get; set; } + public string ProjectQuantity3 { get; set; } + public string ProjectQuantity4 { get; set; } + public string ProjectQuantity5 { get; set; } + + //材机资源需求计划 19 + public string DemandPlan1 { get; set; } + public string DemandPlan2 { get; set; } + public string DemandPlan3 { get; set; } + public string DemandPlan4 { get; set; } + public string DemandPlan5 { get; set; } + + //本周工作任务完成情况 24 + public string TaskCompletContent1 { get; set; } + public string TaskCompletContent2 { get; set; } + public string TaskCompletContent3 { get; set; } + public string TaskCompletContent4 { get; set; } + public string TaskCompletContent5 { get; set; } + #endregion + + #region 每天任务完成情况 下标29 + public string WorkPlan1 { get; set; } + public string WorkPlan2 { get; set; } + public string WorkPlan3 { get; set; } + public string WorkPlan4 { get; set; } + public string WorkPlan5 { get; set; } + public string WorkPlan6 { get; set; } + public string WorkPlan7 { get; set; } + public string WorkPlan8 { get; set; } + public string WorkPlan9 { get; set; } + public string WorkPlan10 { get; set; } + public string WorkPlan11 { get; set; } + public string WorkPlan12 { get; set; } + public string WorkPlan13 { get; set; } + public string WorkPlan14 { get; set; } + public string WorkPlan15 { get; set; } + public string WorkPlan16 { get; set; } + public string WorkPlan17 { get; set; } + public string WorkPlan18 { get; set; } + public string WorkPlan19 { get; set; } + public string WorkPlan20 { get; set; } + public string WorkPlan21 { get; set; } + public string WorkPlan22 { get; set; } + public string WorkPlan23 { get; set; } + public string WorkPlan24 { get; set; } + public string WorkPlan25 { get; set; } + public string WorkPlan26 { get; set; } + public string WorkPlan27 { get; set; } + public string WorkPlan28 { get; set; } + public string WorkPlan29 { get; set; } + public string WorkPlan30 { get; set; } + public string WorkPlan31 { get; set; } + public string WorkPlan32 { get; set; } + public string WorkPlan33 { get; set; } + #endregion + + #region 本日完成情况 下标 62 + public string CompletStatus1 { get; set; } + public string CompletStatus2 { get; set; } + public string CompletStatus3 { get; set; } + public string CompletStatus4 { get; set; } + public string CompletStatus5 { get; set; } + public string CompletStatus6 { get; set; } + public string CompletStatus7 { get; set; } + public string CompletStatus8 { get; set; } + public string CompletStatus9 { get; set; } + public string CompletStatus10 { get; set; } + public string CompletStatus11 { get; set; } + public string CompletStatus12 { get; set; } + public string CompletStatus13 { get; set; } + public string CompletStatus14 { get; set; } + public string CompletStatus15 { get; set; } + public string CompletStatus16 { get; set; } + public string CompletStatus17 { get; set; } + public string CompletStatus18 { get; set; } + public string CompletStatus19 { get; set; } + public string CompletStatus20 { get; set; } + public string CompletStatus21 { get; set; } + public string CompletStatus22 { get; set; } + public string CompletStatus23 { get; set; } + public string CompletStatus24 { get; set; } + public string CompletStatus25 { get; set; } + public string CompletStatus26 { get; set; } + public string CompletStatus27 { get; set; } + public string CompletStatus28 { get; set; } + public string CompletStatus29 { get; set; } + public string CompletStatus30 { get; set; } + public string CompletStatus31 { get; set; } + public string CompletStatus32 { get; set; } + public string CompletStatus33 { get; set; } + #endregion + + #region 定义索引 + //定义索引器,name 字段的索引值为 0 ,password 字段的索引值为 1 + public string this[int index] + { + #region get + get + { + if (index == 0) + { + return WorkPlan1; + } + else if (index == 1) + { + return WorkPlan2; + } + else if (index == 2) + { + return WorkPlan3; + } + else if (index == 3) + { + return WorkPlan4; + } + else if (index == 4) + { + return WorkPlan5; + } + else if (index == 5) + { + return WorkPlan6; + } + else if (index == 6) + { + return WorkPlan7; + } + else if (index == 7) + { + return WorkPlan8; + } + else if (index == 8) + { + return WorkPlan9; + } + else if (index == 9) + { + return WorkPlan10; + } + else if (index == 10) + { + return WorkPlan11; + } + else if (index == 11) + { + return WorkPlan12; + } + else if (index == 12) + { + return WorkPlan13; + } + else if (index == 13) + { + return WorkPlan14; + } + else if (index == 14) + { + return WorkPlan15; + } + else if (index == 15) + { + return WorkPlan16; + } + else if (index == 16) + { + return WorkPlan17; + } + else if (index == 17) + { + return WorkPlan18; + } + else if (index == 18) + { + return WorkPlan19; + } + else if (index == 19) + { + return WorkPlan20; + } + else if (index == 20) + { + return WorkPlan21; + } + else if (index == 21) + { + return WorkPlan22; + } + else if (index == 22) + { + return WorkPlan23; + } + else if (index == 23) + { + return WorkPlan24; + } + else if (index == 24) + { + return WorkPlan25; + } + else if (index == 25) + { + return WorkPlan26; + } + else if (index == 26) + { + return WorkPlan27; + } + else if (index == 27) + { + return WorkPlan28; + } + else if (index == 28) + { + return WorkPlan29; + } + else if (index == 29) + { + return WorkPlan30; + } + else if (index == 30) + { + return WorkPlan31; + } + else if (index == 31) + { + return WorkPlan32; + } + else if (index == 32) + { + return CompletStatus1; + } + else if (index == 33) + { + return CompletStatus2; + } + else if (index == 34) + { + return CompletStatus3; + } + else if (index == 35) + { + return CompletStatus4; + } + else if (index == 36) + { + return CompletStatus5; + } + else if (index == 37) + { + return CompletStatus6; + } + else if (index == 38) + { + return CompletStatus7; + } + else if (index == 39) + { + return CompletStatus8; + } + else if (index == 40) + { + return CompletStatus9; + } + else if (index == 41) + { + return CompletStatus10; + } + else if (index == 42) + { + return CompletStatus11; + } + else if (index == 43) + { + return CompletStatus12; + } + else if (index == 44) + { + return CompletStatus13; + } + else if (index == 45) + { + return CompletStatus14; + } + else if (index == 46) + { + return CompletStatus15; + } + else if (index == 47) + { + return CompletStatus16; + } + else if (index == 48) + { + return CompletStatus17; + } + else if (index == 49) + { + return CompletStatus18; + } + else if (index == 50) + { + return CompletStatus19; + } + else if (index == 51) + { + return CompletStatus20; + } + else if (index == 52) + { + return CompletStatus21; + } + else if (index == 53) + { + return CompletStatus22; + } + else if (index == 54) + { + return CompletStatus23; + } + else if (index == 55) + { + return CompletStatus24; + } + else if (index == 56) + { + return CompletStatus25; + } + else if (index == 57) + { + return CompletStatus26; + } + else if (index == 58) + { + return CompletStatus27; + } + else if (index == 59) + { + return CompletStatus28; + } + else if (index == 60) + { + return CompletStatus29; + } + else if (index == 61) + { + return CompletStatus30; + } + else if (index == 62) + { + return CompletStatus31; + } + else if (index == 63) + { + return CompletStatus32; + } + + else { return null; } + #endregion + + } + set + { + if (index == 0) + { + WorkPlan1 = value; + } + else if (index == 1) + { + WorkPlan2 = value; + } + else if (index == 2) + { + WorkPlan3 = value; + } + else if (index == 3) + { + WorkPlan4 = value; + } + else if (index == 4) + { + WorkPlan5 = value; + } + else if (index == 5) + { + WorkPlan6 = value; + } + else if (index == 6) + { + WorkPlan7 = value; + } + else if (index == 7) + { + WorkPlan8 = value; + } + else if (index == 8) + { + WorkPlan9 = value; + } + else if (index == 9) + { + WorkPlan10 = value; + } + else if (index == 10) + { + WorkPlan11 = value; + } + else if (index == 11) + { + WorkPlan12 = value; + } + else if (index == 12) + { + WorkPlan13 = value; + } + else if (index == 13) + { + WorkPlan14 = value; + } + else if (index == 14) + { + WorkPlan15 = value; + } + else if (index == 15) + { + WorkPlan16 = value; + } + else if (index == 16) + { + WorkPlan17 = value; + } + else if (index == 17) + { + WorkPlan18 = value; + } + else if (index == 18) + { + WorkPlan19 = value; + } + else if (index == 19) + { + WorkPlan20 = value; + } + else if (index == 20) + { + WorkPlan21 = value; + } + else if (index == 21) + { + WorkPlan22 = value; + } + else if (index == 22) + { + WorkPlan23 = value; + } + else if (index == 23) + { + WorkPlan24 = value; + } + else if (index == 24) + { + WorkPlan25 = value; + } + else if (index == 25) + { + WorkPlan26 = value; + } + else if (index == 26) + { + WorkPlan27 = value; + } + else if (index == 27) + { + WorkPlan28 = value; + } + else if (index == 28) + { + WorkPlan29 = value; + } + else if (index == 29) + { + WorkPlan30 = value; + } + else if (index == 30) + { + WorkPlan31 = value; + } + else if (index == 31) + { + WorkPlan32 = value; + } + else if (index == 32) + { + CompletStatus1 = value; + } + else if (index == 33) + { + CompletStatus2 = value; + } + else if (index == 34) + { + CompletStatus3 = value; + } + else if (index == 35) + { + CompletStatus4 = value; + } + else if (index == 36) + { + CompletStatus5 = value; + } + else if (index == 37) + { + CompletStatus6 = value; + } + else if (index == 38) + { + CompletStatus7 = value; + } + else if (index == 39) + { + CompletStatus8 = value; + } + else if (index == 40) + { + CompletStatus9 = value; + } + else if (index == 41) + { + CompletStatus10 = value; + } + else if (index == 42) + { + CompletStatus11 = value; + } + else if (index == 43) + { + CompletStatus12 = value; + } + else if (index == 44) + { + CompletStatus13 = value; + } + else if (index == 45) + { + CompletStatus14 = value; + } + else if (index == 46) + { + CompletStatus15 = value; + } + else if (index == 47) + { + CompletStatus16 = value; + } + else if (index == 48) + { + CompletStatus17 = value; + } + else if (index == 49) + { + CompletStatus18 = value; + } + else if (index == 50) + { + CompletStatus19 = value; + } + else if (index == 51) + { + CompletStatus20 = value; + } + else if (index == 52) + { + CompletStatus21 = value; + } + else if (index == 53) + { + CompletStatus22 = value; + } + else if (index == 54) + { + CompletStatus23 = value; + } + else if (index == 55) + { + CompletStatus24 = value; + } + else if (index == 56) + { + CompletStatus25 = value; + } + else if (index == 57) + { + CompletStatus26 = value; + } + else if (index == 58) + { + CompletStatus27 = value; + } + else if (index == 59) + { + CompletStatus28 = value; + } + else if (index == 60) + { + CompletStatus29 = value; + } + else if (index == 61) + { + CompletStatus30 = value; + } + else if (index == 62) + { + CompletStatus31 = value; + } + else if (index == 63) + { + CompletStatus32 = value; + } + + } + } + #endregion + + } + + /// + /// 加载数据 + /// + private void BindGrid() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + if (Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month.ToString().Length == 1) + { + month = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Year + "-0" + Convert.ToDateTime(drpCompileDateMonth.Text.Trim()).Month; + } + //1.先获取主表的基础数据 + var modelCQMS_Performance = db.CQMS_Performance.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId + && x.CreateDateMonth == month && x.CreateMan == CreateUser&&x.States=="1"); + if (modelCQMS_Performance != null) + { + + Grid1.Title = "五环责任人:" + modelCQMS_Performance.HeadUserid + ";本月完成专业产值:" + + modelCQMS_Performance.ProOutputValue + "万元;分包商负责人:" + + modelCQMS_Performance.SubUserids + ";分包工程师、班组长:" + modelCQMS_Performance.SubpackageUserids; + PerformanceGid = modelCQMS_Performance.PerformanceGid; + //根据主键查询CQMS_Performance_Child1 + var listChild1 = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).OrderBy(x => x.SortIndex) + .Select(x => new GridModels + { + Performance_ChildGid1 = x.Performance_ChildGid1, + PerformanceGid = x.PerformanceGid, + PType = x.PType, + EvaScore = x.EvaScore, + Itemize = x.Itemize, + WorkArea = x.WorkArea, + MonthTarget = x.MonthTarget, + SortIndex = x.SortIndex + }).ToList(); + #region 合并单元格参数 + //获取各行的gid + OneGid = listChild1[0].Performance_ChildGid1; + Gid2 = listChild1[1].Performance_ChildGid1; + Gid3 = listChild1[2].Performance_ChildGid1; + Gid4 = listChild1[3].Performance_ChildGid1; + Gid5 = listChild1[4].Performance_ChildGid1; + Gid6 = listChild1[5].Performance_ChildGid1; + //获取CQMS_Performance_Child2 表中的数据 + int child2Count = db.CQMS_Performance_Child2.Where(x => x.NowWeek == 1 && x.PerformanceGid == PerformanceGid).ToList().Count(); + #endregion + + + //加载各周任务、工程量、人材机、完成情况 + + //根据gid获取CQMS_Performance_Child2 施工进度管理的子表数据,大于一条,就要多增加数据到List中 + var ChildSgjdCount = db.CQMS_Performance_Child2.Where(x => x.NowWeek == 1 && x.PerformanceGid == PerformanceGid + && x.Performance_ChildGid1 == OneGid).ToList().Count(); + var addList = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1) + .Select(x => new GridModels + { + Performance_ChildGid1 = x.Performance_ChildGid1, + PerformanceGid = x.PerformanceGid, + PType = x.PType, + EvaScore = x.EvaScore, + Itemize = x.Itemize, + WorkArea = x.WorkArea, + MonthTarget = x.MonthTarget, + SortIndex = x.SortIndex + }).ToList(); + if (ChildSgjdCount == 2) + { + addList[0].Performance_ChildGid1 = addList[0].Performance_ChildGid1 + "one"; + listChild1.InsertRange(1, addList); + } + else if (ChildSgjdCount == 3) + { + var pgid = addList[0].Performance_ChildGid1; + addList[0].Performance_ChildGid1 = pgid + "one"; + listChild1.InsertRange(1, addList); + addList[0].Performance_ChildGid1 = pgid + "two"; + listChild1.InsertRange(2, addList); + } + + //循环list给每周任务、工程量、资源需求计划、本周工作任务完成情况 ,每日工作计划、完成情况赋值 + //获取周数 + var NowDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + var Month = 1; + if (NowDate.Month != 12) + { + Month = NowDate.Month + 1; + } + + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == NowDate.Year.ToString() && x.SortIndex == Month); + + for (int i = 0; i < listChild1.Count; i++) + { + var CompletStatusIndex = 32; + var zIndex = 0; + //循环周数- + for (int y = 0; y < modelConfig.SetUpWeek; y++) + { + var chilGid = listChild1[i].Performance_ChildGid1; + if (chilGid.IndexOf("one") > -1 || chilGid.IndexOf("two") > -1) + { + chilGid = chilGid.Substring(0, chilGid.Length - 3); + } + + //根据周数获取数据 + var Child2ListNew = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == listChild1[i].PerformanceGid + && x.Performance_ChildGid1 == chilGid && x.NowWeek == (y + 1) && x.SortIndex == (i + 1)); + //将list中的周数数据插入 + if (Child2ListNew == null) + { + PerformanceGid = ""; + ShowNotify("数据有误。请重新生成", MessageBoxIcon.Warning); + return; + } + switch (y) + { + case 0: + listChild1[i].TaskContent1 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity1 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan1 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent1 = Child2ListNew.TaskCompletContent; + break; + case 1: + listChild1[i].TaskContent2 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity2 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan2 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent2 = Child2ListNew.TaskCompletContent; + break; + case 2: + listChild1[i].TaskContent3 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity3 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan3 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent3 = Child2ListNew.TaskCompletContent; + break; + case 3: + listChild1[i].TaskContent4 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity4 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan4 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent4 = Child2ListNew.TaskCompletContent; + break; + case 4: + listChild1[i].TaskContent5 = Child2ListNew.TaskContent; + listChild1[i].ProjectQuantity5 = Child2ListNew.ProjectQuantity; + listChild1[i].DemandPlan5 = Child2ListNew.DemandPlan; + listChild1[i].TaskCompletContent5 = Child2ListNew.TaskCompletContent; + break; + } + + #region 根据周id获取日 + var Child3ListNew = db.CQMS_Performance_Child3.Where(x => x.Performance_ChildGid2 == Child2ListNew.Performance_ChildGid2) + .OrderBy(x => x.CurrentDate).ToList(); + + for (var z = 0; z < Child3ListNew.Count; z++) + { + listChild1[i][zIndex] = Child3ListNew[z].WorkPlan; + listChild1[i][CompletStatusIndex] = Child3ListNew[z].CompletStatus; + CompletStatusIndex += 1; + zIndex += 1; + + } + #endregion + } + } + + + //重新给list设置 序号 + int sindex = 1; + listChild1.ForEach(x => + { + x.SortIndex = sindex; + sindex += 1; + }); + var table = ToDataTable(listChild1); + Grid1.DataSource = table; + Grid1.DataBind(); + + + #region 合并单元格 + + + + var DateIffs = DateDiff(Convert.ToDateTime(modelConfig.SetUpStartDate), Convert.ToDateTime(modelConfig.SetUpEndDate)) + 1; + if (ChildSgjdCount > 1) + { + //合并单元格方法 + PageContext.RegisterStartupScript("onGridDataLoad('" + OneGid + "','" + child2Count + "','" + Gid2 + "','" + + Gid3 + "','" + Gid4 + "','" + Gid5 + "','" + Gid6 + "','" + ChildSgjdCount + "','" + modelConfig.SetUpWeek + "'," + DateIffs + ")"); + } + else + { + //合并单元格方法 + PageContext.RegisterStartupScript("onGridDataLoad('" + OneGid + "','" + child2Count + "','" + Gid2 + "','" + + Gid3 + "','" + Gid4 + "','" + Gid5 + "','" + Gid6 + "',0,'" + modelConfig.SetUpWeek + "'," + DateIffs + ")"); + } + #endregion + + } + else + { + if (string.IsNullOrEmpty(CurrUser.LoginProjectId)) + { + ShowNotify("未查询到当前项目,请刷新页面重试。", MessageBoxIcon.Warning); + + } + else + { + ShowNotify("当前年月未查询到提交的数据。", MessageBoxIcon.Warning); + } + } + } + } + + /// + /// 计算日期之间的天数 + /// + /// + /// + /// + private int DateDiff(DateTime dateStart, DateTime dateEnd) + + { + + DateTime start = Convert.ToDateTime(dateStart.ToShortDateString()); + + DateTime end = Convert.ToDateTime(dateEnd.ToShortDateString()); + + TimeSpan sp = end.Subtract(start); + + return sp.Days; + } + #endregion + /// + /// 查询绑定数据 + /// + /// + /// + protected void btnBindGrid(object sender, EventArgs e) + { + var Rurl = Request.Url.ToString(); + if (Rurl.IndexOf("?") > -1) + { + Rurl = Rurl.Substring(0, Rurl.IndexOf("?")); + } + if (drpUser.SelectedValue==BLL.Const._Null) + { + ShowNotify("请选择要打分的施工工程师。", MessageBoxIcon.Warning); + return; + } + //重定向当前页面传值 + Response.Redirect(Rurl + "?CompileDateMonth=" + drpCompileDateMonth.Text+"&CreateUser="+drpUser.SelectedValue); + //BindGrid(); + } + + protected void drpUser_SelectedIndexChanged(object sender, EventArgs e) { + + } + + + #region list转换datatable + /// + /// Convert a List{T} to a DataTable. + /// + private DataTable ToDataTable(List items) + { + var tb = new DataTable(typeof(T).Name); + + PropertyInfo[] props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance); + + foreach (PropertyInfo prop in props) + { + Type t = GetCoreType(prop.PropertyType); + tb.Columns.Add(prop.Name, t); + } + + foreach (T item in items) + { + var values = new object[props.Length]; + + for (int i = 0; i < props.Length - 1; i++) + { + values[i] = props[i].GetValue(item, null); + } + + tb.Rows.Add(values); + } + + return tb; + } + + /// + /// Determine of specified type is nullable + /// + public static bool IsNullable(Type t) + { + return !t.IsValueType || (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)); + } + + /// + /// Return underlying type if type is Nullable otherwise return the type + /// + public static Type GetCoreType(Type t) + { + if (t != null && IsNullable(t)) + { + if (!t.IsValueType) + { + return t; + } + else + { + return Nullable.GetUnderlyingType(t); + } + } + else + { + return t; + } + } + #endregion + + protected void Window1_Close(object sender, EventArgs e) + { + BindGrid(); + } + + + /// + /// + /// + /// + /// + + protected void btnNew_Score(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(PerformanceGid)) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else + { + //查询状态是否是1 不是1的不允许打分 + var model = Funs.DB.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid); + if (model == null) + { + ShowNotify("未查询到数据,请先生成表单。", MessageBoxIcon.Warning); + return; + } + else + { + if (CurrUser.UserId != Const.sysglyId && CurrUser.UserId != Const.hfnbdId) + { + if (model.States != "1") + { + ShowNotify("当前数据未提交,不允许打分。", MessageBoxIcon.Warning); + return; + } + } + } + + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ScoreEdit.aspx?PerformanceGid=" + PerformanceGid + "&CreateDateMonth=" + drpCompileDateMonth.Text.Trim(), ""), + "打分", Unit.Parse("1000px"), Unit.Parse("800px"))); + } + } + + #region 导出excel + + + /// + /// 格式化html + /// + /// + /// + private string GetGridTableHtml(Grid grid) + { + StringBuilder sb = new StringBuilder(); + + MultiHeaderTable mht = new MultiHeaderTable(); + mht.ResolveMultiHeaderTable(Grid1.Columns); + + + sb.Append(""); + + + sb.Append(""); + + ////列数 + //var rowCount = ""; + //var list = Funs.DB.Base_Project.Where(x => x.ProjectState == Const.ProjectState_1 || x.ProjectState == null).OrderBy(x => x.ProjectCode).ToList(); + //for (int i = 0; i < list.Count; i++) + //{ + // rowCount+="{}" + //} + + foreach (List rows in mht.MultiTable) + { + sb.Append(""); + foreach (object[] cell in rows) + { + int rowspan = Convert.ToInt32(cell[0]); + int colspan = Convert.ToInt32(cell[1]); + GridColumn column = cell[2] as GridColumn; + + sb.AppendFormat("{3}", + rowspan != 1 ? " rowspan=\"" + rowspan + "\"" : "", + colspan != 1 ? " colspan=\"" + colspan + "\"" : "", + colspan != 1 ? " style=\"text-align:center;\"" : "", + column.HeaderText); + } + sb.Append(""); + } + + int i = 0; + foreach (GridRow row in grid.Rows) + { + sb.Append(""); + + string MenuC = ""; + int y = 1; + foreach (GridColumn column in mht.Columns) + { + string html = row.Values[column.ColumnIndex].ToString(); + if (column.ColumnID == "tfNumber") + { + html = (row.FindControl("spanNumber") as System.Web.UI.HtmlControls.HtmlGenericControl).InnerText; + } + else if (column.ColumnID == "tfGender") + { + html = (row.FindControl("labGender") as AspNet.Label).Text; + } + else if (column.ColumnID == "MenuC") + { + MenuC = html; + } + #region 合并单元格 + //合并类别 + else if (column.ColumnID == "PType" && i == 0) + { + sb.AppendFormat("", html); + } + else if (column.ColumnID == "PType" && i != 0) + { + + } + //合并分项 + else if (column.ColumnID == "Itemize" && row.Values[column.ColumnIndex].ToString().IndexOf("施工进度管理") == -1) + { + sb.AppendFormat("", html); + } + //施工区域不显示 + else if (column.ColumnID == "WorkArea" && row.Values[column.ColumnIndex - 1].ToString().IndexOf("施工进度管理") == -1) + { + + } + //合并施工工作任务安排 + else if (column.ColumnID.IndexOf("TaskContent") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + sb.AppendFormat("", html); + } + else if (column.ColumnID.IndexOf("ProjectQuantity") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + + } + else if (column.ColumnID.IndexOf("DemandPlan") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + + } + //合并本日工作计划 + else if (column.ColumnID.IndexOf("WorkPlan") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + sb.AppendFormat("", html); + } + else if (column.ColumnID.IndexOf("CompletStatus") != -1 && row.Values[3].ToString().IndexOf("施工进度管理") == -1) + { + + } + else + { + sb.AppendFormat("", html); + } + + #endregion + + + + y += 1; + } + i += 1; + sb.Append(""); + } + + sb.Append("
{0}{0}{0}{0}{0}
"); + + return sb.ToString(); + } + + + public static string MidStrEx(string sourse, string startstr, string endstr) + { + string result = string.Empty; + int startindex, endindex; + try + { + startindex = sourse.IndexOf(startstr); + if (startindex == -1) + return result; + string tmpstr = sourse.Substring(startindex + startstr.Length); + endindex = tmpstr.IndexOf(endstr); + if (endindex == -1) + return result; + result = tmpstr.Remove(endindex); + } + catch (Exception ex) + { + + } + return result; + } + + + #region 多表头处理 + + /// + /// 处理多表头的类 + /// + public class MultiHeaderTable + { + // 包含 rowspan,colspan 的多表头,方便生成 HTML 的 table 标签 + public List> MultiTable = new List>(); + // 最终渲染的列数组 + public List Columns = new List(); + + + public void ResolveMultiHeaderTable(GridColumnCollection columns) + { + List row = new List(); + foreach (GridColumn column in columns) + { + object[] cell = new object[4]; + cell[0] = 1; // rowspan + cell[1] = 1; // colspan + cell[2] = column; + cell[3] = null; + + row.Add(cell); + } + + ResolveMultiTable(row, 0); + + ResolveColumns(row); + } + + private void ResolveColumns(List row) + { + foreach (object[] cell in row) + { + GroupField groupField = cell[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + List subrow = new List(); + foreach (GridColumn column in groupField.Columns) + { + subrow.Add(new object[] + { + 1, + 1, + column, + groupField + }); + } + + ResolveColumns(subrow); + } + else + { + Columns.Add(cell[2] as GridColumn); + } + } + + } + + private void ResolveMultiTable(List row, int level) + { + List nextrow = new List(); + + foreach (object[] cell in row) + { + GroupField groupField = cell[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + // 如果当前列包含子列,则更改当前列的 colspan,以及增加父列(向上递归)的colspan + cell[1] = Convert.ToInt32(groupField.Columns.Count); + PlusColspan(level - 1, cell[3] as GridColumn, groupField.Columns.Count - 1); + + foreach (GridColumn column in groupField.Columns) + { + nextrow.Add(new object[] + { + 1, + 1, + column, + groupField + }); + } + } + } + + MultiTable.Add(row); + + // 如果当前下一行,则增加上一行(向上递归)中没有子列的列的 rowspan + if (nextrow.Count > 0) + { + PlusRowspan(level); + + ResolveMultiTable(nextrow, level + 1); + } + } + + private void PlusRowspan(int level) + { + if (level < 0) + { + return; + } + + foreach (object[] cells in MultiTable[level]) + { + GroupField groupField = cells[2] as GroupField; + if (groupField != null && groupField.Columns.Count > 0) + { + // ... + } + else + { + cells[0] = Convert.ToInt32(cells[0]) + 1; + } + } + + PlusRowspan(level - 1); + } + + private void PlusColspan(int level, GridColumn parent, int plusCount) + { + if (level < 0) + { + return; + } + + foreach (object[] cells in MultiTable[level]) + { + GridColumn column = cells[2] as GridColumn; + if (column == parent) + { + cells[1] = Convert.ToInt32(cells[1]) + plusCount; + + PlusColspan(level - 1, cells[3] as GridColumn, plusCount); + } + } + } + + } + #endregion + #endregion + /// + /// 导出exccel + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + var projectname = ProjectService.GetProjectNameByProjectId(CurrUser.LoginProjectId); + var excelDate = Convert.ToDateTime(drpCompileDateMonth.Text).Year + "年" + Convert.ToDateTime(drpCompileDateMonth.Text).Month + "月"; + + + var FileName = projectname + "项目" + excelDate + "施工工程师绩效考核数据表(暨施工日报表)"; + Response.AddHeader("content-disposition", "attachment; filename=" + FileName + ".xls"); + Response.ContentType = "application/vnd.ms-excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx.designer.cs new file mode 100644 index 00000000..70496e9d --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceAudit.aspx.designer.cs @@ -0,0 +1,125 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class PerformanceAudit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// drpCompileDateMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker drpCompileDateMonth; + + /// + /// drpUser 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUser; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx new file mode 100644 index 00000000..e5c6d3cb --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx @@ -0,0 +1,133 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PerformanceConfig.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.PerformanceConfig" %> + + + + + + + 施工绩效设置 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx.cs new file mode 100644 index 00000000..2232e1a5 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Web.UI.WebControls; +using BLL; +using Model; +using AspNet = System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class PerformanceConfig : PageBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //当前年份 + dpYear.Text = DateTime.Now.Year.ToString(); + var model = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == dpYear.Text); + if (model != null) + { + BindGrid(); + } + } + } + + protected void btnSearch_searach(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(dpYear.Text.Trim())) + { + ShowNotify("年份不能为空。", MessageBoxIcon.Warning); + PageContext.RegisterStartupScript("CloseRefresh()"); + return; + } + else + { + BindGrid(); + } + } + + /// + /// 判断生成操作 + /// + protected void btnNew_Juge(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(dpYear.Text.Trim())) + { + ShowNotify("年份不能为空。", MessageBoxIcon.Warning); + PageContext.RegisterStartupScript("CloseRefresh()"); + return; + } + //根据年份查询是否有数据 + var modelSum = Funs.DB.CQMS_Performance_SetUp.Where(x => x.CreateYear == dpYear.Text.Trim()).FirstOrDefault(); + //查到数据,二次确认 + if (modelSum != null) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("该日期已生成数据,是否确认重新生成?", String.Empty, MessageBoxIcon.Question, + PageManager1.GetCustomEventReference(false, "Confirmgd_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + PageContext.RegisterStartupScript("CloseRefresh()"); + } + else + { + //生成数据 + AddPerformanceConfig(); + } + + } + private void BindGrid() + { + string strSql = @"SELECT * FROM CQMS_Performance_SetUp where 1=1 "; + List listStr = new List(); + if (!string.IsNullOrEmpty(dpYear.Text.Trim())) + { + strSql += " AND CreateYear = @CreateYear"; + listStr.Add(new SqlParameter("@CreateYear", dpYear.Text.Trim())); + } + strSql += " order by SortIndex "; + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + Grid1.RecordCount = tb.Rows.Count; + var table = tb; + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 生成 + /// + private void AddPerformanceConfig() + { + List modelList = new List(); + for (int i = 0; i < 12; i++) + { + Model.CQMS_Performance_SetUp model = new CQMS_Performance_SetUp(); + model.PerformanceSteUpGid = Guid.NewGuid().ToString(); + + //第一次是上一年的12月份 + if (i==0) + { + model.SetUpMonth = (Convert.ToInt32(dpYear.Text.Trim()) - 1).ToString() +"-" + 12; + model.SetUpStartDate = (Convert.ToInt32(dpYear.Text.Trim()) - 1).ToString() + "-" + 12 + "-" + "01"; + var dates = Convert.ToDateTime((dpYear.Text.Trim() + "-" + (i + 1) + "-" + "01")).AddMonths(1).AddDays(-1); + model.SetUpEndDate = (Convert.ToInt32(dpYear.Text.Trim()) - 1).ToString() + "-12-" + dates.Day; + model.CreateDate = Convert.ToDateTime(dpYear.Text.Trim() + "-" + 12); + } + else + { + model.SetUpMonth = dpYear.Text.Trim() + "-" + (i); + model.SetUpStartDate = dpYear.Text.Trim() + "-" + (i ) + "-" + "01"; + var dates = Convert.ToDateTime((dpYear.Text.Trim() + "-" + (i ) + "-" + "01")).AddMonths(1).AddDays(-1); + model.SetUpEndDate = dates.Year.ToString() + "-" + dates.Month + "-" + dates.Day; + model.CreateDate = Convert.ToDateTime(dpYear.Text.Trim() + "-" + (i)); + } + + model.SetUpWeek = 4; + model.CreateYear = dpYear.Text.Trim(); + model.SortIndex = (i + 1); + + + modelList.Add(model); + } + Funs.DB.CQMS_Performance_SetUp.InsertAllOnSubmit(modelList); + Funs.DB.SubmitChanges(); + BindGrid(); + } + + // + /// 重新生成确认按钮 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirmgd_OK" || e.EventArgument == "Confirmgy_OK") + { + // 根据日期查询是否有数据 + var modelSum = Funs.DB.CQMS_Performance_SetUp.Where(x => x.CreateYear == dpYear.Text.Trim()).ToList(); + if (modelSum.Count > 0) + { + //删除所有数据 + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + db.CQMS_Performance_SetUp.DeleteAllOnSubmit(modelSum); + //生成数据 + + } + } + + } + } + + protected void Button2_Click(object sender, EventArgs e) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + Dictionary> modifiedDict = Grid1.GetModifiedDict(); + + foreach (int rowIndex in modifiedDict.Keys) + { + Model.CQMS_Performance_SetUp model = new CQMS_Performance_SetUp(); + model.PerformanceSteUpGid = Grid1.DataKeys[rowIndex][0].ToString(); + model = db.CQMS_Performance_SetUp.FirstOrDefault(x => x.PerformanceSteUpGid == model.PerformanceSteUpGid); + if (modifiedDict[rowIndex].ContainsKey("SetUpStartDate")) + { + model.SetUpStartDate = modifiedDict[rowIndex]["SetUpStartDate"].ToString(); + } + if (modifiedDict[rowIndex].ContainsKey("SetUpEndDate")) + { + model.SetUpEndDate = modifiedDict[rowIndex]["SetUpEndDate"].ToString(); + } + if (modifiedDict[rowIndex].ContainsKey("SetUpWeek")) + { + model.SetUpWeek = Convert.ToInt32(modifiedDict[rowIndex]["SetUpWeek"].ToString()); + } + db.SubmitChanges(); + } + BindGrid(); + ShowNotify("保存成功。", MessageBoxIcon.Success); + } + } + + + + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx.designer.cs new file mode 100644 index 00000000..796d3ea9 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceConfig.aspx.designer.cs @@ -0,0 +1,143 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class PerformanceConfig + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// dpYear 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpYear; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// DatePicker1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker DatePicker1; + + /// + /// DatePicker2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker DatePicker2; + + /// + /// tbxSetUpWeek 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox tbxSetUpWeek; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx new file mode 100644 index 00000000..30459786 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx @@ -0,0 +1,310 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PerformanceEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.PerformanceEdit" %> + + + + + + + 添加施工绩效管理 + + +
+ + + + <%-- 第一步生成基础信息--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + --%> + + <%--第二步生成施工区域/工序、月节点目标--%> + + + + + + + + + + + + <%--第三步生成各周工作任务安排、工程量、人材机资源需求计划--%> + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx.cs new file mode 100644 index 00000000..4fdc1f81 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx.cs @@ -0,0 +1,806 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class PerformanceEdit : PageBase + { + #region 定义项 + /// + /// 日期 + /// + public string CreateDateMonth + { + get + { + return (string)ViewState["CreateDateMonth"]; + } + set + { + ViewState["CreateDateMonth"] = value; + } + } + + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + public int stepIndex + { + get + { + return Convert.ToInt32(ViewState["stepIndex"]); + } + set + { + ViewState["stepIndex"] = value; + } + } + + public string CreateUser + { + get + { + return (string)ViewState["CreateUser"]; + } + set + { + ViewState["CreateUser"] = value; + } + } + + public string CreateProject + { + + get + { + return (string)ViewState["CreateProject"]; + } + set + { + ViewState["CreateProject"] = value; + } + } + #endregion + + /// + /// 页面加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CreateDateMonth = Request.Params["CreateDateMonth"]; + + this.drpCompileDateMonth.Text = CreateDateMonth; + + CreateUser = CurrUser.UserId; + CreateProject = CurrUser.LoginProjectId; + } + + } + + #region Performance_ChildGid1表的gid + public string Performance_ChildGid1Sg + { + get + { + return (string)ViewState["Performance_ChildGid1Sg"]; + } + set + { + ViewState["Performance_ChildGid1Sg"] = value; + } + } + + public string Performance_ChildGid1Hse + { + get + { + return (string)ViewState["Performance_ChildGid1Hse"]; + } + set + { + ViewState["Performance_ChildGid1Hse"] = value; + } + } + + public string Performance_ChildGid1Zl + { + get + { + return (string)ViewState["Performance_ChildGid1Zl"]; + } + set + { + ViewState["Performance_ChildGid1Zl"] = value; + } + } + + public string Performance_ChildGid1Tz + { + get + { + return (string)ViewState["Performance_ChildGid1Tz"]; + } + set + { + ViewState["Performance_ChildGid1Tz"] = value; + } + } + + public string Performance_ChildGid1Gj + { + get + { + return (string)ViewState["Performance_ChildGid1Gj"]; + } + set + { + ViewState["Performance_ChildGid1Gj"] = value; + } + } + + public string Performance_ChildGid1Kjf + { + get + { + return (string)ViewState["Performance_ChildGid1Kjf"]; + } + set + { + ViewState["Performance_ChildGid1Kjf"] = value; + } + } + #endregion + + /// + /// 下一步 + /// + /// + /// + protected void btnNextOne_Click(object sender, EventArgs e) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + if (stepIndex == 0) + { + if (string.IsNullOrEmpty(PerformanceGid)) + { + if (string.IsNullOrEmpty(CurrUser.LoginProjectId)) + { + ShowNotify("未查询到当前项目,请刷新页面重试。", MessageBoxIcon.Warning); + return; + } + //第一步,插入主表 + Model.CQMS_Performance modelP = new Model.CQMS_Performance(); + PerformanceGid = Guid.NewGuid().ToString(); + modelP.PerformanceGid = PerformanceGid; + modelP.HeadUserid = txtHeadUserid.Text.Trim(); + if (!string.IsNullOrEmpty(txtProOutputValue.Text.Trim())) + { + modelP.ProOutputValue = Convert.ToDecimal(txtProOutputValue.Text.Trim()); + } + else { + modelP.ProOutputValue = 0; + } + + modelP.SubUserids = txtSubUserids.Text.Trim(); + modelP.SubpackageUserids = txtSubpackageUserids.Text.Trim(); + modelP.TotalScore = 0; + modelP.ProjectId = CurrUser.LoginProjectId; + modelP.CreateDateMonth = drpCompileDateMonth.Text.Trim(); + modelP.CreateDate = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + modelP.CreateMan = CreateUser; + modelP.States = "0"; + db.CQMS_Performance.InsertOnSubmit(modelP); + db.SubmitChanges(); + #region 插入子表1 + List listC1 = new List(); + Model.CQMS_Performance_Child1 modelP1 = new Model.CQMS_Performance_Child1(); + Performance_ChildGid1Sg= Guid.NewGuid().ToString(); + modelP1.Performance_ChildGid1 = Performance_ChildGid1Sg; + modelP1.PerformanceGid = PerformanceGid; + modelP1.PType = "进度、质量、费用管理综合"; + modelP1.EvaScore = 0; + modelP1.Itemize = "施工进度管理(权重40%)"; + modelP1.WorkArea = ""; + modelP1.MonthTarget = ""; + modelP1.SortIndex = 1; + modelP1.CreateMan = CreateUser; + listC1.Add(modelP1); + + modelP1 = new Model.CQMS_Performance_Child1(); + Performance_ChildGid1Hse= Guid.NewGuid().ToString(); + modelP1.Performance_ChildGid1 = Performance_ChildGid1Hse; + modelP1.PerformanceGid = PerformanceGid; + modelP1.PType = "进度、质量、费用管理综合"; + modelP1.EvaScore = 0; + modelP1.Itemize = "HSE管理(个人安全行动计划完情况)(权重15 %)"; + modelP1.WorkArea = ""; + modelP1.MonthTarget = ""; + modelP1.SortIndex = 2; + modelP1.CreateMan = CreateUser; + listC1.Add(modelP1); + + modelP1 = new Model.CQMS_Performance_Child1(); + Performance_ChildGid1Zl = Guid.NewGuid().ToString(); + modelP1.Performance_ChildGid1 = Performance_ChildGid1Zl; + modelP1.PerformanceGid = PerformanceGid; + modelP1.PType = "进度、质量、费用管理综合"; + modelP1.EvaScore = 0; + modelP1.Itemize = "质量管理情况(质量检查计划及实施)(权重20 %)"; + modelP1.WorkArea = ""; + modelP1.MonthTarget = ""; + modelP1.SortIndex = 3; + modelP1.CreateMan = CreateUser; + listC1.Add(modelP1); + + modelP1 = new Model.CQMS_Performance_Child1(); + Performance_ChildGid1Tz = Guid.NewGuid().ToString(); + modelP1.Performance_ChildGid1 = Performance_ChildGid1Tz; + modelP1.PerformanceGid = PerformanceGid; + modelP1.PType = "进度、质量、费用管理综合"; + modelP1.EvaScore = 0; + modelP1.Itemize = "图纸、材料状态跟踪;统计台账(权重5%)"; + modelP1.WorkArea = ""; + modelP1.MonthTarget = ""; + modelP1.SortIndex = 4; + modelP1.CreateMan = CreateUser; + listC1.Add(modelP1); + + modelP1 = new Model.CQMS_Performance_Child1(); + Performance_ChildGid1Gj= Guid.NewGuid().ToString(); + modelP1.Performance_ChildGid1 = Performance_ChildGid1Gj; + modelP1.PerformanceGid = PerformanceGid; + modelP1.PType = "进度、质量、费用管理综合"; + modelP1.EvaScore = 0; + modelP1.Itemize = "关键事项跟踪(权重5 %)"; + modelP1.WorkArea = ""; + modelP1.MonthTarget = ""; + modelP1.SortIndex = 5; + modelP1.CreateMan = CreateUser; + listC1.Add(modelP1); + + modelP1 = new Model.CQMS_Performance_Child1(); + Performance_ChildGid1Kjf = Guid.NewGuid().ToString(); + modelP1.Performance_ChildGid1 = Performance_ChildGid1Kjf; + modelP1.PerformanceGid = PerformanceGid; + modelP1.PType = "进度、质量、费用管理综合"; + modelP1.EvaScore = 0; + modelP1.Itemize = "可交付成果(工程签证、费用审核、方案审编、计划编制技术总结等)(权重15%)"; + modelP1.WorkArea = ""; + modelP1.MonthTarget = ""; + modelP1.SortIndex = 6; + modelP1.CreateMan = CreateUser; + listC1.Add(modelP1); + + db.CQMS_Performance_Child1.InsertAllOnSubmit(listC1); + db.SubmitChanges(); + #endregion + } + //隐藏第一步 + //显示第二步 + + SimpleForm1.Hidden = true; + SimpleForm2.Hidden = false; + SimpleForm3.Hidden = false; + SimpleForm4.Hidden = false; + SimpleForm5.Hidden = false; + SimpleForm6.Hidden = false; + SimpleForm7.Hidden = false; + stepIndex = 1; + + string[] ValidateForms = { "SimpleForm2", "SimpleForm3", "SimpleForm4", "SimpleForm5", "SimpleForm6", "SimpleForm7" }; + Button2.ValidateForms = ValidateForms; + } + else if (stepIndex==1) + { + #region 判断参数 + if (string.IsNullOrEmpty(txtWorkArea.Text)) + { + Alert.ShowInTop("施工进度管理-施工区域不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(txtMonthTarget1.Text)) + { + Alert.ShowInTop("施工进度管理-月节点目标不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(txtMonthTarget2.Text)) + { + Alert.ShowInTop("HSE管理-月节点目标不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(txtMonthTarget3.Text)) + { + Alert.ShowInTop("质量管理情况-月节点目标不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(txtMonthTarget4.Text)) + { + Alert.ShowInTop("图纸、材料状态跟踪;统计台账-月节点目标不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(txtMonthTarget5.Text)) + { + Alert.ShowInTop("关键事项跟踪-月节点目标不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(txtMonthTarget6.Text)) + { + Alert.ShowInTop("可交付成果-月节点目标不能为空。", MessageBoxIcon.Warning); + return; + } + #endregion + + #region 修改子表1的数据(施工区域和各个月节点目标) + //首先根据主表id获取到信息 + var Child1List = db.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).OrderBy(x => x.SortIndex).ToList(); + //施工进度管理 + var modelC0 = Child1List[0]; + //施工区域 + modelC0.WorkArea = txtWorkArea.Text.Trim(); + modelC0.MonthTarget = txtMonthTarget1.Text.Trim(); + //修改 + db.SubmitChanges(); + + //HSE管理 + var modelC1 = Child1List[1]; + modelC1.MonthTarget = txtMonthTarget2.Text.Trim(); + db.SubmitChanges(); + + //质量管理情况 + var modelC2 = Child1List[2]; + modelC2.MonthTarget = txtMonthTarget3.Text.Trim(); + db.SubmitChanges(); + + //施工进度管理 + var modelC3 = Child1List[3]; + modelC3.MonthTarget = txtMonthTarget4.Text.Trim(); + db.SubmitChanges(); + + //施工进度管理 + var modelC4 = Child1List[4]; + modelC4.MonthTarget = txtMonthTarget5.Text.Trim(); + db.SubmitChanges(); + + //施工进度管理 + var modelC5 = Child1List[5]; + modelC5.MonthTarget = txtMonthTarget6.Text.Trim(); + db.SubmitChanges(); + #endregion + + //下一步生成每一周的任务安排、工程量、人材机资源需求计划 + //隐藏生成施工区域/工序、月节点目标 + #region 隐藏生成施工区域/工序、月节点目标 + 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 + + stepIndex = 2; + Button2.Text = "生成"; + string[] ValidateForms = { "pForm1", "Form2", "Form3", "Form4", "Form5", "Form6" }; + Button2.ValidateForms = ValidateForms; + + } + else if (stepIndex==2) + { + + #region 参数 + 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 TaskContent3 = txtTaskContent3.Text.Trim(); + var ProjectQuantity3 = txtProjectQuantity3.Text.Trim(); + var DemandPlan3 = txtDemandPlan3.Text.Trim(); + + var TaskContentHse = txtTaskContentHse.Text.Trim(); + + var TaskContentZl = txtTaskContentZl.Text.Trim(); + + var TaskContentTz = txtTaskContentTz.Text.Trim(); + + var TaskContentGjsx = txtTaskContentGjsx.Text.Trim(); + + var TaskContentJf = txtTaskContentJf.Text.Trim(); + #endregion + #region 判断参数 + if (string.IsNullOrEmpty(TaskContent1)) + { + Alert.ShowInTop("施工进度管理-各周工作任务安排不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(TaskContentHse)) + { + Alert.ShowInTop("HSE管理-各周工作任务安排不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(TaskContentZl)) + { + Alert.ShowInTop("质量管理情况-各周工作任务安排不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(TaskContentTz)) + { + Alert.ShowInTop("图纸、材料状态跟踪;统计台账-各周工作任务安排不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(TaskContentGjsx)) + { + Alert.ShowInTop("关键事项跟踪-各周工作任务安排不能为空。", MessageBoxIcon.Warning); + return; + } + if (string.IsNullOrEmpty(TaskContentJf)) + { + Alert.ShowInTop("可交付成果-各周工作任务安排不能为空。", MessageBoxIcon.Warning); + return; + } + #endregion + var datesConfig = Convert.ToDateTime(drpCompileDateMonth.Text.Trim()); + var Month = 1; + if (datesConfig.Month != 12) + { + Month = datesConfig.Month+ 1; + } + + var Child2SortIndex = 1; + //按照日期查询是否有设置 + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == datesConfig.Year.ToString() && x.SortIndex == Month); + if (modelConfig!=null) + { + //根据设置的周数插入表格CQMS_Performance_Child2 + List listChild2 = new List(); + 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); + + 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); + + 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); + } + #endregion + //HSE管理 + modelChild2 = new Model.CQMS_Performance_Child2(); + modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString(); + modelChild2.Performance_ChildGid1 = Performance_ChildGid1Hse; + modelChild2.PerformanceGid = PerformanceGid; + modelChild2.TaskContent = TaskContentHse; + modelChild2.ProjectQuantity = TaskContentHse; + modelChild2.DemandPlan = TaskContentHse; + modelChild2.NowWeek = (i + 1); + Child2SortIndex += 1; + modelChild2.SortIndex = Child2SortIndex; + modelChild2.CreateMan = CreateUser; + listChild2.Add(modelChild2); + //质量管理情况 + modelChild2 = new Model.CQMS_Performance_Child2(); + modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString(); + modelChild2.Performance_ChildGid1 = Performance_ChildGid1Zl; + modelChild2.PerformanceGid = PerformanceGid; + modelChild2.TaskContent = TaskContentZl; + modelChild2.ProjectQuantity = TaskContentZl; + modelChild2.DemandPlan = TaskContentZl; + modelChild2.NowWeek = (i + 1); + Child2SortIndex += 1; + modelChild2.SortIndex = Child2SortIndex; + modelChild2.CreateMan = CreateUser; + listChild2.Add(modelChild2); + //图纸、材料状态跟踪 + modelChild2 = new Model.CQMS_Performance_Child2(); + modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString(); + modelChild2.Performance_ChildGid1 = Performance_ChildGid1Tz; + modelChild2.PerformanceGid = PerformanceGid; + modelChild2.TaskContent = TaskContentTz; + modelChild2.ProjectQuantity = TaskContentTz; + modelChild2.DemandPlan = TaskContentTz; + modelChild2.NowWeek = (i + 1); + Child2SortIndex += 1; + modelChild2.SortIndex = Child2SortIndex; + modelChild2.CreateMan = CreateUser; + listChild2.Add(modelChild2); + //关键事项跟踪 + modelChild2 = new Model.CQMS_Performance_Child2(); + modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString(); + modelChild2.Performance_ChildGid1 = Performance_ChildGid1Gj; + modelChild2.PerformanceGid = PerformanceGid; + modelChild2.TaskContent = TaskContentGjsx; + modelChild2.ProjectQuantity = TaskContentGjsx; + modelChild2.DemandPlan = TaskContentGjsx; + modelChild2.NowWeek = (i + 1); + Child2SortIndex += 1; + modelChild2.SortIndex = Child2SortIndex; + modelChild2.CreateMan = CreateUser; + listChild2.Add(modelChild2); + //可交付成果 + modelChild2 = new Model.CQMS_Performance_Child2(); + modelChild2.Performance_ChildGid2 = Guid.NewGuid().ToString(); + modelChild2.Performance_ChildGid1 = Performance_ChildGid1Kjf; + modelChild2.PerformanceGid = PerformanceGid; + modelChild2.TaskContent = TaskContentJf; + modelChild2.ProjectQuantity = TaskContentJf; + modelChild2.DemandPlan = TaskContentJf; + modelChild2.NowWeek = (i + 1); + Child2SortIndex += 1; + modelChild2.SortIndex = Child2SortIndex; + modelChild2.CreateMan = CreateUser; + listChild2.Add(modelChild2); + + Child2SortIndex = 1; + } + db.CQMS_Performance_Child2.InsertAllOnSubmit(listChild2); + db.SubmitChanges(); + //根据CQMS_Performance_Child2的周数,循环插入CQMS_Performance_Child3 + + //开始日期 + var StartDate = Convert.ToDateTime(modelConfig.SetUpStartDate).AddDays(-1); + var EndDate = Convert.ToDateTime(modelConfig.SetUpEndDate); + + //循环CQMS_Performance_Child2 + //按周排序 第一次循环1、2、3、4等等 + listChild2 = listChild2.OrderBy(x => x.NowWeek).ToList(); + List listChild3 = new List(); + + //循环递增的天数 + #region 递增天数值 + //第一周最后的天数 + var OneWeekDate = Convert.ToDateTime(modelConfig.SetUpStartDate); + //第二周最后的天数 + var OneWeekDate1 = Convert.ToDateTime(modelConfig.SetUpStartDate); + //第三周最后的天数 + var OneWeekDate2 = Convert.ToDateTime(modelConfig.SetUpStartDate); + //第四周最后的天数 + var OneWeekDate3 = Convert.ToDateTime(modelConfig.SetUpStartDate); + #endregion + + + foreach (var item in listChild2) + { + Model.CQMS_Performance_Child3 modelChild3 = new Model.CQMS_Performance_Child3(); + //如果是最后一周 + if (item.NowWeek == modelConfig.SetUpWeek) + { + //最后一周的前一周 + if (item.NowWeek == 4) + { + OneWeekDate2 = OneWeekDate1; + for (var i = OneWeekDate2.AddDays(1); i <=EndDate; i=i.AddDays(1)) + { + modelChild3 = new Model.CQMS_Performance_Child3(); + StartDate = i; + modelChild3.Performance_ChildGid3 = Guid.NewGuid().ToString(); + modelChild3.Performance_ChildGid2 = item.Performance_ChildGid2; + modelChild3.PerformanceGid = PerformanceGid; + modelChild3.WorkPlan = ""; + modelChild3.CompletStatus = ""; + modelChild3.CurrentDate = StartDate; + modelChild3.CreateMan = CreateUser; + modelChild3.ProjectId = CreateProject; + listChild3.Add(modelChild3); + } + } + else if (item.NowWeek == 5) + { + OneWeekDate3 = OneWeekDate2; + for (var i = OneWeekDate3.AddDays(1); i <= EndDate; i = i.AddDays(1)) + { + modelChild3 = new Model.CQMS_Performance_Child3(); + StartDate = i; + modelChild3.Performance_ChildGid3 = Guid.NewGuid().ToString(); + modelChild3.Performance_ChildGid2 = item.Performance_ChildGid2; + modelChild3.PerformanceGid = PerformanceGid; + modelChild3.WorkPlan = ""; + modelChild3.CompletStatus = ""; + modelChild3.CurrentDate = StartDate; + modelChild3.CreateMan = CreateUser; + modelChild3.ProjectId = CreateProject; + listChild3.Add(modelChild3); + } + } + + } + else { + switch (item.NowWeek) + { + case 1: + #region 第一周如果是星期五、六、天。到下个星期天 + //循环的天数 + var Xhi = 1; + switch (OneWeekDate.DayOfWeek) + { + //星期天 + case DayOfWeek.Sunday: + Xhi = 8; + break; + //星期一 + case DayOfWeek.Monday: + Xhi = 7; + break; + //星期二 + case DayOfWeek.Tuesday: + Xhi = 6; + break; + //星期三 + case DayOfWeek.Wednesday: + Xhi = 5; + break; + //星期四 + case DayOfWeek.Thursday: + Xhi = 4; + break; + //星期五 + case DayOfWeek.Friday: + Xhi = 10; + break; + //星期六 + case DayOfWeek.Saturday: + Xhi = 9; + break; + + } + #endregion + StartDate = Convert.ToDateTime(modelConfig.SetUpStartDate).AddDays(-1); + //第一周的数据 + for (int i = 0; i < Xhi; i++) + { + StartDate = StartDate.AddDays(1); + modelChild3 = new Model.CQMS_Performance_Child3(); + modelChild3.Performance_ChildGid3 = Guid.NewGuid().ToString(); + modelChild3.Performance_ChildGid2 = item.Performance_ChildGid2; + modelChild3.PerformanceGid = PerformanceGid; + modelChild3.WorkPlan = ""; + modelChild3.CompletStatus = ""; + modelChild3.CurrentDate = StartDate; + modelChild3.CreateMan = CreateUser; + modelChild3.ProjectId = CreateProject; + listChild3.Add(modelChild3); + } + OneWeekDate = StartDate; + break; + case 2: + OneWeekDate = StartDate; + //第2周的数据 + for (int i = 0; i < 7; i++) + { + //第一周最后的日期 + OneWeekDate = OneWeekDate.AddDays(1); + + modelChild3 = new Model.CQMS_Performance_Child3(); + modelChild3.Performance_ChildGid3 = Guid.NewGuid().ToString(); + modelChild3.Performance_ChildGid2 = item.Performance_ChildGid2; + modelChild3.PerformanceGid = PerformanceGid; + modelChild3.WorkPlan = ""; + modelChild3.CompletStatus = ""; + modelChild3.CurrentDate = OneWeekDate; + modelChild3.CreateMan = CreateUser; + modelChild3.ProjectId = CreateProject; + listChild3.Add(modelChild3); + } + OneWeekDate1 = OneWeekDate; + break; + case 3: + OneWeekDate1 = OneWeekDate; + //第3周的数据 + for (int i = 0; i < 7; i++) + { + modelChild3 = new Model.CQMS_Performance_Child3(); + OneWeekDate1 = OneWeekDate1.AddDays(1); + modelChild3.Performance_ChildGid3 = Guid.NewGuid().ToString(); + modelChild3.Performance_ChildGid2 = item.Performance_ChildGid2; + modelChild3.PerformanceGid = PerformanceGid; + modelChild3.WorkPlan = ""; + modelChild3.CompletStatus = ""; + modelChild3.CurrentDate = OneWeekDate1; + modelChild3.CreateMan = CreateUser; + modelChild3.ProjectId = CreateProject; + listChild3.Add(modelChild3); + } + OneWeekDate2 = OneWeekDate1; + break; + case 4: + OneWeekDate2 = OneWeekDate1; + //第4周的数据 + for (int i = 0; i < 7; i++) + { + modelChild3 = new Model.CQMS_Performance_Child3(); + OneWeekDate2 = OneWeekDate2.AddDays(1); + modelChild3.Performance_ChildGid3 = Guid.NewGuid().ToString(); + modelChild3.Performance_ChildGid2 = item.Performance_ChildGid2; + modelChild3.PerformanceGid = PerformanceGid; + modelChild3.WorkPlan = ""; + modelChild3.CompletStatus = ""; + modelChild3.CurrentDate = OneWeekDate2; + modelChild3.CreateMan = CreateUser; + modelChild3.ProjectId = CreateProject; + listChild3.Add(modelChild3); + } + OneWeekDate3 = OneWeekDate2; + break; + } + + } + + + } + db.CQMS_Performance_Child3.InsertAllOnSubmit(listChild3); + db.SubmitChanges(); + //添加完成 + ViewState["CompileDateMonth"] = drpCompileDateMonth.Text.Trim(); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + } + } + + } + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx.designer.cs new file mode 100644 index 00000000..234747ca --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/PerformanceEdit.aspx.designer.cs @@ -0,0 +1,422 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class PerformanceEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpCompileDateMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker drpCompileDateMonth; + + /// + /// txtHeadUserid 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtHeadUserid; + + /// + /// txtProOutputValue 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtProOutputValue; + + /// + /// txtSubUserids 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSubUserids; + + /// + /// txtSubpackageUserids 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSubpackageUserids; + + /// + /// SimpleForm2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm2; + + /// + /// txtWorkArea 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkArea; + + /// + /// txtMonthTarget1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget1; + + /// + /// SimpleForm3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm3; + + /// + /// txtMonthTarget2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget2; + + /// + /// SimpleForm4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm4; + + /// + /// txtMonthTarget3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget3; + + /// + /// SimpleForm5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm5; + + /// + /// txtMonthTarget4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget4; + + /// + /// SimpleForm6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm6; + + /// + /// txtMonthTarget5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget5; + + /// + /// SimpleForm7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm7; + + /// + /// txtMonthTarget6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMonthTarget6; + + /// + /// pForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form pForm1; + + /// + /// txtTaskContent1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContent1; + + /// + /// txtProjectQuantity1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectQuantity1; + + /// + /// txtDemandPlan1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDemandPlan1; + + /// + /// txtTaskContent2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContent2; + + /// + /// txtProjectQuantity2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectQuantity2; + + /// + /// txtDemandPlan2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDemandPlan2; + + /// + /// txtTaskContent3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContent3; + + /// + /// txtProjectQuantity3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectQuantity3; + + /// + /// txtDemandPlan3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDemandPlan3; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtTaskContentHse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentHse; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtTaskContentZl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentZl; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtTaskContentTz 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentTz; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtTaskContentGjsx 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentGjsx; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtTaskContentJf 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentJf; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx new file mode 100644 index 00000000..17e7a4b0 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx @@ -0,0 +1,106 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScoreEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.ScoreEdit" %> + + + + + + + 打分 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx.cs new file mode 100644 index 00000000..0c23b6a3 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx.cs @@ -0,0 +1,83 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class ScoreEdit : PageBase + { + //主键 + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //主键 + PerformanceGid = Request.Params["PerformanceGid"]; + //根据主键加载CQMS_Performance_Child1 + var child1List = Funs.DB.CQMS_Performance_Child1.Where(x => x.PerformanceGid == PerformanceGid).OrderBy(x => x.SortIndex).ToList(); + if (child1List.Count > 0) + { + txtScore1.Text = child1List[0].EvaScore.ToString(); + txtScore2.Text = child1List[1].EvaScore.ToString(); + txtScore3.Text = child1List[2].EvaScore.ToString(); + txtScore4.Text = child1List[3].EvaScore.ToString(); + txtScore5.Text = child1List[4].EvaScore.ToString(); + txtScore6.Text = child1List[5].EvaScore.ToString(); + } + else + { + ShowNotify("未查询到月节点目标数据,请重新生成。", MessageBoxIcon.Warning); + return; + } + } + } + + /// + /// 确认修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var child2Model1 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 1); + child2Model1.EvaScore =Convert.ToDecimal(txtScore1.Text.Trim()); + db.SubmitChanges(); + var child2Model2 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 2); + child2Model2.EvaScore = Convert.ToDecimal(txtScore2.Text.Trim()); + db.SubmitChanges(); + var child2Model3 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 3); + child2Model3.EvaScore = Convert.ToDecimal(txtScore3.Text.Trim()); + db.SubmitChanges(); + var child2Model4 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 4); + child2Model4.EvaScore = Convert.ToDecimal(txtScore4.Text.Trim()); + db.SubmitChanges(); + var child2Model5 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 5); + child2Model5.EvaScore = Convert.ToDecimal(txtScore5.Text.Trim()); + db.SubmitChanges(); + var child2Model6 = db.CQMS_Performance_Child1.FirstOrDefault(x => x.PerformanceGid == PerformanceGid && x.SortIndex == 6); + child2Model6.EvaScore = Convert.ToDecimal(txtScore6.Text.Trim()); + db.SubmitChanges(); + + ShowNotify("保存成功。", MessageBoxIcon.Success); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx.designer.cs new file mode 100644 index 00000000..26121592 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/ScoreEdit.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class ScoreEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// SimpleForm2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm2; + + /// + /// txtScore1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtScore1; + + /// + /// SimpleForm3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm3; + + /// + /// txtScore2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtScore2; + + /// + /// SimpleForm4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm4; + + /// + /// txtScore3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtScore3; + + /// + /// SimpleForm5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm5; + + /// + /// txtScore4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtScore4; + + /// + /// SimpleForm6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm6; + + /// + /// txtScore5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtScore5; + + /// + /// SimpleForm7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm7; + + /// + /// txtScore6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtScore6; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx new file mode 100644 index 00000000..634c6be9 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx @@ -0,0 +1,155 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TaskContentEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.TaskContentEdit" %> + + + + + + + 修改各周工作任务 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx.cs new file mode 100644 index 00000000..69fe5664 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx.cs @@ -0,0 +1,278 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class TaskContentEdit : PageBase + { + //主键 + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + public string CreateDateMonth + { + get + { + return (string)ViewState["CreateDateMonth"]; + } + set + { + ViewState["CreateDateMonth"] = value; + } + } + + #region CustomClass + + public class CustomClass + { + private string _id; + + public string ID + { + get { return _id; } + set { _id = value; } + } + private string _name; + + public string Name + { + get { return _name; } + set { _name = value; } + } + + public CustomClass(string id, string name) + { + _id = id; + _name = name; + } + } + #endregion + /// + /// 页面加载 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + //主键 + PerformanceGid = Request.Params["PerformanceGid"]; + CreateDateMonth = Request.Params["CreateDateMonth"]; + //根据主键获取周 + var CreateDateWeek = db.CQMS_Performance.FirstOrDefault(x => x.PerformanceGid == PerformanceGid).CreateDateMonth; + + var datesConfig = Convert.ToDateTime(CreateDateMonth); + var Month = 1; + if (datesConfig.Month != 12) + { + Month = datesConfig.Month + 1; + } + //按照日期查询是否有设置 + var modelConfig = Funs.DB.CQMS_Performance_SetUp.FirstOrDefault(x => x.CreateYear == datesConfig.Year.ToString() && x.SortIndex == Month); + List myList = new List(); + myList.Add(new CustomClass("1", "第一周")); + myList.Add(new CustomClass("2", "第二周")); + myList.Add(new CustomClass("3", "第三周")); + myList.Add(new CustomClass("4", "第四周")); + if (modelConfig.SetUpWeek == 5) + { + myList.Add(new CustomClass("5", "第五周")); + } + ddlNowWeek.DataTextField = "Name"; + ddlNowWeek.DataValueField = "ID"; + ddlNowWeek.DataSource = myList; + ddlNowWeek.DataBind(); + + //加载数据 + BindText(); + + } + } + } + + /// + /// 根据周加载数据 + /// + private void BindText() { + //默认加载第一周的各项数据,倒序 + var child2List = Funs.DB.CQMS_Performance_Child2.Where(x => x.PerformanceGid == PerformanceGid && x.NowWeek == Convert.ToInt32(ddlNowWeek.SelectedValue)).OrderByDescending(x => x.SortIndex).ToList(); + if (child2List.Count > 0) + { + txtTaskContentJf.Text = child2List[0].TaskContent; + txtTaskContentGjsx.Text = child2List[1].TaskContent; + txtTaskContentTz.Text = child2List[2].TaskContent; + txtTaskContentZl.Text = child2List[3].TaskContent; + txtTaskContentHse.Text = child2List[4].TaskContent; + + //如果数量是6 就按顺序来,7 8 则是多2条数据 + if (child2List.Count == 6) + { + txtTaskContent1.Text = child2List[5].TaskContent; + txtProjectQuantity1.Text = child2List[5].ProjectQuantity; + txtDemandPlan1.Text = child2List[5].DemandPlan; + fr1.Hidden = true; + fr2.Hidden = true; + } + else if (child2List.Count == 7) + { + txtTaskContent2.Text = child2List[5].TaskContent; + txtProjectQuantity2.Text = child2List[5].ProjectQuantity; + txtDemandPlan2.Text = child2List[5].DemandPlan; + + txtTaskContent1.Text = child2List[6].TaskContent; + txtProjectQuantity1.Text = child2List[6].ProjectQuantity; + txtDemandPlan1.Text = child2List[6].DemandPlan; + fr2.Hidden = true; + } + else if (child2List.Count == 8) + { + + txtTaskContent3.Text = child2List[5].TaskContent; + txtProjectQuantity3.Text = child2List[5].ProjectQuantity; + txtDemandPlan3.Text = child2List[5].DemandPlan; + + txtTaskContent2.Text = child2List[6].TaskContent; + txtProjectQuantity2.Text = child2List[6].ProjectQuantity; + txtDemandPlan2.Text = child2List[6].DemandPlan; + + txtTaskContent1.Text = child2List[7].TaskContent; + txtProjectQuantity1.Text = child2List[7].ProjectQuantity; + txtDemandPlan1.Text = child2List[7].DemandPlan; + } + } + else + { + ShowNotify("未查询到月节点目标数据,请重新生成。", MessageBoxIcon.Warning); + return; + } + } + + /// + /// 根据周更改数据 + /// + /// + /// + protected void OnddlNowWeekChanged(object sender, EventArgs e) { + BindText(); + } + + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + //依次修改各周任务安排 + #region 参数 + 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 TaskContent3 = txtTaskContent3.Text.Trim(); + var ProjectQuantity3 = txtProjectQuantity3.Text.Trim(); + var DemandPlan3 = txtDemandPlan3.Text.Trim(); + + var TaskContentHse = txtTaskContentHse.Text.Trim(); + + var TaskContentZl = txtTaskContentZl.Text.Trim(); + + var TaskContentTz = txtTaskContentTz.Text.Trim(); + + var TaskContentGjsx = txtTaskContentGjsx.Text.Trim(); + + var TaskContentJf = txtTaskContentJf.Text.Trim(); + #endregion + + var child2List = db.CQMS_Performance_Child2.Where(x => x.NowWeek == Convert.ToInt32(ddlNowWeek.SelectedValue) && x.PerformanceGid == PerformanceGid). + OrderByDescending(x => x.SortIndex).ToList(); + + var child2Model = child2List[0]; + child2Model.TaskContent = TaskContentJf; + db.SubmitChanges(); + + child2Model= child2List[1]; + child2Model.TaskContent = TaskContentGjsx; + db.SubmitChanges(); + + child2Model = child2List[2]; + child2Model.TaskContent = TaskContentTz; + db.SubmitChanges(); + + child2Model = child2List[3]; + child2Model.TaskContent = TaskContentZl; + db.SubmitChanges(); + + child2Model = child2List[4]; + child2Model.TaskContent = TaskContentHse; + db.SubmitChanges(); + + if (child2List.Count == 8) + { + child2Model = child2List[5]; + child2Model.TaskContent = TaskContent3; + child2Model.ProjectQuantity = ProjectQuantity3; + child2Model.DemandPlan = DemandPlan3; + db.SubmitChanges(); + + child2Model = child2List[6]; + child2Model.TaskContent = TaskContent2; + child2Model.ProjectQuantity = ProjectQuantity2; + child2Model.DemandPlan = DemandPlan2; + db.SubmitChanges(); + + child2Model = child2List[7]; + child2Model.TaskContent = TaskContent1; + child2Model.ProjectQuantity = ProjectQuantity1; + child2Model.DemandPlan = DemandPlan1; + db.SubmitChanges(); + } + else if (child2List.Count==7) + { + child2Model = child2List[5]; + child2Model.TaskContent = TaskContent2; + child2Model.ProjectQuantity = ProjectQuantity2; + child2Model.DemandPlan = DemandPlan2; + db.SubmitChanges(); + + child2Model = child2List[6]; + child2Model.TaskContent = TaskContent1; + child2Model.ProjectQuantity = ProjectQuantity1; + child2Model.DemandPlan = DemandPlan1; + db.SubmitChanges(); + } + else if (child2List.Count==6) + { + child2Model = child2List[5]; + child2Model.TaskContent = TaskContent1; + child2Model.ProjectQuantity = ProjectQuantity1; + child2Model.DemandPlan = DemandPlan1; + db.SubmitChanges(); + } + ShowNotify("修改成功。", MessageBoxIcon.Success); + } + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx.designer.cs new file mode 100644 index 00000000..07691330 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/TaskContentEdit.aspx.designer.cs @@ -0,0 +1,269 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class TaskContentEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// ddlNowWeek 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlNowWeek; + + /// + /// pForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form pForm1; + + /// + /// txtTaskContent1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContent1; + + /// + /// txtProjectQuantity1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectQuantity1; + + /// + /// txtDemandPlan1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDemandPlan1; + + /// + /// fr1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow fr1; + + /// + /// txtTaskContent2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContent2; + + /// + /// txtProjectQuantity2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectQuantity2; + + /// + /// txtDemandPlan2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDemandPlan2; + + /// + /// fr2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow fr2; + + /// + /// txtTaskContent3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContent3; + + /// + /// txtProjectQuantity3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectQuantity3; + + /// + /// txtDemandPlan3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDemandPlan3; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtTaskContentHse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentHse; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// txtTaskContentZl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentZl; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtTaskContentTz 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentTz; + + /// + /// Form5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form5; + + /// + /// txtTaskContentGjsx 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentGjsx; + + /// + /// Form6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form6; + + /// + /// txtTaskContentJf 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskContentJf; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx new file mode 100644 index 00000000..5bb099af --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx @@ -0,0 +1,225 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkPlanEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Performance.WorkPlanEdit" %> + + + + + + + 每日工作计划 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + <%-- + + + --%> + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx.cs new file mode 100644 index 00000000..b597a731 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx.cs @@ -0,0 +1,347 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Performance +{ + public partial class WorkPlanEdit : PageBase + { + //主键 + public string PerformanceGid + { + get + { + return (string)ViewState["PerformanceGid"]; + } + set + { + ViewState["PerformanceGid"] = value; + } + } + + public string CreateDateMonth + { + get + { + return (string)ViewState["CreateDateMonth"]; + } + set + { + ViewState["CreateDateMonth"] = value; + } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + CreateDateMonth = Request.Params["CreateDateMonth"]; + var ObjMoneth = Convert.ToDateTime(CreateDateMonth.ToString()).Year + "-" + Convert.ToDateTime(CreateDateMonth.ToString()).Month; + //如果是当前的月份 那就显示当前 + var NowMoneth = DateTime.Now.Year + "-" + DateTime.Now.Month; + if (ObjMoneth == NowMoneth) + { + dpCurrentDate.Text = Convert.ToDateTime(DateTime.Now.ToString()).Date.ToString(); + } + else { + dpCurrentDate.Text = Convert.ToDateTime(CreateDateMonth.ToString()).Date.ToString(); + } + + PerformanceGid = Request.Params["PerformanceGid"]; + BindText(); + + } + } + + /// + /// 绑定数据 + /// + private void BindText() + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + //根据当前日期 和主键id获取当前是第几周 + var TodayDate = Convert.ToDateTime(dpCurrentDate.Text).Date; + var childModel3 = db.CQMS_Performance_Child3.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + if (childModel3 == null) + { + ShowNotify("未查询到数据,请重新先生成表单。", MessageBoxIcon.Warning); + return; + } + var Performance_ChildGid2 = childModel3.Performance_ChildGid2; + var NowWeek = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.Performance_ChildGid2 == Performance_ChildGid2).NowWeek; + //加载数据。 + //判断施工管理工作任务安排有几个 + var child2List = Funs.DB.CQMS_Performance_Child2.Where(x => x.PerformanceGid == PerformanceGid && x.NowWeek + == NowWeek).OrderBy(x => x.SortIndex).ToList(); + + var objModel = db.CQMS_Performance_Child3.Where(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + if (child2List.Count == 6) + { + this.SimpleForm2.Title = "1、施工进度管理(本周任务安排:" + child2List[0].TaskContent + ")"; + this.SimpleForm3.Title = "2、HSE管理(本周任务安排:" + child2List[1].TaskContent + ")"; + this.SimpleForm4.Title = "3、质量管理情况(本周任务安排:" + child2List[2].TaskContent + ")"; + this.SimpleForm5.Title = "4、图纸、材料状态跟踪(本周任务安排:" + child2List[3].TaskContent + ")"; + this.SimpleForm6.Title = "5、关键事项跟踪(本周任务安排:" + child2List[4].TaskContent + ")"; + this.SimpleForm7.Title = "6、可交付成果(本周任务安排:" + child2List[5].TaskContent + ")"; + + this.txtWorkPlan1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2).WorkPlan; + this.txtCompletStatus1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2).CompletStatus; + + this.txtWorkPlan2.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan3.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan4.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[3].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan5.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[4].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan6.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2).WorkPlan; + + this.txtTaskCompletContent1.Text = child2List[0].TaskCompletContent; + this.txtTaskCompletContent4.Text = child2List[1].TaskCompletContent; + this.txtTaskCompletContent5.Text = child2List[2].TaskCompletContent; + this.txtTaskCompletContent6.Text = child2List[3].TaskCompletContent; + this.txtTaskCompletContent7.Text = child2List[4].TaskCompletContent; + this.txtTaskCompletContent8.Text = child2List[5].TaskCompletContent; + //txtCompletStatus2.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2).CompletStatus; + //txtCompletStatus3.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2).CompletStatus; + //txtCompletStatus4.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[3].Performance_ChildGid2).CompletStatus; + //txtCompletStatus5.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[4].Performance_ChildGid2).CompletStatus; + //txtCompletStatus6.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2).CompletStatus; + } + else if (child2List.Count == 7) + { + this.Form2.Hidden = false; + this.SimpleForm2.Title = "1、施工进度管理(本周任务安排:" + child2List[0].TaskContent + ")"; + this.Form2.Title = "2、施工进度管理(本周任务安排:" + child2List[1].TaskContent + ")"; + this.SimpleForm3.Title = "3、HSE管理(本周任务安排:" + child2List[2].TaskContent + ")"; + this.SimpleForm4.Title = "4、质量管理情况(本周任务安排:" + child2List[3].TaskContent + ")"; + this.SimpleForm5.Title = "5、图纸、材料状态跟踪(本周任务安排:" + child2List[4].TaskContent + ")"; + this.SimpleForm6.Title = "6、关键事项跟踪(本周任务安排:" + child2List[5].TaskContent + ")"; + this.SimpleForm7.Title = "7、可交付成果(本周任务安排:" + child2List[6].TaskContent + ")"; + + this.txtWorkPlan1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2).WorkPlan; + this.txtCompletStatus1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2).CompletStatus; + + this.TextBox1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2).WorkPlan; + this.TextBox2.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2).CompletStatus; + + this.txtWorkPlan2.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan3.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[3].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan4.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[4].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan5.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan6.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[6].Performance_ChildGid2).WorkPlan; + + this.txtTaskCompletContent1.Text = child2List[0].TaskCompletContent; + this.txtTaskCompletContent2.Text = child2List[1].TaskCompletContent; + this.txtTaskCompletContent4.Text = child2List[2].TaskCompletContent; + this.txtTaskCompletContent5.Text = child2List[3].TaskCompletContent; + this.txtTaskCompletContent6.Text = child2List[4].TaskCompletContent; + this.txtTaskCompletContent7.Text = child2List[5].TaskCompletContent; + this.txtTaskCompletContent8.Text = child2List[6].TaskCompletContent; + } + else if (child2List.Count == 8) + { + this.Form2.Hidden = false; + this.Form3.Hidden = false; + this.SimpleForm2.Title = "1、施工进度管理(本周任务安排:" + child2List[0].TaskContent + ")"; + this.Form2.Title = "2、施工进度管理(本周任务安排:" + child2List[1].TaskContent + ")"; + this.Form3.Title = "3、施工进度管理(本周任务安排:" + child2List[2].TaskContent + ")"; + this.SimpleForm3.Title = "4、HSE管理(本周任务安排:" + child2List[3].TaskContent + ")"; + this.SimpleForm4.Title = "5、质量管理情况(本周任务安排:" + child2List[4].TaskContent + ")"; + this.SimpleForm5.Title = "6、图纸、材料状态跟踪(本周任务安排:" + child2List[5].TaskContent + ")"; + this.SimpleForm6.Title = "7、关键事项跟踪(本周任务安排:" + child2List[6].TaskContent + ")"; + this.SimpleForm7.Title = "8、可交付成果(本周任务安排:" + child2List[7].TaskContent + ")"; + + this.txtWorkPlan1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2).WorkPlan; + this.txtCompletStatus1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2).CompletStatus; + + this.TextBox1.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2).WorkPlan; + this.TextBox2.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2).CompletStatus; + + this.TextBox3.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2).WorkPlan; + this.TextBox4.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2).CompletStatus; + + this.txtWorkPlan2.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[3].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan3.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[4].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan4.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan5.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[6].Performance_ChildGid2).WorkPlan; + this.txtWorkPlan6.Text = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[7].Performance_ChildGid2).WorkPlan; + + this.txtTaskCompletContent1.Text = child2List[0].TaskCompletContent; + this.txtTaskCompletContent2.Text = child2List[1].TaskCompletContent; + this.txtTaskCompletContent3.Text = child2List[2].TaskCompletContent; + this.txtTaskCompletContent4.Text = child2List[3].TaskCompletContent; + this.txtTaskCompletContent5.Text = child2List[4].TaskCompletContent; + this.txtTaskCompletContent6.Text = child2List[5].TaskCompletContent; + this.txtTaskCompletContent7.Text = child2List[6].TaskCompletContent; + this.txtTaskCompletContent8.Text = child2List[7].TaskCompletContent; + + + } + } + } + + protected void DatePicker1_TextChanged(object sender, EventArgs e) + { + BindText(); + } + + /// + /// 确认操作 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + + this.SubmitWorkPlan(); + + } + + private void SubmitWorkPlan() { + var a = this.txtTaskCompletContent8.Text.Trim(); + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + //根据当前日期 和主键id获取当前是第几周 + var TodayDate = Convert.ToDateTime(dpCurrentDate.Text).Date; + var childModel3 = db.CQMS_Performance_Child3.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + if (childModel3 == null) + { + ShowNotify("未查询到数据,请重新先生成表单。", MessageBoxIcon.Warning); + return; + } + var Performance_ChildGid2 = childModel3.Performance_ChildGid2; + var NowWeek = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.Performance_ChildGid2 == Performance_ChildGid2).NowWeek; + //加载数据。 + //判断施工管理工作任务安排有几个(倒序) + var child2List = Funs.DB.CQMS_Performance_Child2.Where(x => x.PerformanceGid == PerformanceGid && x.NowWeek + == NowWeek).OrderByDescending(x => x.SortIndex).ToList(); + + var objModel = db.CQMS_Performance_Child3.Where(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + + if (child2List != null) + { + + + //可交付成果 + var Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan6.Text; + db.SubmitChanges(); + + //周计划 + Model.CQMS_Performance_Child2 Child4Model = child2List[0]; + var test = this.txtTaskCompletContent8.Text.Trim(); + Child4Model.TaskCompletContent = this.txtTaskCompletContent8.Text.Trim(); + PerformanceService.UpdateChild2(Child4Model); + + //关键事项跟踪 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan5.Text; + db.SubmitChanges(); + + Child4Model = child2List[1]; + Child4Model.TaskCompletContent = txtTaskCompletContent7.Text; + PerformanceService.UpdateChild2(Child4Model); + + //图纸、材料状态跟踪;统计台账 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan4.Text; + db.SubmitChanges(); + + Child4Model = child2List[2]; + Child4Model.TaskCompletContent = txtTaskCompletContent6.Text; + PerformanceService.UpdateChild2(Child4Model); + + //质量管理情况 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[3].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan3.Text; + db.SubmitChanges(); + + Child4Model = child2List[3]; + Child4Model.TaskCompletContent = txtTaskCompletContent5.Text; + PerformanceService.UpdateChild2(Child4Model); + + //HSE管理 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[4].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan2.Text; + db.SubmitChanges(); + + Child4Model = child2List[4]; + Child4Model.TaskCompletContent = txtTaskCompletContent4.Text; + PerformanceService.UpdateChild2(Child4Model); + + if (child2List.Count == 6) + { + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan1.Text; + Child3Model.CompletStatus = txtCompletStatus1.Text; + db.SubmitChanges(); + + Child4Model = child2List[5]; + Child4Model.TaskCompletContent = txtTaskCompletContent1.Text; + PerformanceService.UpdateChild2(Child4Model); + } + else if (child2List.Count == 7) + { + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2); + Child3Model.WorkPlan = TextBox1.Text; + Child3Model.CompletStatus = TextBox2.Text; + db.SubmitChanges(); + + Child4Model = child2List[5]; + Child4Model.TaskCompletContent = txtTaskCompletContent2.Text; + PerformanceService.UpdateChild2(Child4Model); + + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[6].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan1.Text; + Child3Model.CompletStatus = txtCompletStatus1.Text; + db.SubmitChanges(); + + Child4Model = child2List[6]; + Child4Model.TaskCompletContent = txtTaskCompletContent1.Text; + PerformanceService.UpdateChild2(Child4Model); + } + else if (child2List.Count == 8) + { + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2); + Child3Model.WorkPlan = TextBox3.Text; + Child3Model.CompletStatus = TextBox4.Text; + db.SubmitChanges(); + + Child4Model = child2List[5]; + Child4Model.TaskCompletContent = txtTaskCompletContent3.Text; + PerformanceService.UpdateChild2(Child4Model); + + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[6].Performance_ChildGid2); + Child3Model.WorkPlan = TextBox1.Text; + Child3Model.CompletStatus = TextBox2.Text; + db.SubmitChanges(); + + Child4Model = child2List[6]; + Child4Model.TaskCompletContent = txtTaskCompletContent2.Text; + PerformanceService.UpdateChild2(Child4Model); + + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[7].Performance_ChildGid2); + Child3Model.WorkPlan = txtWorkPlan1.Text; + Child3Model.CompletStatus = txtCompletStatus1.Text; + db.SubmitChanges(); + + Child4Model = child2List[7]; + Child4Model.TaskCompletContent = txtTaskCompletContent1.Text; + PerformanceService.UpdateChild2(Child4Model); + } + ShowNotify("修改成功。", MessageBoxIcon.Success); + } + } + } + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx.designer.cs new file mode 100644 index 00000000..51ecbc47 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Performance/WorkPlanEdit.aspx.designer.cs @@ -0,0 +1,314 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Performance +{ + + + public partial class WorkPlanEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// dpCurrentDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpCurrentDate; + + /// + /// SimpleForm2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm2; + + /// + /// txtWorkPlan1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPlan1; + + /// + /// txtCompletStatus1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCompletStatus1; + + /// + /// txtTaskCompletContent1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// TextBox1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox TextBox1; + + /// + /// TextBox2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox TextBox2; + + /// + /// txtTaskCompletContent2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent2; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// TextBox3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox TextBox3; + + /// + /// TextBox4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox TextBox4; + + /// + /// txtTaskCompletContent3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent3; + + /// + /// SimpleForm3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm3; + + /// + /// txtWorkPlan2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPlan2; + + /// + /// txtTaskCompletContent4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent4; + + /// + /// SimpleForm4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm4; + + /// + /// txtWorkPlan3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPlan3; + + /// + /// txtTaskCompletContent5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent5; + + /// + /// SimpleForm5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm5; + + /// + /// txtWorkPlan4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPlan4; + + /// + /// txtTaskCompletContent6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent6; + + /// + /// SimpleForm6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm6; + + /// + /// txtWorkPlan5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPlan5; + + /// + /// txtTaskCompletContent7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent7; + + /// + /// SimpleForm7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm7; + + /// + /// txtWorkPlan6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPlan6; + + /// + /// txtTaskCompletContent8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTaskCompletContent8; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// Button2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button Button2; + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index f835c6a8..e5ae5710 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -506,6 +506,14 @@ + + + + + + + + @@ -7716,6 +7724,62 @@ WeekReportPrint.aspx + + MonthTargetEdit.aspx + ASPXCodeBehind + + + MonthTargetEdit.aspx + + + Performance.aspx + ASPXCodeBehind + + + Performance.aspx + + + PerformanceAudit.aspx + ASPXCodeBehind + + + PerformanceAudit.aspx + + + PerformanceConfig.aspx + ASPXCodeBehind + + + PerformanceConfig.aspx + + + PerformanceEdit.aspx + ASPXCodeBehind + + + PerformanceEdit.aspx + + + ScoreEdit.aspx + ASPXCodeBehind + + + ScoreEdit.aspx + + + TaskContentEdit.aspx + ASPXCodeBehind + + + TaskContentEdit.aspx + + + WorkPlanEdit.aspx + ASPXCodeBehind + + + WorkPlanEdit.aspx + CheckManStatistics.aspx ASPXCodeBehind diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 1e1e8384..39004ead 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -644,6 +644,21 @@ namespace Model partial void InsertCQMS_Law_ConstructionStandardListProject(CQMS_Law_ConstructionStandardListProject instance); partial void UpdateCQMS_Law_ConstructionStandardListProject(CQMS_Law_ConstructionStandardListProject instance); partial void DeleteCQMS_Law_ConstructionStandardListProject(CQMS_Law_ConstructionStandardListProject instance); + partial void InsertCQMS_Performance(CQMS_Performance instance); + partial void UpdateCQMS_Performance(CQMS_Performance instance); + partial void DeleteCQMS_Performance(CQMS_Performance instance); + partial void InsertCQMS_Performance_Child1(CQMS_Performance_Child1 instance); + partial void UpdateCQMS_Performance_Child1(CQMS_Performance_Child1 instance); + partial void DeleteCQMS_Performance_Child1(CQMS_Performance_Child1 instance); + partial void InsertCQMS_Performance_Child2(CQMS_Performance_Child2 instance); + partial void UpdateCQMS_Performance_Child2(CQMS_Performance_Child2 instance); + partial void DeleteCQMS_Performance_Child2(CQMS_Performance_Child2 instance); + partial void InsertCQMS_Performance_Child3(CQMS_Performance_Child3 instance); + partial void UpdateCQMS_Performance_Child3(CQMS_Performance_Child3 instance); + partial void DeleteCQMS_Performance_Child3(CQMS_Performance_Child3 instance); + partial void InsertCQMS_Performance_SetUp(CQMS_Performance_SetUp instance); + partial void UpdateCQMS_Performance_SetUp(CQMS_Performance_SetUp instance); + partial void DeleteCQMS_Performance_SetUp(CQMS_Performance_SetUp instance); partial void InsertCQMSData_CQMS(CQMSData_CQMS instance); partial void UpdateCQMSData_CQMS(CQMSData_CQMS instance); partial void DeleteCQMSData_CQMS(CQMSData_CQMS instance); @@ -4083,6 +4098,46 @@ namespace Model } } + public System.Data.Linq.Table CQMS_Performance + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table CQMS_Performance_Child1 + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table CQMS_Performance_Child2 + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table CQMS_Performance_Child3 + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table CQMS_Performance_SetUp + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table CQMSData_CQMS { get @@ -110883,6 +110938,1300 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_Performance")] + public partial class CQMS_Performance : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _PerformanceGid; + + private string _HeadUserid; + + private System.Nullable _ProOutputValue; + + private string _SubUserids; + + private string _SubpackageUserids; + + private System.Nullable _TotalScore; + + private string _ProjectId; + + private System.Nullable _CreateDate; + + private string _CreateMan; + + private string _CreateDateMonth; + + private string _States; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPerformanceGidChanging(string value); + partial void OnPerformanceGidChanged(); + partial void OnHeadUseridChanging(string value); + partial void OnHeadUseridChanged(); + partial void OnProOutputValueChanging(System.Nullable value); + partial void OnProOutputValueChanged(); + partial void OnSubUseridsChanging(string value); + partial void OnSubUseridsChanged(); + partial void OnSubpackageUseridsChanging(string value); + partial void OnSubpackageUseridsChanged(); + partial void OnTotalScoreChanging(System.Nullable value); + partial void OnTotalScoreChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnCreateDateChanging(System.Nullable value); + partial void OnCreateDateChanged(); + partial void OnCreateManChanging(string value); + partial void OnCreateManChanged(); + partial void OnCreateDateMonthChanging(string value); + partial void OnCreateDateMonthChanged(); + partial void OnStatesChanging(string value); + partial void OnStatesChanged(); + #endregion + + public CQMS_Performance() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PerformanceGid", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string PerformanceGid + { + get + { + return this._PerformanceGid; + } + set + { + if ((this._PerformanceGid != value)) + { + this.OnPerformanceGidChanging(value); + this.SendPropertyChanging(); + this._PerformanceGid = value; + this.SendPropertyChanged("PerformanceGid"); + this.OnPerformanceGidChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_HeadUserid", DbType="NVarChar(50)")] + public string HeadUserid + { + get + { + return this._HeadUserid; + } + set + { + if ((this._HeadUserid != value)) + { + this.OnHeadUseridChanging(value); + this.SendPropertyChanging(); + this._HeadUserid = value; + this.SendPropertyChanged("HeadUserid"); + this.OnHeadUseridChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProOutputValue", DbType="Decimal(18,2)")] + public System.Nullable ProOutputValue + { + get + { + return this._ProOutputValue; + } + set + { + if ((this._ProOutputValue != value)) + { + this.OnProOutputValueChanging(value); + this.SendPropertyChanging(); + this._ProOutputValue = value; + this.SendPropertyChanged("ProOutputValue"); + this.OnProOutputValueChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubUserids", DbType="NVarChar(2000)")] + public string SubUserids + { + get + { + return this._SubUserids; + } + set + { + if ((this._SubUserids != value)) + { + this.OnSubUseridsChanging(value); + this.SendPropertyChanging(); + this._SubUserids = value; + this.SendPropertyChanged("SubUserids"); + this.OnSubUseridsChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubpackageUserids", DbType="NVarChar(2000)")] + public string SubpackageUserids + { + get + { + return this._SubpackageUserids; + } + set + { + if ((this._SubpackageUserids != value)) + { + this.OnSubpackageUseridsChanging(value); + this.SendPropertyChanging(); + this._SubpackageUserids = value; + this.SendPropertyChanged("SubpackageUserids"); + this.OnSubpackageUseridsChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalScore", DbType="Decimal(18,2)")] + public System.Nullable TotalScore + { + get + { + return this._TotalScore; + } + set + { + if ((this._TotalScore != value)) + { + this.OnTotalScoreChanging(value); + this.SendPropertyChanging(); + this._TotalScore = value; + this.SendPropertyChanged("TotalScore"); + this.OnTotalScoreChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateDate", DbType="DateTime")] + public System.Nullable CreateDate + { + get + { + return this._CreateDate; + } + set + { + if ((this._CreateDate != value)) + { + this.OnCreateDateChanging(value); + this.SendPropertyChanging(); + this._CreateDate = value; + this.SendPropertyChanged("CreateDate"); + this.OnCreateDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateMan", DbType="NVarChar(50)")] + public string CreateMan + { + get + { + return this._CreateMan; + } + set + { + if ((this._CreateMan != value)) + { + this.OnCreateManChanging(value); + this.SendPropertyChanging(); + this._CreateMan = value; + this.SendPropertyChanged("CreateMan"); + this.OnCreateManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateDateMonth", DbType="NVarChar(50)")] + public string CreateDateMonth + { + get + { + return this._CreateDateMonth; + } + set + { + if ((this._CreateDateMonth != value)) + { + this.OnCreateDateMonthChanging(value); + this.SendPropertyChanging(); + this._CreateDateMonth = value; + this.SendPropertyChanged("CreateDateMonth"); + this.OnCreateDateMonthChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_States", DbType="NVarChar(50)")] + public string States + { + get + { + return this._States; + } + set + { + if ((this._States != value)) + { + this.OnStatesChanging(value); + this.SendPropertyChanging(); + this._States = value; + this.SendPropertyChanged("States"); + this.OnStatesChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_Performance_Child1")] + public partial class CQMS_Performance_Child1 : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Performance_ChildGid1; + + private string _PerformanceGid; + + private string _PType; + + private System.Nullable _EvaScore; + + private string _Itemize; + + private string _WorkArea; + + private string _MonthTarget; + + private System.Nullable _SortIndex; + + private string _CreateMan; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPerformance_ChildGid1Changing(string value); + partial void OnPerformance_ChildGid1Changed(); + partial void OnPerformanceGidChanging(string value); + partial void OnPerformanceGidChanged(); + partial void OnPTypeChanging(string value); + partial void OnPTypeChanged(); + partial void OnEvaScoreChanging(System.Nullable value); + partial void OnEvaScoreChanged(); + partial void OnItemizeChanging(string value); + partial void OnItemizeChanged(); + partial void OnWorkAreaChanging(string value); + partial void OnWorkAreaChanged(); + partial void OnMonthTargetChanging(string value); + partial void OnMonthTargetChanged(); + partial void OnSortIndexChanging(System.Nullable value); + partial void OnSortIndexChanged(); + partial void OnCreateManChanging(string value); + partial void OnCreateManChanged(); + #endregion + + public CQMS_Performance_Child1() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Performance_ChildGid1", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Performance_ChildGid1 + { + get + { + return this._Performance_ChildGid1; + } + set + { + if ((this._Performance_ChildGid1 != value)) + { + this.OnPerformance_ChildGid1Changing(value); + this.SendPropertyChanging(); + this._Performance_ChildGid1 = value; + this.SendPropertyChanged("Performance_ChildGid1"); + this.OnPerformance_ChildGid1Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PerformanceGid", DbType="NVarChar(50)")] + public string PerformanceGid + { + get + { + return this._PerformanceGid; + } + set + { + if ((this._PerformanceGid != value)) + { + this.OnPerformanceGidChanging(value); + this.SendPropertyChanging(); + this._PerformanceGid = value; + this.SendPropertyChanged("PerformanceGid"); + this.OnPerformanceGidChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PType", DbType="NVarChar(50)")] + public string PType + { + get + { + return this._PType; + } + set + { + if ((this._PType != value)) + { + this.OnPTypeChanging(value); + this.SendPropertyChanging(); + this._PType = value; + this.SendPropertyChanged("PType"); + this.OnPTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EvaScore", DbType="Decimal(18,2)")] + public System.Nullable EvaScore + { + get + { + return this._EvaScore; + } + set + { + if ((this._EvaScore != value)) + { + this.OnEvaScoreChanging(value); + this.SendPropertyChanging(); + this._EvaScore = value; + this.SendPropertyChanged("EvaScore"); + this.OnEvaScoreChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Itemize", DbType="NVarChar(50)")] + public string Itemize + { + get + { + return this._Itemize; + } + set + { + if ((this._Itemize != value)) + { + this.OnItemizeChanging(value); + this.SendPropertyChanging(); + this._Itemize = value; + this.SendPropertyChanged("Itemize"); + this.OnItemizeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkArea", DbType="NVarChar(50)")] + public string WorkArea + { + get + { + return this._WorkArea; + } + set + { + if ((this._WorkArea != value)) + { + this.OnWorkAreaChanging(value); + this.SendPropertyChanging(); + this._WorkArea = value; + this.SendPropertyChanged("WorkArea"); + this.OnWorkAreaChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MonthTarget", DbType="NVarChar(500)")] + public string MonthTarget + { + get + { + return this._MonthTarget; + } + set + { + if ((this._MonthTarget != value)) + { + this.OnMonthTargetChanging(value); + this.SendPropertyChanging(); + this._MonthTarget = value; + this.SendPropertyChanged("MonthTarget"); + this.OnMonthTargetChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")] + public System.Nullable SortIndex + { + get + { + return this._SortIndex; + } + set + { + if ((this._SortIndex != value)) + { + this.OnSortIndexChanging(value); + this.SendPropertyChanging(); + this._SortIndex = value; + this.SendPropertyChanged("SortIndex"); + this.OnSortIndexChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateMan", DbType="NVarChar(50)")] + public string CreateMan + { + get + { + return this._CreateMan; + } + set + { + if ((this._CreateMan != value)) + { + this.OnCreateManChanging(value); + this.SendPropertyChanging(); + this._CreateMan = value; + this.SendPropertyChanged("CreateMan"); + this.OnCreateManChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_Performance_Child2")] + public partial class CQMS_Performance_Child2 : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Performance_ChildGid2; + + private string _Performance_ChildGid1; + + private string _PerformanceGid; + + private string _TaskContent; + + private string _ProjectQuantity; + + private string _DemandPlan; + + private string _TaskCompletContent; + + private System.Nullable _NowWeek; + + private System.Nullable _SortIndex; + + private string _CreateMan; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPerformance_ChildGid2Changing(string value); + partial void OnPerformance_ChildGid2Changed(); + partial void OnPerformance_ChildGid1Changing(string value); + partial void OnPerformance_ChildGid1Changed(); + partial void OnPerformanceGidChanging(string value); + partial void OnPerformanceGidChanged(); + partial void OnTaskContentChanging(string value); + partial void OnTaskContentChanged(); + partial void OnProjectQuantityChanging(string value); + partial void OnProjectQuantityChanged(); + partial void OnDemandPlanChanging(string value); + partial void OnDemandPlanChanged(); + partial void OnTaskCompletContentChanging(string value); + partial void OnTaskCompletContentChanged(); + partial void OnNowWeekChanging(System.Nullable value); + partial void OnNowWeekChanged(); + partial void OnSortIndexChanging(System.Nullable value); + partial void OnSortIndexChanged(); + partial void OnCreateManChanging(string value); + partial void OnCreateManChanged(); + #endregion + + public CQMS_Performance_Child2() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Performance_ChildGid2", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Performance_ChildGid2 + { + get + { + return this._Performance_ChildGid2; + } + set + { + if ((this._Performance_ChildGid2 != value)) + { + this.OnPerformance_ChildGid2Changing(value); + this.SendPropertyChanging(); + this._Performance_ChildGid2 = value; + this.SendPropertyChanged("Performance_ChildGid2"); + this.OnPerformance_ChildGid2Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Performance_ChildGid1", DbType="NVarChar(50)")] + public string Performance_ChildGid1 + { + get + { + return this._Performance_ChildGid1; + } + set + { + if ((this._Performance_ChildGid1 != value)) + { + this.OnPerformance_ChildGid1Changing(value); + this.SendPropertyChanging(); + this._Performance_ChildGid1 = value; + this.SendPropertyChanged("Performance_ChildGid1"); + this.OnPerformance_ChildGid1Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PerformanceGid", DbType="NVarChar(50)")] + public string PerformanceGid + { + get + { + return this._PerformanceGid; + } + set + { + if ((this._PerformanceGid != value)) + { + this.OnPerformanceGidChanging(value); + this.SendPropertyChanging(); + this._PerformanceGid = value; + this.SendPropertyChanged("PerformanceGid"); + this.OnPerformanceGidChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskContent", DbType="NVarChar(500)")] + public string TaskContent + { + get + { + return this._TaskContent; + } + set + { + if ((this._TaskContent != value)) + { + this.OnTaskContentChanging(value); + this.SendPropertyChanging(); + this._TaskContent = value; + this.SendPropertyChanged("TaskContent"); + this.OnTaskContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectQuantity", DbType="NVarChar(500)")] + public string ProjectQuantity + { + get + { + return this._ProjectQuantity; + } + set + { + if ((this._ProjectQuantity != value)) + { + this.OnProjectQuantityChanging(value); + this.SendPropertyChanging(); + this._ProjectQuantity = value; + this.SendPropertyChanged("ProjectQuantity"); + this.OnProjectQuantityChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DemandPlan", DbType="NVarChar(500)")] + public string DemandPlan + { + get + { + return this._DemandPlan; + } + set + { + if ((this._DemandPlan != value)) + { + this.OnDemandPlanChanging(value); + this.SendPropertyChanging(); + this._DemandPlan = value; + this.SendPropertyChanged("DemandPlan"); + this.OnDemandPlanChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TaskCompletContent", DbType="NVarChar(500)")] + public string TaskCompletContent + { + get + { + return this._TaskCompletContent; + } + set + { + if ((this._TaskCompletContent != value)) + { + this.OnTaskCompletContentChanging(value); + this.SendPropertyChanging(); + this._TaskCompletContent = value; + this.SendPropertyChanged("TaskCompletContent"); + this.OnTaskCompletContentChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NowWeek", DbType="Int")] + public System.Nullable NowWeek + { + get + { + return this._NowWeek; + } + set + { + if ((this._NowWeek != value)) + { + this.OnNowWeekChanging(value); + this.SendPropertyChanging(); + this._NowWeek = value; + this.SendPropertyChanged("NowWeek"); + this.OnNowWeekChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")] + public System.Nullable SortIndex + { + get + { + return this._SortIndex; + } + set + { + if ((this._SortIndex != value)) + { + this.OnSortIndexChanging(value); + this.SendPropertyChanging(); + this._SortIndex = value; + this.SendPropertyChanged("SortIndex"); + this.OnSortIndexChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateMan", DbType="NVarChar(50)")] + public string CreateMan + { + get + { + return this._CreateMan; + } + set + { + if ((this._CreateMan != value)) + { + this.OnCreateManChanging(value); + this.SendPropertyChanging(); + this._CreateMan = value; + this.SendPropertyChanged("CreateMan"); + this.OnCreateManChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_Performance_Child3")] + public partial class CQMS_Performance_Child3 : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Performance_ChildGid3; + + private string _Performance_ChildGid2; + + private string _PerformanceGid; + + private string _WorkPlan; + + private string _CompletStatus; + + private System.Nullable _CurrentDate; + + private string _CreateMan; + + private string _ProjectId; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPerformance_ChildGid3Changing(string value); + partial void OnPerformance_ChildGid3Changed(); + partial void OnPerformance_ChildGid2Changing(string value); + partial void OnPerformance_ChildGid2Changed(); + partial void OnPerformanceGidChanging(string value); + partial void OnPerformanceGidChanged(); + partial void OnWorkPlanChanging(string value); + partial void OnWorkPlanChanged(); + partial void OnCompletStatusChanging(string value); + partial void OnCompletStatusChanged(); + partial void OnCurrentDateChanging(System.Nullable value); + partial void OnCurrentDateChanged(); + partial void OnCreateManChanging(string value); + partial void OnCreateManChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + #endregion + + public CQMS_Performance_Child3() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Performance_ChildGid3", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Performance_ChildGid3 + { + get + { + return this._Performance_ChildGid3; + } + set + { + if ((this._Performance_ChildGid3 != value)) + { + this.OnPerformance_ChildGid3Changing(value); + this.SendPropertyChanging(); + this._Performance_ChildGid3 = value; + this.SendPropertyChanged("Performance_ChildGid3"); + this.OnPerformance_ChildGid3Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Performance_ChildGid2", DbType="NVarChar(50)")] + public string Performance_ChildGid2 + { + get + { + return this._Performance_ChildGid2; + } + set + { + if ((this._Performance_ChildGid2 != value)) + { + this.OnPerformance_ChildGid2Changing(value); + this.SendPropertyChanging(); + this._Performance_ChildGid2 = value; + this.SendPropertyChanged("Performance_ChildGid2"); + this.OnPerformance_ChildGid2Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PerformanceGid", DbType="NVarChar(50)")] + public string PerformanceGid + { + get + { + return this._PerformanceGid; + } + set + { + if ((this._PerformanceGid != value)) + { + this.OnPerformanceGidChanging(value); + this.SendPropertyChanging(); + this._PerformanceGid = value; + this.SendPropertyChanged("PerformanceGid"); + this.OnPerformanceGidChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPlan", DbType="NVarChar(500)")] + public string WorkPlan + { + get + { + return this._WorkPlan; + } + set + { + if ((this._WorkPlan != value)) + { + this.OnWorkPlanChanging(value); + this.SendPropertyChanging(); + this._WorkPlan = value; + this.SendPropertyChanged("WorkPlan"); + this.OnWorkPlanChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompletStatus", DbType="NVarChar(500)")] + public string CompletStatus + { + get + { + return this._CompletStatus; + } + set + { + if ((this._CompletStatus != value)) + { + this.OnCompletStatusChanging(value); + this.SendPropertyChanging(); + this._CompletStatus = value; + this.SendPropertyChanged("CompletStatus"); + this.OnCompletStatusChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CurrentDate", DbType="DateTime")] + public System.Nullable CurrentDate + { + get + { + return this._CurrentDate; + } + set + { + if ((this._CurrentDate != value)) + { + this.OnCurrentDateChanging(value); + this.SendPropertyChanging(); + this._CurrentDate = value; + this.SendPropertyChanged("CurrentDate"); + this.OnCurrentDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateMan", DbType="NVarChar(50)")] + public string CreateMan + { + get + { + return this._CreateMan; + } + set + { + if ((this._CreateMan != value)) + { + this.OnCreateManChanging(value); + this.SendPropertyChanging(); + this._CreateMan = value; + this.SendPropertyChanged("CreateMan"); + this.OnCreateManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_Performance_SetUp")] + public partial class CQMS_Performance_SetUp : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _PerformanceSteUpGid; + + private string _SetUpMonth; + + private string _SetUpStartDate; + + private string _SetUpEndDate; + + private System.Nullable _SetUpWeek; + + private System.Nullable _CreateDate; + + private string _CreateYear; + + private System.Nullable _SortIndex; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPerformanceSteUpGidChanging(string value); + partial void OnPerformanceSteUpGidChanged(); + partial void OnSetUpMonthChanging(string value); + partial void OnSetUpMonthChanged(); + partial void OnSetUpStartDateChanging(string value); + partial void OnSetUpStartDateChanged(); + partial void OnSetUpEndDateChanging(string value); + partial void OnSetUpEndDateChanged(); + partial void OnSetUpWeekChanging(System.Nullable value); + partial void OnSetUpWeekChanged(); + partial void OnCreateDateChanging(System.Nullable value); + partial void OnCreateDateChanged(); + partial void OnCreateYearChanging(string value); + partial void OnCreateYearChanged(); + partial void OnSortIndexChanging(System.Nullable value); + partial void OnSortIndexChanged(); + #endregion + + public CQMS_Performance_SetUp() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PerformanceSteUpGid", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string PerformanceSteUpGid + { + get + { + return this._PerformanceSteUpGid; + } + set + { + if ((this._PerformanceSteUpGid != value)) + { + this.OnPerformanceSteUpGidChanging(value); + this.SendPropertyChanging(); + this._PerformanceSteUpGid = value; + this.SendPropertyChanged("PerformanceSteUpGid"); + this.OnPerformanceSteUpGidChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SetUpMonth", DbType="NVarChar(50)")] + public string SetUpMonth + { + get + { + return this._SetUpMonth; + } + set + { + if ((this._SetUpMonth != value)) + { + this.OnSetUpMonthChanging(value); + this.SendPropertyChanging(); + this._SetUpMonth = value; + this.SendPropertyChanged("SetUpMonth"); + this.OnSetUpMonthChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SetUpStartDate", DbType="NVarChar(50)")] + public string SetUpStartDate + { + get + { + return this._SetUpStartDate; + } + set + { + if ((this._SetUpStartDate != value)) + { + this.OnSetUpStartDateChanging(value); + this.SendPropertyChanging(); + this._SetUpStartDate = value; + this.SendPropertyChanged("SetUpStartDate"); + this.OnSetUpStartDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SetUpEndDate", DbType="NVarChar(50)")] + public string SetUpEndDate + { + get + { + return this._SetUpEndDate; + } + set + { + if ((this._SetUpEndDate != value)) + { + this.OnSetUpEndDateChanging(value); + this.SendPropertyChanging(); + this._SetUpEndDate = value; + this.SendPropertyChanged("SetUpEndDate"); + this.OnSetUpEndDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SetUpWeek", DbType="Int")] + public System.Nullable SetUpWeek + { + get + { + return this._SetUpWeek; + } + set + { + if ((this._SetUpWeek != value)) + { + this.OnSetUpWeekChanging(value); + this.SendPropertyChanging(); + this._SetUpWeek = value; + this.SendPropertyChanged("SetUpWeek"); + this.OnSetUpWeekChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateDate", DbType="DateTime")] + public System.Nullable CreateDate + { + get + { + return this._CreateDate; + } + set + { + if ((this._CreateDate != value)) + { + this.OnCreateDateChanging(value); + this.SendPropertyChanging(); + this._CreateDate = value; + this.SendPropertyChanged("CreateDate"); + this.OnCreateDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CreateYear", DbType="NVarChar(50)")] + public string CreateYear + { + get + { + return this._CreateYear; + } + set + { + if ((this._CreateYear != value)) + { + this.OnCreateYearChanging(value); + this.SendPropertyChanging(); + this._CreateYear = value; + this.SendPropertyChanged("CreateYear"); + this.OnCreateYearChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SortIndex", DbType="Int")] + public System.Nullable SortIndex + { + get + { + return this._SortIndex; + } + set + { + if ((this._SortIndex != value)) + { + this.OnSortIndexChanging(value); + this.SendPropertyChanging(); + this._SortIndex = value; + this.SendPropertyChanged("SortIndex"); + this.OnSortIndexChanged(); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMSData_CQMS")] public partial class CQMSData_CQMS : INotifyPropertyChanging, INotifyPropertyChanged { diff --git a/SGGL/WebAPI/Controllers/CQMS/PerformanceController.cs b/SGGL/WebAPI/Controllers/CQMS/PerformanceController.cs new file mode 100644 index 00000000..55c20c89 --- /dev/null +++ b/SGGL/WebAPI/Controllers/CQMS/PerformanceController.cs @@ -0,0 +1,313 @@ +using System; +using System.Collections.Generic; +using System.Web.Http; +using Model; +using BLL; +using System.Linq; + +namespace WebAPI.Controllers.CQMS +{ + /// + /// 施工绩效控制器 + /// + public class PerformanceController : ApiController + { + #region 根据主键、人员id、项目id获取数据 + /// + /// 根据主键、人员id、项目id、当前日期 获取数据 + /// + /// + /// + /// + /// + /// + [HttpGet] + public Model.ResponeData getPerformanceData(string Projectid, string Userid, string PerformanceGid, string Nowdate) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + var responeData = new Model.ResponeData(); + try + { + //根据当前日期 和主键id获取当前是第几周 + var TodayDate = Convert.ToDateTime(Nowdate).Date; + var childModel3 = db.CQMS_Performance_Child3.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + if (childModel3 == null) + { + responeData.code = 0; + responeData.message = "未查询到数据,请去pc端表单"; + return responeData; + } + var Performance_ChildGid2 = childModel3.Performance_ChildGid2; + var NowWeek = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.Performance_ChildGid2 == Performance_ChildGid2).NowWeek; + + //获取数量和本周任务安排 + var child2List = Funs.DB.CQMS_Performance_Child2.Where(x => x.PerformanceGid == PerformanceGid && x.NowWeek + == NowWeek).OrderBy(x => x.SortIndex).ToList(); + + + List childList3 = new List(); + + + var Onindex = 0; + foreach (var item in child2List) + { + var FModel1Itemize = db.CQMS_Performance_Child1.FirstOrDefault(x => x.Performance_ChildGid1 == item.Performance_ChildGid1); + if (FModel1Itemize.Itemize.IndexOf("施工进度")>-1) + { + FModel1Itemize.Itemize = "施工进度"; + } + else if (FModel1Itemize.Itemize.IndexOf("HSE管理") > -1) + { + FModel1Itemize.Itemize = "HSE管理"; + } + else if (FModel1Itemize.Itemize.IndexOf("质量管理情况") > -1) + { + FModel1Itemize.Itemize = "质量管理情况"; + } + else if (FModel1Itemize.Itemize.IndexOf("图纸、材料状态跟踪") > -1) + { + FModel1Itemize.Itemize = "图纸、材料状态跟踪"; + } + else if (FModel1Itemize.Itemize.IndexOf("关键事项跟踪") > -1) + { + FModel1Itemize.Itemize = "关键事项跟踪"; + } + else if (FModel1Itemize.Itemize.IndexOf("可交付成果") > -1) + { + FModel1Itemize.Itemize = "可交付成果"; + } + + + item.TaskContent = FModel1Itemize.Itemize+"(本周任务安排:"+ item.TaskContent + ")"; + + var child3Model = db.CQMS_Performance_Child3.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate && x.Performance_ChildGid2 == item.Performance_ChildGid2); + childList3.Add(child3Model); + Onindex += 1; + } + + responeData.data = new { child2List.Count, child2List, childList3 }; + + + //responeData.data = APICheckSpecialService.getCheckSpecialById(CheckSpecialId, state); + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + + return responeData; + } + } + #endregion + + #region 添加当日计划 + /// + /// 添加实体类 + /// + public class PerformanceInserModelItem { + /// + /// 主键id + /// + public string PerformanceGid { get; set; } + /// + /// 本日工作计划 + /// + public string WorkPlan { get; set; } + /// + /// 本日完成情况 + /// + public string CompletStatus { get; set; } + + /// + /// 当前日期 + /// + public DateTime CurrentDate { get; set; } + + /// + /// 本周工作完成情况 + /// + public string TaskCompletContent { get; set; } + + } + + /// + /// 添加实体 + /// + public class AddLists { + public List childList { get; set; } + + } + + /// + /// 添加当日计划 + /// + /// + /// + [HttpPost] + public Model.ResponeData InsertPerformance([FromBody] AddLists CreateList) { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + List AddList = CreateList.childList; + var responeData = new Model.ResponeData(); + try + { + if (AddList==null) + { + responeData.code = 0; + responeData.message = "未查询到数据,请重试。"; + return responeData; + } + var cdate = AddList[0].CurrentDate; + var PerformanceGid = AddList[0].PerformanceGid; + + // 根据当前日期 和主键id获取当前是第几周 + var TodayDate = Convert.ToDateTime(cdate).Date; + var childModel3 = db.CQMS_Performance_Child3.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + if (childModel3 == null) + { + responeData.code = 0; + responeData.message = "未查询到数据,请去pc端表单"; + return responeData; + } + + var Performance_ChildGid2 = childModel3.Performance_ChildGid2; + var NowWeek = db.CQMS_Performance_Child2.FirstOrDefault(x => x.PerformanceGid == PerformanceGid + && x.Performance_ChildGid2 == Performance_ChildGid2).NowWeek; + //加载数据。 + //判断施工管理工作任务安排有几个(倒序) + var child2List = Funs.DB.CQMS_Performance_Child2.Where(x => x.PerformanceGid == PerformanceGid && x.NowWeek + == NowWeek).OrderByDescending(x => x.SortIndex).ToList(); + + var objModel = db.CQMS_Performance_Child3.Where(x => x.PerformanceGid == PerformanceGid + && x.CurrentDate == TodayDate); + + if (child2List != null) + { + //可交付成果 + var Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[0].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count-1].WorkPlan; + db.SubmitChanges(); + + //周计划 + Model.CQMS_Performance_Child2 Child4Model = child2List[0]; + Child4Model.TaskCompletContent = AddList[AddList.Count-1].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + //关键事项跟踪 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[1].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 2].WorkPlan; + db.SubmitChanges(); + + Child4Model = child2List[1]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 2].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + //图纸、材料状态跟踪;统计台账 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[2].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 3].WorkPlan; + db.SubmitChanges(); + + Child4Model = child2List[2]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 3].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + //质量管理情况 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[3].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 4].WorkPlan; + db.SubmitChanges(); + + Child4Model = child2List[3]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 4].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + //HSE管理 + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[4].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 5].WorkPlan; + db.SubmitChanges(); + + Child4Model = child2List[4]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 5].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + if (child2List.Count == 6) + { + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 6].WorkPlan; + Child3Model.CompletStatus = AddList[AddList.Count - 6].CompletStatus; + db.SubmitChanges(); + + Child4Model = child2List[5]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 6].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + } + else if (child2List.Count == 7) + { + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 6].WorkPlan; + Child3Model.CompletStatus = AddList[AddList.Count - 6].CompletStatus; + db.SubmitChanges(); + + Child4Model = child2List[5]; + Child4Model.TaskCompletContent = AddList[AddList.Count -6].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[6].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 7].WorkPlan; + Child3Model.CompletStatus = AddList[AddList.Count - 7].CompletStatus; + db.SubmitChanges(); + + Child4Model = child2List[6]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 7].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + } + else if (child2List.Count == 8) + { + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[5].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 6].WorkPlan; + Child3Model.CompletStatus = AddList[AddList.Count - 6].CompletStatus; + db.SubmitChanges(); + + Child4Model = child2List[5]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 6].TaskCompletContent; + PerformanceService.UpdateChild2(Child4Model); + + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[6].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 7].WorkPlan; + Child3Model.CompletStatus = AddList[AddList.Count - 7].CompletStatus; + db.SubmitChanges(); + + Child4Model = child2List[6]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 7].CompletStatus; + PerformanceService.UpdateChild2(Child4Model); + + Child3Model = objModel.FirstOrDefault(x => x.Performance_ChildGid2 == child2List[7].Performance_ChildGid2); + Child3Model.WorkPlan = AddList[AddList.Count - 8].WorkPlan; + Child3Model.CompletStatus = AddList[AddList.Count - 8].CompletStatus; + db.SubmitChanges(); + + Child4Model = child2List[7]; + Child4Model.TaskCompletContent = AddList[AddList.Count - 8].CompletStatus; + PerformanceService.UpdateChild2(Child4Model); + } + } + responeData.message = "保存成功"; + } + catch (Exception ex) + { + responeData.code = 0; + responeData.message = ex.Message; + } + + return responeData; + } + } + + #endregion + } +} \ No newline at end of file diff --git a/SGGL/WebAPI/WebAPI.csproj b/SGGL/WebAPI/WebAPI.csproj index 47f019c7..bdb6c5b9 100644 --- a/SGGL/WebAPI/WebAPI.csproj +++ b/SGGL/WebAPI/WebAPI.csproj @@ -146,6 +146,7 @@ +