质量月报

This commit is contained in:
李超 2023-05-21 19:58:25 +08:00
parent ae176da165
commit 0af53e1635
8 changed files with 2043 additions and 2 deletions

View File

@ -0,0 +1,171 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManagerMonthC.aspx.cs" Inherits="FineUIPro.Web.CQMS.ManageReport.ManagerMonthC" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>HSE月报告</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="240px" Title="年度月报" ShowBorder="true" Layout="VBox"
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Height="500px" Title="年份" OnNodeCommand="tvControlItem_NodeCommand"
runat="server" ShowBorder="false" EnableCollapse="true" EnableSingleClickExpand="true"
AutoLeafIdentification="true" EnableTextSelection="true" Expanded="true">
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle"
AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="HSE月报告" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="MonthReportItemId" AllowCellEditing="true"
ClicksToEdit="1" DataIDField="MonthReportItemId" EnableColumnLines="true"
OnRowDataBound="Grid1_RowDataBound">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:DatePicker runat="server" Label="选择年份" ID="txtReportYear" LabelWidth="100px" Width="200px" DisplayType="Year"
LabelAlign="right" DateFormatString="yyyy">
</f:DatePicker>
<f:Button ID="btnNew" Text="新建" ToolTip="新建" Icon="Add" runat="server"
OnClick="btnNew_Click" Hidden="true">
</f:Button>
<f:Button ID="btnSave" Text="保存" ToolTip="保存" Icon="SystemSave" runat="server"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField MinWidth="10px" ColumnID="MonthReportItemId" DataField="MonthReportItemId"
FieldType="String" Hidden="true">
</f:RenderField>
<f:RenderField MinWidth="285px" ColumnID="ReportItem" DataField="ReportItem" EnableLock="true" Locked="true"
FieldType="String" HeaderText="管理内容" HeaderTextAlign="Left" TextAlign="Left">
</f:RenderField>
<f:RenderField MinWidth="60px" ColumnID="Unit" DataField="Unit" EnableLock="true" Locked="true"
FieldType="String" HeaderText="单位" HeaderTextAlign="Left" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month1" DataField="Month1" FieldType="Int" HeaderText="1月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth1" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month2" DataField="Month2" FieldType="Int" HeaderText="2月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth2" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month3" DataField="Month3" FieldType="Int" HeaderText="3月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth3" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month4" DataField="Month4" FieldType="Int" HeaderText="4月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth4" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month5" DataField="Month5" FieldType="Int" HeaderText="5月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth5" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month6" DataField="Month6" FieldType="Int" HeaderText="6月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth6" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month7" DataField="Month7" FieldType="Int" HeaderText="7月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth7" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month8" DataField="Month8" FieldType="Int" HeaderText="8月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth8" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month9" DataField="Month9" FieldType="Int" HeaderText="9月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth9" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month10" DataField="Month10" FieldType="Int" HeaderText="10月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth10" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month11" DataField="Month11" FieldType="Int" HeaderText="11月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth11" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="60px" ColumnID="Month12" DataField="Month12" FieldType="Int" HeaderText="12月" HeaderTextAlign="Center">
<Editor>
<f:NumberBox ID="txtMonth12" NoNegative="true" runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField Width="90px" ColumnID="YearTotal" DataField="YearTotal" FieldType="Int" HeaderText="年度合计" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="ProjectTotal" DataField="ProjectTotal" FieldType="Int" HeaderText="项目累计" HeaderTextAlign="Center" ExpandUnusedSpace="true">
</f:RenderField>
<f:RenderField Width="0px" ColumnID="SumProjectTotal" DataField="SumProjectTotal" FieldType="Int" Hidden="true">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="afteredit" Handler="onGridAfterEdit" />
</Listeners>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
<script type="text/javascript">
function onGridAfterEdit(event, value, params) {
debugger
var me = this, columnId = params.columnId, rowId = params.rowId;
var yearTotal = 0;
for (var i = 1; i <= 12; i++)
{
var month = 'Month' + i.toString();
var columnValue=me.getCellValue(rowId, month);
if (typeof(columnValue) === 'number') {
yearTotal += columnValue;
}
}
me.updateCellValue(rowId, 'YearTotal', yearTotal);
var sumProjectTotal = me.getCellValue(rowId, 'SumProjectTotal');
me.updateCellValue(rowId, 'ProjectTotal', sumProjectTotal + yearTotal);
}
</script>
</body>
</html>

View File

@ -0,0 +1,815 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using BLL;
using AspNet = System.Web.UI.WebControls;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.CQMS.ManageReport
{
public partial class ManagerMonthC : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
////权限按钮方法
this.GetButtonPower();
this.txtReportYear.Text = string.Format("{0:yyyy}", DateTime.Now);
// 绑定表格
//BindGrid();
InitTreeMenu();
}
}
private void InitTreeMenu()
{
this.tvControlItem.Nodes.Clear();
TreeNode rootNode = new TreeNode();
rootNode.Text = "年份";
rootNode.NodeID = "0";
rootNode.Expanded = true;
this.tvControlItem.Nodes.Add(rootNode);
var report = from x in Funs.DB.CQMS_MonthReport
where x.ProjectId == CurrUser.LoginProjectId
orderby x.Years
select x;
if (report.Count() > 0)
{
foreach (var y in report)
{
TreeNode tnYear = new TreeNode();//年节点
tnYear.Text = y.Years.HasValue ? y.Years.Value.ToString() : "";
tnYear.NodeID = y.MonthReportId;
tnYear.EnableClickEvent = true;
rootNode.Nodes.Add(tnYear);
}
}
}
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
{
BindGrid();
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT item.* ,ISNULL(t.SumProjectTotal,0) AS SumProjectTotal
FROM dbo.CQMS_MonthReportItem item
LEFT JOIN dbo.CQMS_MonthReport r ON r.MonthReportId = item.MonthReportId
LEFT JOIN (SELECT a.ReportItem,ISNULL(SUM(ISNULL(a.ProjectTotal,0)),0) AS SumProjectTotal
FROM dbo.CQMS_MonthReportItem a
LEFT JOIN dbo.CQMS_MonthReport b ON b.MonthReportId = a.MonthReportId
WHERE b.ProjectId=@ProjectId AND b.Years < " + this.tvControlItem.SelectedNode.Text + @"
GROUP BY a.ReportItem )t ON t.ReportItem = item.ReportItem
WHERE r.ProjectId=@ProjectId AND r.MonthReportId=@MonthReportId
ORDER BY item.Sort";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@MonthReportId", tvControlItem.SelectedNodeID));
SqlParameter[] parameter = listStr.ToArray();
DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
// 2.获取当前分页数据
//var table = this.GetPagedDataTable(Grid1, tb1);
Grid1.DataSource = dt;
Grid1.DataBind();
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
int cm = GetCurMonth();
for (int i = 1; i <= 12; i++)
{
if (i != cm)
{
//string monthC = "Month" + i.ToString();
//RenderField month = Grid1.FindColumn(monthC) as RenderField;
//e.CellCssClasses[month.ColumnIndex] = "f-grid-cell-uneditable";
}
else
{
string monthC = "Month" + i.ToString();
RenderField month = Grid1.FindColumn(monthC) as RenderField;
RenderField yearTotal = Grid1.FindColumn("YearTotal") as RenderField;
RenderField projectTotal = Grid1.FindColumn("ProjectTotal") as RenderField;
RenderField sumProjectTotal = Grid1.FindColumn("SumProjectTotal") as RenderField;
if (e.RowIndex == 0) // 成达公司现场人数
{
var person = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
}
if (e.RowIndex == 1) // 成达公司HSE管理人数
{
var person = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode == "CHENGDA"
&& z.WorkPostName.Contains("安全")
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
}
if (e.RowIndex == 2) // 分包商现场人数
{
var person = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
}
if (e.RowIndex == 3) // 分包商HSE管理人数
{
var person = from x in Funs.DB.SitePerson_Person
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
join z in Funs.DB.Base_WorkPost on x.WorkPostId equals z.WorkPostId
where x.ProjectId == this.CurrUser.LoginProjectId && y.UnitCode != "CHENGDA"
&& z.WorkPostName.Contains("安全")
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = person.Count();
}
}
if (e.RowIndex == 4 || e.RowIndex == 5) // 人工时数,安全生产人工时数
{
DateTime? sDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString());
var dayReports = BLL.SitePerson_MonthReportService.getMonthReports(this.CurrUser.LoginProjectId, sDate);
if (e.Values[month.ColumnIndex].ToString() == "" && dayReports.Count() > 0)
{
e.Values[month.ColumnIndex] = dayReports.First().DayWorkTime;
}
else if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = 0;
}
}
DateTime startDate = Convert.ToDateTime(tvControlItem.SelectedNode.Text + "-" + i.ToString() + "-01");
if (e.RowIndex == 6) // HSE记录事故数量
{
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
}
if (e.RowIndex == 7) // 死亡
{
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
&& x.Injury == "1"
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
}
if (e.RowIndex == 8) // 重伤
{
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
&& x.Injury == "2"
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
}
if (e.RowIndex == 9) // 轻伤
{
var accident = from x in Funs.DB.Accident_AccidentPersonRecord
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
&& x.Injury == "3"
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
}
if (e.RowIndex == 10) // 未遂事故
{
var accident = from x in Funs.DB.Accident_AccidentHandle
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AccidentDate >= startDate && x.AccidentDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = accident.Count();
}
}
if (e.RowIndex == 11) // 现场环境事故
{
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = "0";
}
}
if (e.RowIndex == 12) // 现场发生设备材料盗窃案件
{
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = "0";
}
}
if (e.RowIndex == 13) // HSE周会
{
var weekMeeting = from x in Funs.DB.Meeting_WeekMeeting
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.WeekMeetingDate >= startDate && x.WeekMeetingDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = weekMeeting.Count();
}
}
if (e.RowIndex == 14) // HSE委员会会议
{
var weekMeeting = from x in Funs.DB.Meeting_AttendMeeting
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.AttendMeetingDate >= startDate && x.AttendMeetingDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = weekMeeting.Count();
}
}
if (e.RowIndex == 15) // 施工现场HSE联检
{
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = "0";
}
}
if (e.RowIndex == 16) // 发布HSE整改通知书
{
var check = from x in Funs.DB.Check_RectifyNotices
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CheckedDate >= startDate && x.CheckedDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = check.Count();
}
}
if (e.RowIndex == 17) // 关闭HSE整改通知书
{
var check = from x in Funs.DB.Check_RectifyNotices
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CompleteDate >= startDate && x.CompleteDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = check.Count();
}
}
if (e.RowIndex == 18) // 发布HSE处罚书
{
var check = from x in Funs.DB.Check_PunishNotice
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.PunishNoticeDate >= startDate && x.PunishNoticeDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = check.Count();
}
}
if (e.RowIndex == 19) // 发布应急预案
{
var em = from x in Funs.DB.Emergency_EmergencyList
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
e.Values[month.ColumnIndex] = em.Count();
}
}
if (e.RowIndex == 20) // 人员培训
{
var edu = from x in Funs.DB.EduTrain_TrainRecord
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.TrainStartDate >= startDate && x.TrainStartDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
if (edu.Count() > 0)
{
e.Values[month.ColumnIndex] = edu.Sum(x => x.TrainPersonNum);
}
else
{
e.Values[month.ColumnIndex] = 0;
}
}
}
if (e.RowIndex == 21) // 设备HSE检验
{
var equ = from x in Funs.DB.License_EquipmentSafetyList
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.CompileDate >= startDate && x.CompileDate < startDate.AddMonths(1)
select x;
if (e.Values[month.ColumnIndex].ToString() == "")
{
if (equ.Count() > 0)
{
e.Values[month.ColumnIndex] = equ.Sum(x => x.EquipmentSafetyListCount);
}
else
{
e.Values[month.ColumnIndex] = 0;
}
}
}
RenderField month1 = Grid1.FindColumn("Month1") as RenderField;
RenderField month2 = Grid1.FindColumn("Month2") as RenderField;
RenderField month3 = Grid1.FindColumn("Month3") as RenderField;
RenderField month4 = Grid1.FindColumn("Month4") as RenderField;
RenderField month5 = Grid1.FindColumn("Month5") as RenderField;
RenderField month6 = Grid1.FindColumn("Month6") as RenderField;
RenderField month7 = Grid1.FindColumn("Month7") as RenderField;
RenderField month8 = Grid1.FindColumn("Month8") as RenderField;
RenderField month9 = Grid1.FindColumn("Month9") as RenderField;
RenderField month10 = Grid1.FindColumn("Month10") as RenderField;
RenderField month11 = Grid1.FindColumn("Month11") as RenderField;
RenderField month12 = Grid1.FindColumn("Month12") as RenderField;
// 年度总计
e.Values[yearTotal.ColumnIndex] = Convert.ToInt32(e.Values[month1.ColumnIndex].ToString() != "" ? e.Values[month1.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month2.ColumnIndex].ToString() != "" ? e.Values[month2.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month3.ColumnIndex].ToString() != "" ? e.Values[month3.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month4.ColumnIndex].ToString() != "" ? e.Values[month4.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month5.ColumnIndex].ToString() != "" ? e.Values[month5.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month6.ColumnIndex].ToString() != "" ? e.Values[month6.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month7.ColumnIndex].ToString() != "" ? e.Values[month7.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month8.ColumnIndex].ToString() != "" ? e.Values[month8.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month9.ColumnIndex].ToString() != "" ? e.Values[month9.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month10.ColumnIndex].ToString() != "" ? e.Values[month10.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month11.ColumnIndex].ToString() != "" ? e.Values[month11.ColumnIndex] : 0)
+ Convert.ToInt32(e.Values[month12.ColumnIndex].ToString() != "" ? e.Values[month12.ColumnIndex] : 0);
// 项目总计
e.Values[projectTotal.ColumnIndex] = Convert.ToInt32(e.Values[yearTotal.ColumnIndex]) + Convert.ToInt32(e.Values[sumProjectTotal.ColumnIndex]);
}
}
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 新增
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
if (project.StartDate != null)
{
if (!string.IsNullOrEmpty(this.txtReportYear.Text.Trim()))
{
if (this.txtReportYear.Text.Trim() == DateTime.Now.Year.ToString())
{
int? years = Convert.ToInt32(this.txtReportYear.Text.Trim());
var report = Funs.DB.CQMS_MonthReport.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.Years == years);
if (report == null)
{
Model.CQMS_MonthReport newReport = new Model.CQMS_MonthReport();
newReport.MonthReportId = SQLHelper.GetNewID(typeof(Model.CQMS_MonthReport));
newReport.ProjectId = this.CurrUser.LoginProjectId;
newReport.Years = years;
Funs.DB.CQMS_MonthReport.InsertOnSubmit(newReport);
Funs.DB.SubmitChanges();
List<Model.CQMS_MonthReportItem> ItemList = new List<Model.CQMS_MonthReportItem>();
for (int i = 0; i < 22; i++)
{
Model.CQMS_MonthReportItem item = new Model.CQMS_MonthReportItem();
item.MonthReportItemId = SQLHelper.GetNewID(typeof(Model.CQMS_MonthReportItem));
item.MonthReportId = newReport.MonthReportId;
if (i == 0)
{
item.ReportItem = "发布施工质量管理文件";
item.Unit = "份";
}
if (i == 1)
{
item.ReportItem = "组织设计交底与图纸会审";
item.Unit = "次";
}
if (i == 2)
{
item.ReportItem = "审批施工组织设计或施工方案";
item.Unit = "份";
}
if (i == 3)
{
item.ReportItem = "施工质量联合检查(例行检测+专项检测)";
item.Unit = "次";
}
if (i == 4)
{
item.ReportItem = "施工质量专题会议";
item.Unit = "次";
}
if (i == 5)
{
item.ReportItem = "不符合项报告NCR";
item.Unit = "";
}
if (i == 6)
{
item.ReportItem = "发布";
item.Unit = "份";
}
if (i == 7)
{
item.ReportItem = "关闭";
item.Unit = "份";
}
if (i == 8)
{
item.ReportItem = "质量整改与处罚";
item.Unit = "";
}
if (i == 9)
{
item.ReportItem = "发出质量整改通知单";
item.Unit = "份";
}
if (i == 10)
{
item.ReportItem = "发出质量处罚通知单";
item.Unit = "份";
}
if (i == 11)
{
item.ReportItem = "检验批及合格率";
item.Unit = "";
}
if (i == 12)
{
item.ReportItem = "检验批次数";
item.Unit = "次";
}
if (i == 13)
{
item.ReportItem = "合格率";
item.Unit = "%";
}
if (i == 14)
{
item.ReportItem = "无损检测RT";
item.Unit = "";
}
if (i == 15)
{
item.ReportItem = "一次拍片数";
item.Unit = "张";
}
if (i == 16)
{
item.ReportItem = "一次合格数";
item.Unit = "张";
}
if (i == 17)
{
item.ReportItem = "一次合格率";
item.Unit = "%";
}
if (i == 18)
{
item.ReportItem = "质量事故";
item.Unit = "";
}
if (i == 19)
{
item.ReportItem = "重大质量事故";
item.Unit = "次";
}
if (i == 20)
{
item.ReportItem = "较大质量事故";
item.Unit = "次";
}
if (i == 21)
{
item.ReportItem = "一般质量事故";
item.Unit = "次";
}
if (i == 22)
{
item.ReportItem = "监理单位下发质量问题通知单";
item.Unit = "";
}
if (i == 23)
{
item.ReportItem = "收到";
item.Unit = "份";
}
if (i == 24)
{
item.ReportItem = "关闭";
item.Unit = "份";
}
if (i == 25)
{
item.ReportItem = "业主方/业主管理公司下发质量问题通知单";
item.Unit = "";
}
if (i == 26)
{
item.ReportItem = "收到";
item.Unit = "份";
}
if (i == 27)
{
item.ReportItem = "关闭";
item.Unit = "份";
}
item.Sort = i + 1;
ItemList.Add(item);
}
Funs.DB.CQMS_MonthReportItem.InsertAllOnSubmit(ItemList);
Funs.DB.SubmitChanges();
this.InitTreeMenu();
Alert.ShowInTop("月报创建成功!", MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop("月报已创建,请选择左边树的年进行编辑!", MessageBoxIcon.Warning);
return;
}
BindGrid();
}
else
{
Alert.ShowInTop("只能新建当年的月报!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("请选择年度!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("请先设置项目开工时间!", MessageBoxIcon.Warning);
return;
}
}
#endregion
protected void btnSave_Click(object sender, EventArgs e)
{
int cm = GetCurMonth();
JArray editReport = Grid1.GetMergedData();
if (editReport.Count > 0)
{
if (true || cm != 0)
{
for (int i = 0; i < editReport.Count; i++)
{
JObject objects = (JObject)editReport[i];
string monthReportItemId = objects["values"]["MonthReportItemId"].ToString();
Model.CQMS_MonthReportItem item = Funs.DB.CQMS_MonthReportItem.FirstOrDefault(x => x.MonthReportItemId == monthReportItemId);
// if (cm == 1)
{
item.Month1 = Funs.GetNewInt(objects["values"]["Month1"].ToString());
}
// if (cm == 2)
{
item.Month2 = Funs.GetNewInt(objects["values"]["Month2"].ToString());
}
// if (cm == 3)
{
item.Month3 = Funs.GetNewInt(objects["values"]["Month3"].ToString());
}
// if (cm == 4)
{
item.Month4 = Funs.GetNewInt(objects["values"]["Month4"].ToString());
}
// if (cm == 5)
{
item.Month5 = Funs.GetNewInt(objects["values"]["Month5"].ToString());
}
// if (cm == 6)
{
item.Month6 = Funs.GetNewInt(objects["values"]["Month6"].ToString());
}
//if (cm == 7)
{
item.Month7 = Funs.GetNewInt(objects["values"]["Month7"].ToString());
}
// if (cm == 8)
{
item.Month8 = Funs.GetNewInt(objects["values"]["Month8"].ToString());
}
//if (cm == 9)
{
item.Month9 = Funs.GetNewInt(objects["values"]["Month9"].ToString());
}
// if (cm == 10)
{
item.Month10 = Funs.GetNewInt(objects["values"]["Month10"].ToString());
}
//if (cm == 11)
{
item.Month11 = Funs.GetNewInt(objects["values"]["Month11"].ToString());
}
//if (cm == 12)
{
item.Month12 = Funs.GetNewInt(objects["values"]["Month12"].ToString());
}
item.YearTotal = Funs.GetNewInt(objects["values"]["YearTotal"].ToString());
item.ProjectTotal = Funs.GetNewInt(objects["values"]["ProjectTotal"].ToString());
Funs.DB.SubmitChanges();
this.ShowNotify("保存成功");
}
}
else
{
Alert.ShowInTop("月报的填报日期为每月的26号开始到下月的4号截止", MessageBoxIcon.Warning);
return;
}
}
}
/// <summary>
/// 获取可编辑的月份
/// </summary>
/// <returns></returns>
private int GetCurMonth()
{
DateTime nowDate = DateTime.Now;
// 本月
int m = nowDate.Month;
// 上月
int lm = nowDate.AddMonths(-1).Month;
// 当月第几天
int cd = nowDate.Day;
// 下月的第几天
int nd = nowDate.AddMonths(1).Day;
int cm = 0;
if (cd >= 26)
{
cm = m;
}
if (nd <= 20)
{
cm = lm;
}
return cm;
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.WeekReportMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("施工质量月报" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = 500;
this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
/// <summary>
/// 导出方法
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid)
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string html = row.Values[column.ColumnIndex].ToString();
if (column.ColumnID == "tfNumber")
{
html = (row.FindControl("lblNumber") as AspNet.Label).Text;
}
sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
#endregion
}
}

View File

@ -0,0 +1,242 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.CQMS.ManageReport
{
public partial class ManagerMonthC
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// tvControlItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// txtReportYear 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtReportYear;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// txtMonth1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth1;
/// <summary>
/// txtMonth2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth2;
/// <summary>
/// txtMonth3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth3;
/// <summary>
/// txtMonth4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth4;
/// <summary>
/// txtMonth5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth5;
/// <summary>
/// txtMonth6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth6;
/// <summary>
/// txtMonth7 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth7;
/// <summary>
/// txtMonth8 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth8;
/// <summary>
/// txtMonth9 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth9;
/// <summary>
/// txtMonth10 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth10;
/// <summary>
/// txtMonth11 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth11;
/// <summary>
/// txtMonth12 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtMonth12;
}
}

View File

@ -1365,3 +1365,43 @@ IP地址:::1
出错时间:05/21/2023 16:29:44
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.CQMS.ManageReport.ManagerMonthC.BindGrid() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\ManageReport\ManagerMonthC.aspx.cs:行号 73
在 FineUIPro.Web.CQMS.ManageReport.ManagerMonthC.btnNew_Click(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\ManageReport\ManagerMonthC.aspx.cs:行号 611
在 FineUIPro.Button.OnClick(EventArgs e)
在 (Button , EventArgs )
在 FineUIPro.Button.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:05/21/2023 19:42:45
出错文件:http://localhost:1295/CQMS/ManageReport/ManagerMonthC.aspx
IP地址:::1
操作人员:JT
出错时间:05/21/2023 19:42:45
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.CQMS.ManageReport.ManagerMonthC.BindGrid() 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\ManageReport\ManagerMonthC.aspx.cs:行号 73
在 FineUIPro.Web.CQMS.ManageReport.ManagerMonthC.btnNew_Click(Object sender, EventArgs e) 位置 D:\project\vs\sggl_cd\SGGL\FineUIPro.Web\CQMS\ManageReport\ManagerMonthC.aspx.cs:行号 611
在 FineUIPro.Button.OnClick(EventArgs e)
在 (Button , EventArgs )
在 FineUIPro.Button.RaisePostBackEvent(String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
在 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:05/21/2023 19:50:07
出错文件:http://localhost:1295/CQMS/ManageReport/ManagerMonthC.aspx
IP地址:::1
操作人员:JT
出错时间:05/21/2023 19:50:07

View File

@ -473,6 +473,7 @@
<Content Include="CQMS\ManageReport\CheckStatisc.aspx" />
<Content Include="CQMS\ManageReport\DesignChangeStatisc.aspx" />
<Content Include="CQMS\ManageReport\HJGLStatisc.aspx" />
<Content Include="CQMS\ManageReport\ManagerMonthC.aspx" />
<Content Include="CQMS\ManageReport\MonthReport.aspx" />
<Content Include="CQMS\ManageReport\MonthReportEdit.aspx" />
<Content Include="CQMS\ManageReport\MonthReportPrint.aspx" />
@ -7742,6 +7743,13 @@
<Compile Include="CQMS\ManageReport\HJGLStatisc.aspx.designer.cs">
<DependentUpon>HJGLStatisc.aspx</DependentUpon>
</Compile>
<Compile Include="CQMS\ManageReport\ManagerMonthC.aspx.cs">
<DependentUpon>ManagerMonthC.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CQMS\ManageReport\ManagerMonthC.aspx.designer.cs">
<DependentUpon>ManagerMonthC.aspx</DependentUpon>
</Compile>
<Compile Include="CQMS\ManageReport\MonthReport.aspx.cs">
<DependentUpon>MonthReport.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -34,7 +34,7 @@
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:DatePicker runat="server" Label="选择年份" ID="txtReportYear" LabelWidth="100px" Width="200px"
<f:DatePicker runat="server" Label="选择年份" ID="txtReportYear" LabelWidth="100px" Width="200px" DisplayType="Year"
LabelAlign="right" DateFormatString="yyyy">
</f:DatePicker>
<f:Button ID="btnNew" Text="新建" ToolTip="新建" Icon="Add" runat="server"
@ -151,6 +151,7 @@
</form>
<script type="text/javascript">
function onGridAfterEdit(event, value, params) {
debugger
var me = this, columnId = params.columnId, rowId = params.rowId;
var yearTotal = 0;
for (var i = 1; i <= 12; i++)

View File

@ -45,6 +45,6 @@
<TreeNode id="0c65cad2-2279-48fc-b78c-82bfbe01f037" Text="NCR统计" NavigateUrl="CQMS/ManageReport/NCRStatisc.aspx"></TreeNode>
<TreeNode id="267064F1-88F7-4468-998A-49A1A2F25BB8" Text="季度工程项目质量信息表" NavigateUrl="CQMS/ManageReport/QuarterlyProjectQuality.aspx"></TreeNode>
<TreeNode id="51ee983f-085e-4f02-b819-cab049d9cc26" Text="施工质量周报" NavigateUrl="CQMS/ManageReport/WeekReport.aspx"></TreeNode>
<TreeNode id="8048c87a-c2b6-4a0d-bca9-f4f2dca42e5b" Text="施工质量月报" NavigateUrl="CQMS/ManageReport/MonthReport.aspx"></TreeNode>
<TreeNode id="8048c87a-c2b6-4a0d-bca9-f4f2dca42e5b" Text="施工质量月报" NavigateUrl="CQMS/ManageReport/ManagerMonthC.aspx"></TreeNode>
</TreeNode>
</Tree>

View File

@ -683,6 +683,12 @@ 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_MonthReport(CQMS_MonthReport instance);
partial void UpdateCQMS_MonthReport(CQMS_MonthReport instance);
partial void DeleteCQMS_MonthReport(CQMS_MonthReport instance);
partial void InsertCQMS_MonthReportItem(CQMS_MonthReportItem instance);
partial void UpdateCQMS_MonthReportItem(CQMS_MonthReportItem instance);
partial void DeleteCQMS_MonthReportItem(CQMS_MonthReportItem instance);
partial void InsertCQMS_Statement(CQMS_Statement instance);
partial void UpdateCQMS_Statement(CQMS_Statement instance);
partial void DeleteCQMS_Statement(CQMS_Statement instance);
@ -4157,6 +4163,22 @@ namespace Model
}
}
public System.Data.Linq.Table<CQMS_MonthReport> CQMS_MonthReport
{
get
{
return this.GetTable<CQMS_MonthReport>();
}
}
public System.Data.Linq.Table<CQMS_MonthReportItem> CQMS_MonthReportItem
{
get
{
return this.GetTable<CQMS_MonthReportItem>();
}
}
public System.Data.Linq.Table<CQMS_Statement> CQMS_Statement
{
get
@ -24825,6 +24847,8 @@ namespace Model
private EntitySet<CQMS_Information_ConfirmForm> _CQMS_Information_ConfirmForm;
private EntitySet<CQMS_MonthReport> _CQMS_MonthReport;
private EntitySet<CQMS_Statement> _CQMS_Statement;
private EntitySet<CQMS_VisaApplication> _CQMS_VisaApplication;
@ -25395,6 +25419,7 @@ namespace Model
this._CQMS_Foreign_ControlPointCheck = new EntitySet<CQMS_Foreign_ControlPointCheck>(new Action<CQMS_Foreign_ControlPointCheck>(this.attach_CQMS_Foreign_ControlPointCheck), new Action<CQMS_Foreign_ControlPointCheck>(this.detach_CQMS_Foreign_ControlPointCheck));
this._CQMS_Foreign_ITPListProject = new EntitySet<CQMS_Foreign_ITPListProject>(new Action<CQMS_Foreign_ITPListProject>(this.attach_CQMS_Foreign_ITPListProject), new Action<CQMS_Foreign_ITPListProject>(this.detach_CQMS_Foreign_ITPListProject));
this._CQMS_Information_ConfirmForm = new EntitySet<CQMS_Information_ConfirmForm>(new Action<CQMS_Information_ConfirmForm>(this.attach_CQMS_Information_ConfirmForm), new Action<CQMS_Information_ConfirmForm>(this.detach_CQMS_Information_ConfirmForm));
this._CQMS_MonthReport = new EntitySet<CQMS_MonthReport>(new Action<CQMS_MonthReport>(this.attach_CQMS_MonthReport), new Action<CQMS_MonthReport>(this.detach_CQMS_MonthReport));
this._CQMS_Statement = new EntitySet<CQMS_Statement>(new Action<CQMS_Statement>(this.attach_CQMS_Statement), new Action<CQMS_Statement>(this.detach_CQMS_Statement));
this._CQMS_VisaApplication = new EntitySet<CQMS_VisaApplication>(new Action<CQMS_VisaApplication>(this.attach_CQMS_VisaApplication), new Action<CQMS_VisaApplication>(this.detach_CQMS_VisaApplication));
this._CQMS_WorkOrder = new EntitySet<CQMS_WorkOrder>(new Action<CQMS_WorkOrder>(this.attach_CQMS_WorkOrder), new Action<CQMS_WorkOrder>(this.detach_CQMS_WorkOrder));
@ -27325,6 +27350,19 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_CQMS_MonthReport_Base_Project", Storage="_CQMS_MonthReport", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet<CQMS_MonthReport> CQMS_MonthReport
{
get
{
return this._CQMS_MonthReport;
}
set
{
this._CQMS_MonthReport.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_CQMS_Statement_Base_Project", Storage="_CQMS_Statement", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet<CQMS_Statement> CQMS_Statement
{
@ -30950,6 +30988,18 @@ namespace Model
entity.Base_Project = null;
}
private void attach_CQMS_MonthReport(CQMS_MonthReport entity)
{
this.SendPropertyChanging();
entity.Base_Project = this;
}
private void detach_CQMS_MonthReport(CQMS_MonthReport entity)
{
this.SendPropertyChanging();
entity.Base_Project = null;
}
private void attach_CQMS_Statement(CQMS_Statement entity)
{
this.SendPropertyChanging();
@ -113468,6 +113518,720 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_MonthReport")]
public partial class CQMS_MonthReport : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _MonthReportId;
private string _ProjectId;
private System.Nullable<int> _Years;
private EntityRef<Base_Project> _Base_Project;
private EntitySet<CQMS_MonthReportItem> _CQMS_MonthReportItem;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnMonthReportIdChanging(string value);
partial void OnMonthReportIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnYearsChanging(System.Nullable<int> value);
partial void OnYearsChanged();
#endregion
public CQMS_MonthReport()
{
this._Base_Project = default(EntityRef<Base_Project>);
this._CQMS_MonthReportItem = new EntitySet<CQMS_MonthReportItem>(new Action<CQMS_MonthReportItem>(this.attach_CQMS_MonthReportItem), new Action<CQMS_MonthReportItem>(this.detach_CQMS_MonthReportItem));
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MonthReportId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string MonthReportId
{
get
{
return this._MonthReportId;
}
set
{
if ((this._MonthReportId != value))
{
this.OnMonthReportIdChanging(value);
this.SendPropertyChanging();
this._MonthReportId = value;
this.SendPropertyChanged("MonthReportId");
this.OnMonthReportIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
if (this._Base_Project.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Years", DbType="Int")]
public System.Nullable<int> Years
{
get
{
return this._Years;
}
set
{
if ((this._Years != value))
{
this.OnYearsChanging(value);
this.SendPropertyChanging();
this._Years = value;
this.SendPropertyChanged("Years");
this.OnYearsChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_CQMS_MonthReport_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
get
{
return this._Base_Project.Entity;
}
set
{
Base_Project previousValue = this._Base_Project.Entity;
if (((previousValue != value)
|| (this._Base_Project.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Base_Project.Entity = null;
previousValue.CQMS_MonthReport.Remove(this);
}
this._Base_Project.Entity = value;
if ((value != null))
{
value.CQMS_MonthReport.Add(this);
this._ProjectId = value.ProjectId;
}
else
{
this._ProjectId = default(string);
}
this.SendPropertyChanged("Base_Project");
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_CQMS_MonthReportItem_CQMS_MonthReport", Storage="_CQMS_MonthReportItem", ThisKey="MonthReportId", OtherKey="MonthReportId", DeleteRule="NO ACTION")]
public EntitySet<CQMS_MonthReportItem> CQMS_MonthReportItem
{
get
{
return this._CQMS_MonthReportItem;
}
set
{
this._CQMS_MonthReportItem.Assign(value);
}
}
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));
}
}
private void attach_CQMS_MonthReportItem(CQMS_MonthReportItem entity)
{
this.SendPropertyChanging();
entity.CQMS_MonthReport = this;
}
private void detach_CQMS_MonthReportItem(CQMS_MonthReportItem entity)
{
this.SendPropertyChanging();
entity.CQMS_MonthReport = null;
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.CQMS_MonthReportItem")]
public partial class CQMS_MonthReportItem : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _MonthReportItemId;
private string _MonthReportId;
private string _ReportItem;
private string _Unit;
private System.Nullable<int> _Sort;
private System.Nullable<int> _Month1;
private System.Nullable<int> _Month2;
private System.Nullable<int> _Month3;
private System.Nullable<int> _Month4;
private System.Nullable<int> _Month5;
private System.Nullable<int> _Month6;
private System.Nullable<int> _Month7;
private System.Nullable<int> _Month8;
private System.Nullable<int> _Month9;
private System.Nullable<int> _Month10;
private System.Nullable<int> _Month11;
private System.Nullable<int> _Month12;
private System.Nullable<int> _YearTotal;
private System.Nullable<int> _ProjectTotal;
private EntityRef<CQMS_MonthReport> _CQMS_MonthReport;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnMonthReportItemIdChanging(string value);
partial void OnMonthReportItemIdChanged();
partial void OnMonthReportIdChanging(string value);
partial void OnMonthReportIdChanged();
partial void OnReportItemChanging(string value);
partial void OnReportItemChanged();
partial void OnUnitChanging(string value);
partial void OnUnitChanged();
partial void OnSortChanging(System.Nullable<int> value);
partial void OnSortChanged();
partial void OnMonth1Changing(System.Nullable<int> value);
partial void OnMonth1Changed();
partial void OnMonth2Changing(System.Nullable<int> value);
partial void OnMonth2Changed();
partial void OnMonth3Changing(System.Nullable<int> value);
partial void OnMonth3Changed();
partial void OnMonth4Changing(System.Nullable<int> value);
partial void OnMonth4Changed();
partial void OnMonth5Changing(System.Nullable<int> value);
partial void OnMonth5Changed();
partial void OnMonth6Changing(System.Nullable<int> value);
partial void OnMonth6Changed();
partial void OnMonth7Changing(System.Nullable<int> value);
partial void OnMonth7Changed();
partial void OnMonth8Changing(System.Nullable<int> value);
partial void OnMonth8Changed();
partial void OnMonth9Changing(System.Nullable<int> value);
partial void OnMonth9Changed();
partial void OnMonth10Changing(System.Nullable<int> value);
partial void OnMonth10Changed();
partial void OnMonth11Changing(System.Nullable<int> value);
partial void OnMonth11Changed();
partial void OnMonth12Changing(System.Nullable<int> value);
partial void OnMonth12Changed();
partial void OnYearTotalChanging(System.Nullable<int> value);
partial void OnYearTotalChanged();
partial void OnProjectTotalChanging(System.Nullable<int> value);
partial void OnProjectTotalChanged();
#endregion
public CQMS_MonthReportItem()
{
this._CQMS_MonthReport = default(EntityRef<CQMS_MonthReport>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MonthReportItemId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string MonthReportItemId
{
get
{
return this._MonthReportItemId;
}
set
{
if ((this._MonthReportItemId != value))
{
this.OnMonthReportItemIdChanging(value);
this.SendPropertyChanging();
this._MonthReportItemId = value;
this.SendPropertyChanged("MonthReportItemId");
this.OnMonthReportItemIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MonthReportId", DbType="NVarChar(50)")]
public string MonthReportId
{
get
{
return this._MonthReportId;
}
set
{
if ((this._MonthReportId != value))
{
if (this._CQMS_MonthReport.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnMonthReportIdChanging(value);
this.SendPropertyChanging();
this._MonthReportId = value;
this.SendPropertyChanged("MonthReportId");
this.OnMonthReportIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportItem", DbType="NVarChar(50)")]
public string ReportItem
{
get
{
return this._ReportItem;
}
set
{
if ((this._ReportItem != value))
{
this.OnReportItemChanging(value);
this.SendPropertyChanging();
this._ReportItem = value;
this.SendPropertyChanged("ReportItem");
this.OnReportItemChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Unit", DbType="NVarChar(10)")]
public string Unit
{
get
{
return this._Unit;
}
set
{
if ((this._Unit != value))
{
this.OnUnitChanging(value);
this.SendPropertyChanging();
this._Unit = value;
this.SendPropertyChanged("Unit");
this.OnUnitChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")]
public System.Nullable<int> Sort
{
get
{
return this._Sort;
}
set
{
if ((this._Sort != value))
{
this.OnSortChanging(value);
this.SendPropertyChanging();
this._Sort = value;
this.SendPropertyChanged("Sort");
this.OnSortChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month1", DbType="Int")]
public System.Nullable<int> Month1
{
get
{
return this._Month1;
}
set
{
if ((this._Month1 != value))
{
this.OnMonth1Changing(value);
this.SendPropertyChanging();
this._Month1 = value;
this.SendPropertyChanged("Month1");
this.OnMonth1Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month2", DbType="Int")]
public System.Nullable<int> Month2
{
get
{
return this._Month2;
}
set
{
if ((this._Month2 != value))
{
this.OnMonth2Changing(value);
this.SendPropertyChanging();
this._Month2 = value;
this.SendPropertyChanged("Month2");
this.OnMonth2Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month3", DbType="Int")]
public System.Nullable<int> Month3
{
get
{
return this._Month3;
}
set
{
if ((this._Month3 != value))
{
this.OnMonth3Changing(value);
this.SendPropertyChanging();
this._Month3 = value;
this.SendPropertyChanged("Month3");
this.OnMonth3Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month4", DbType="Int")]
public System.Nullable<int> Month4
{
get
{
return this._Month4;
}
set
{
if ((this._Month4 != value))
{
this.OnMonth4Changing(value);
this.SendPropertyChanging();
this._Month4 = value;
this.SendPropertyChanged("Month4");
this.OnMonth4Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month5", DbType="Int")]
public System.Nullable<int> Month5
{
get
{
return this._Month5;
}
set
{
if ((this._Month5 != value))
{
this.OnMonth5Changing(value);
this.SendPropertyChanging();
this._Month5 = value;
this.SendPropertyChanged("Month5");
this.OnMonth5Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month6", DbType="Int")]
public System.Nullable<int> Month6
{
get
{
return this._Month6;
}
set
{
if ((this._Month6 != value))
{
this.OnMonth6Changing(value);
this.SendPropertyChanging();
this._Month6 = value;
this.SendPropertyChanged("Month6");
this.OnMonth6Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month7", DbType="Int")]
public System.Nullable<int> Month7
{
get
{
return this._Month7;
}
set
{
if ((this._Month7 != value))
{
this.OnMonth7Changing(value);
this.SendPropertyChanging();
this._Month7 = value;
this.SendPropertyChanged("Month7");
this.OnMonth7Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month8", DbType="Int")]
public System.Nullable<int> Month8
{
get
{
return this._Month8;
}
set
{
if ((this._Month8 != value))
{
this.OnMonth8Changing(value);
this.SendPropertyChanging();
this._Month8 = value;
this.SendPropertyChanged("Month8");
this.OnMonth8Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month9", DbType="Int")]
public System.Nullable<int> Month9
{
get
{
return this._Month9;
}
set
{
if ((this._Month9 != value))
{
this.OnMonth9Changing(value);
this.SendPropertyChanging();
this._Month9 = value;
this.SendPropertyChanged("Month9");
this.OnMonth9Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month10", DbType="Int")]
public System.Nullable<int> Month10
{
get
{
return this._Month10;
}
set
{
if ((this._Month10 != value))
{
this.OnMonth10Changing(value);
this.SendPropertyChanging();
this._Month10 = value;
this.SendPropertyChanged("Month10");
this.OnMonth10Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month11", DbType="Int")]
public System.Nullable<int> Month11
{
get
{
return this._Month11;
}
set
{
if ((this._Month11 != value))
{
this.OnMonth11Changing(value);
this.SendPropertyChanging();
this._Month11 = value;
this.SendPropertyChanged("Month11");
this.OnMonth11Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Month12", DbType="Int")]
public System.Nullable<int> Month12
{
get
{
return this._Month12;
}
set
{
if ((this._Month12 != value))
{
this.OnMonth12Changing(value);
this.SendPropertyChanging();
this._Month12 = value;
this.SendPropertyChanged("Month12");
this.OnMonth12Changed();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearTotal", DbType="Int")]
public System.Nullable<int> YearTotal
{
get
{
return this._YearTotal;
}
set
{
if ((this._YearTotal != value))
{
this.OnYearTotalChanging(value);
this.SendPropertyChanging();
this._YearTotal = value;
this.SendPropertyChanged("YearTotal");
this.OnYearTotalChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectTotal", DbType="Int")]
public System.Nullable<int> ProjectTotal
{
get
{
return this._ProjectTotal;
}
set
{
if ((this._ProjectTotal != value))
{
this.OnProjectTotalChanging(value);
this.SendPropertyChanging();
this._ProjectTotal = value;
this.SendPropertyChanged("ProjectTotal");
this.OnProjectTotalChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_CQMS_MonthReportItem_CQMS_MonthReport", Storage="_CQMS_MonthReport", ThisKey="MonthReportId", OtherKey="MonthReportId", IsForeignKey=true)]
public CQMS_MonthReport CQMS_MonthReport
{
get
{
return this._CQMS_MonthReport.Entity;
}
set
{
CQMS_MonthReport previousValue = this._CQMS_MonthReport.Entity;
if (((previousValue != value)
|| (this._CQMS_MonthReport.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._CQMS_MonthReport.Entity = null;
previousValue.CQMS_MonthReportItem.Remove(this);
}
this._CQMS_MonthReport.Entity = value;
if ((value != null))
{
value.CQMS_MonthReportItem.Add(this);
this._MonthReportId = value.MonthReportId;
}
else
{
this._MonthReportId = default(string);
}
this.SendPropertyChanged("CQMS_MonthReport");
}
}
}
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_Statement")]
public partial class CQMS_Statement : INotifyPropertyChanging, INotifyPropertyChanged
{