20240322 质量月报
This commit is contained in:
@@ -42,7 +42,25 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#region 列表集合
|
||||
private static List<Model.Report_CqmsTarget> detailsGrid1 = new List<Model.Report_CqmsTarget>();
|
||||
|
||||
/// <summary>
|
||||
/// 18.本月质量问题处理情况
|
||||
/// (1)原材料问题
|
||||
/// </summary>
|
||||
private static List<Model.Report_RowMaterialProblem> rowMaterialProblemLists = new List<Model.Report_RowMaterialProblem>();
|
||||
|
||||
/// <summary>
|
||||
/// 18.本月质量问题处理情况
|
||||
/// (2)施工过程问题
|
||||
/// </summary>
|
||||
private static List<Model.Report_ConstructionProblems> constructionProblemsLists = new List<Model.Report_ConstructionProblems>();
|
||||
|
||||
/// <summary>
|
||||
/// 19.下月质量控制重点
|
||||
/// </summary>
|
||||
private static List<Model.Report_NextQualityControl> nextQualityControlLists = new List<Model.Report_NextQualityControl>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
@@ -55,6 +73,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
{
|
||||
this.EnableViewState = true;
|
||||
this.lblProjectName.Text = BLL.ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId).ProjectName;
|
||||
BLL.UnitService.InitUnitNameByProjectIdUnitTypeDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, BLL.Const.ProjectUnitType_2, false);
|
||||
this.ReportId = Request.Params["reportId"];
|
||||
if (!string.IsNullOrEmpty(Request.Params["view"]))
|
||||
{
|
||||
@@ -82,7 +101,7 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
AddOrUpdate = "update";
|
||||
|
||||
#region 加载本月质量目标管理情况
|
||||
#region 加载本月质量目标管理情况
|
||||
detailsGrid1.Clear();
|
||||
detailsGrid1 = (from x in Funs.DB.Report_CqmsTarget
|
||||
where x.ReportId == this.ReportId
|
||||
@@ -97,6 +116,44 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载18.本月质量问题处理情况
|
||||
//(1)原材料问题
|
||||
rowMaterialProblemLists.Clear();
|
||||
rowMaterialProblemLists = (from x in Funs.DB.Report_RowMaterialProblem
|
||||
where x.ReportId == this.ReportId
|
||||
select x).ToList();
|
||||
if (rowMaterialProblemLists.Count > 0)
|
||||
{
|
||||
gvRowMaterialProblem.Hidden = false;
|
||||
gvRowMaterialProblem.DataSource = rowMaterialProblemLists;
|
||||
gvRowMaterialProblem.DataBind();
|
||||
}
|
||||
//(2)施工过程问题
|
||||
constructionProblemsLists.Clear();
|
||||
constructionProblemsLists = (from x in Funs.DB.Report_ConstructionProblems
|
||||
where x.ReportId == this.ReportId
|
||||
select x).ToList();
|
||||
if (constructionProblemsLists.Count>0)
|
||||
{
|
||||
gvConstructionProblems.Hidden = false;
|
||||
gvConstructionProblems.DataSource = constructionProblemsLists;
|
||||
gvConstructionProblems.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载19.下月质量控制重点
|
||||
nextQualityControlLists.Clear();
|
||||
nextQualityControlLists = (from x in Funs.DB.Report_NextQualityControl
|
||||
where x.ReportId == this.ReportId
|
||||
select x).ToList();
|
||||
if (nextQualityControlLists.Count>0)
|
||||
{
|
||||
gvNextQualityControl.Hidden = false;
|
||||
gvNextQualityControl.DataSource = nextQualityControlLists;
|
||||
gvNextQualityControl.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载文本框内容
|
||||
var txtReportList = Funs.DB.Report_TextBoxContent.Where(x => x.ReportId == ReportId).ToList();
|
||||
txtAre0.Text = txtReportList.FirstOrDefault(x => x.ContentType == "0").ContentText;
|
||||
@@ -108,7 +165,8 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
txtAre22.Text = txtReportList.FirstOrDefault(x => x.ContentType == "22").ContentText;
|
||||
#endregion
|
||||
|
||||
|
||||
//加载所有grid
|
||||
lodAllGrid("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -117,6 +175,9 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
//给个新的主键
|
||||
ReportId = Guid.NewGuid().ToString();
|
||||
AddOrUpdate = "add";
|
||||
|
||||
//加载所有grid
|
||||
lodAllGrid("0");
|
||||
}
|
||||
hidReportId.Value = ReportId;
|
||||
}
|
||||
@@ -228,6 +289,15 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
//所有文本框表
|
||||
TextBoxContentService.Delete(ReportId);
|
||||
|
||||
// 15.质量巡检情况 16.质量专项检查情况 17.质量文件上报情况
|
||||
BLL.Report_CQMS_MonthReportItemService.DeleteReportItemByReportId(ReportId);
|
||||
//18.本月质量问题处理情况(1)原材料问题
|
||||
BLL.RowMaterialProblemService.DeleteRowMaterialProbleByReportId(ReportId);
|
||||
//18.本月质量问题处理情况(2)施工过程问题
|
||||
BLL.ConstructionProblemsService.DeleteConstructionProblemsByReportId(ReportId);
|
||||
//19.下月质量控制重点
|
||||
BLL.NextQualityControlService.DeleteNextQualityControlByReportId(ReportId);
|
||||
#endregion
|
||||
|
||||
#region 保存所有子表
|
||||
@@ -236,6 +306,21 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
|
||||
//保存文本框
|
||||
saveTxtContent();
|
||||
|
||||
|
||||
|
||||
//保存15.质量巡检情况
|
||||
saveQualityInspection();
|
||||
//保存16.质量专项检查情况
|
||||
saveSpecialCheck();
|
||||
//保存17.质量文件上报情况
|
||||
saveFileReport();
|
||||
//保存18.(1)原材料问题
|
||||
saveRowMaterialProblem();
|
||||
//保存18.(2)施工过程问题
|
||||
saveConstructionProblems();
|
||||
//保存19.下月质量控制重点
|
||||
saveNextQualityControl();
|
||||
#endregion
|
||||
|
||||
if (AddOrUpdate == "add")
|
||||
@@ -340,5 +425,607 @@ namespace FineUIPro.Web.CQMS.ManageReportNew
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
void lodAllGrid(string objType)
|
||||
{
|
||||
//加载15.质量巡检情况
|
||||
loadQualityInspection(objType);
|
||||
//加载16.质量专项检查情况
|
||||
loadSpecialCheck(objType);
|
||||
//加载17.质量文件上报情况
|
||||
loadFileReport(objType);
|
||||
}
|
||||
|
||||
#region 15.质量巡检情况 gvQualityInspection方法
|
||||
/// <summary>
|
||||
/// 加载质量巡检情况
|
||||
/// </summary>
|
||||
void loadQualityInspection(string objType)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
||||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
int i = 1;
|
||||
|
||||
int Quantity1Sum = 0;
|
||||
int Quantity2Sum = 0;
|
||||
//加载所有单位
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
||||
orderby y.UnitCode
|
||||
select new { x.UnitId, y.UnitName };
|
||||
foreach (var item in units)
|
||||
{
|
||||
var query = from c in db.Check_CheckControl
|
||||
join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
||||
from u in unitJoin.DefaultIfEmpty()
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
||||
select new
|
||||
{
|
||||
c.CheckDate,
|
||||
c.ProjectId,
|
||||
u.UnitId,
|
||||
u.UnitName
|
||||
};
|
||||
var AllList = query.ToList();
|
||||
var monethCount = query
|
||||
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
||||
|
||||
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.ContentName = item.UnitName;
|
||||
model.MonthsCount = monethCount.Count();
|
||||
model.ProjectCount = AllList.Count();
|
||||
model.ReportId = ReportId;
|
||||
//如果是修改,查询表中数据
|
||||
if (objType == "1")
|
||||
{
|
||||
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "1");
|
||||
if (NewModel != null)
|
||||
{
|
||||
model.RectificationRate = NewModel.RectificationRate;
|
||||
model.Remarks = NewModel.Remarks;
|
||||
}
|
||||
}
|
||||
list.Add(model);
|
||||
|
||||
Quantity1Sum += monethCount.Count();
|
||||
Quantity2Sum += AllList.Count();
|
||||
i++;
|
||||
}
|
||||
gvQualityInspection.DataSource = list;
|
||||
gvQualityInspection.DataBind();
|
||||
|
||||
//合计
|
||||
JObject summary = new JObject();
|
||||
summary.Add("ContentName", "合计");
|
||||
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
||||
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
||||
|
||||
gvQualityInspection.SummaryData = summary;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 16.质量专项检查情况 gvSpecialCheck方法
|
||||
/// <summary>
|
||||
/// 加载质量专项检查情况
|
||||
/// </summary>
|
||||
void loadSpecialCheck(string objType)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
||||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
int i = 1;
|
||||
|
||||
int Quantity1Sum = 0;
|
||||
int Quantity2Sum = 0;
|
||||
|
||||
//加载检查类别
|
||||
var lists = BLL.JointCheckService.GetCheckTypeList();
|
||||
foreach (var item in lists)
|
||||
{
|
||||
var query = from c in db.Check_JointCheck
|
||||
where c.ProjectId == this.CurrUser.LoginProjectId && c.CheckType == item.Key.ToString()
|
||||
select new
|
||||
{
|
||||
c.CheckDate,
|
||||
c.ProjectId,
|
||||
c.CheckType
|
||||
};
|
||||
var AllList = query.ToList();
|
||||
var monethCount = query
|
||||
.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
||||
|
||||
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.ContentName = item.Value;
|
||||
model.MonthsCount = monethCount.Count();
|
||||
model.ProjectCount = AllList.Count();
|
||||
model.ReportId = ReportId;
|
||||
//如果是修改,查询表中数据
|
||||
if (objType == "1")
|
||||
{
|
||||
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.Value && x.ReType == "2");
|
||||
if (NewModel != null)
|
||||
{
|
||||
model.Remarks = NewModel.Remarks;
|
||||
}
|
||||
}
|
||||
list.Add(model);
|
||||
|
||||
Quantity1Sum += monethCount.Count();
|
||||
Quantity2Sum += AllList.Count();
|
||||
i++;
|
||||
}
|
||||
|
||||
gvSpecialCheck.DataSource = list;
|
||||
gvSpecialCheck.DataBind();
|
||||
|
||||
//合计
|
||||
JObject summary = new JObject();
|
||||
summary.Add("ContentName", "合计");
|
||||
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
||||
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
||||
|
||||
gvSpecialCheck.SummaryData = summary;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 17.质量文件上报情况 gvFileReport方法
|
||||
/// <summary>
|
||||
/// 加载质量文件上报情况
|
||||
/// </summary>
|
||||
void loadFileReport(string objType)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text.Trim());
|
||||
DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text.Trim());
|
||||
var list = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
int i = 1;
|
||||
|
||||
int Quantity1Sum = 0;
|
||||
int Quantity2Sum = 0;
|
||||
int Quantity3Sum = 0;
|
||||
int Quantity4Sum = 0;
|
||||
//加载所有单位
|
||||
var units = from x in Funs.DB.Project_ProjectUnit
|
||||
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && (x.UnitType == BLL.Const.ProjectUnitType_2 || x.UnitType == BLL.Const.ProjectUnitType_1)
|
||||
orderby y.UnitCode
|
||||
select new { x.UnitId, y.UnitName };
|
||||
foreach (var item in units)
|
||||
{
|
||||
//var query = from c in db.Check_CheckControl
|
||||
// join u in db.Base_Unit on c.UnitId equals u.UnitId into unitJoin
|
||||
// from u in unitJoin.DefaultIfEmpty()
|
||||
// where c.ProjectId == this.CurrUser.LoginProjectId && c.UnitId == item.UnitId
|
||||
// select new
|
||||
// {
|
||||
// c.CheckDate,
|
||||
// c.ProjectId,
|
||||
// u.UnitId,
|
||||
// u.UnitName
|
||||
// };
|
||||
//var AllList = query.ToList();//项目数
|
||||
//本月数
|
||||
//var monethCount = query.Where(x => (x.CheckDate >= Convert.ToDateTime(startDate) && x.CheckDate <= Convert.ToDateTime(endDate)));
|
||||
//var yzCount = 0;//本月业主/ 监理返回数量
|
||||
//var NoBackCount = 0;//累计未返回数量
|
||||
Model.Report_CQMS_MonthReportItem model = new Model.Report_CQMS_MonthReportItem();
|
||||
model.Id = Guid.NewGuid().ToString();
|
||||
model.ContentName = item.UnitName;
|
||||
//model.MonthsCount = monethCount.Count();
|
||||
//model.ProjectCount = AllList.Count();
|
||||
//model.MonthsBackCount =;
|
||||
//model.TotalNoBackCount =;
|
||||
model.ReportId = ReportId;
|
||||
//如果是修改,查询表中数据
|
||||
if (objType == "1")
|
||||
{
|
||||
var NewModel = db.Report_CQMS_MonthReportItem.FirstOrDefault(x => x.ReportId == ReportId && x.ContentName == item.UnitName && x.ReType == "3");
|
||||
if (NewModel != null)
|
||||
{
|
||||
model.Remarks = NewModel.Remarks;
|
||||
}
|
||||
}
|
||||
list.Add(model);
|
||||
|
||||
//Quantity1Sum += monethCount.Count();
|
||||
//Quantity2Sum += AllList.Count();
|
||||
//Quantity3Sum += yzCount.Count();
|
||||
//Quantity4Sum += NoBackCount.Count();
|
||||
i++;
|
||||
}
|
||||
gvFileReport.DataSource = list;
|
||||
gvFileReport.DataBind();
|
||||
|
||||
//合计
|
||||
JObject summary = new JObject();
|
||||
summary.Add("ContentName", "合计");
|
||||
summary.Add("MonthsCount", Quantity1Sum.ToString());
|
||||
summary.Add("ProjectCount", Quantity2Sum.ToString());
|
||||
summary.Add("MonthsBackCount", Quantity3Sum.ToString());
|
||||
summary.Add("TotalNoBackCount", Quantity4Sum.ToString());
|
||||
|
||||
gvFileReport.SummaryData = summary;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 18.本月质量问题处理情况
|
||||
#region gvRowMaterialProblem 事件
|
||||
/// <summary>
|
||||
/// 增加原材料问题
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnRowMaterialProblem_Click(object sender, EventArgs e)
|
||||
{
|
||||
gvRowMaterialProblem.Hidden = false;
|
||||
|
||||
JArray teamGroupData = gvRowMaterialProblem.GetMergedData();
|
||||
List<JObject> list = new List<JObject>();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
values.Add("Id", teamGroupRow.Value<string>("id"));
|
||||
list.Add(values);
|
||||
}
|
||||
JObject defaultObj = new JObject
|
||||
{ { "RowMaterialProblemId",Guid.NewGuid().ToString() },
|
||||
{ "ReportId", ReportId },
|
||||
{ "UnitId", "" },
|
||||
{ "ProblemDesrioption",""},
|
||||
{ "TreatmentMeasures", "" },
|
||||
{ "ProcessingResults","" },
|
||||
{ "Remark", "" },
|
||||
{ "delRowMaterialProblem", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteRowMaterialProblem(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
||||
};
|
||||
list.Add(defaultObj);
|
||||
gvRowMaterialProblem.DataSource = list;
|
||||
gvRowMaterialProblem.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据前事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void gvRowMaterialProblem_PreDataBound(object sender, EventArgs e)
|
||||
{
|
||||
// 设置LinkButtonField的点击客户端事件
|
||||
LinkButtonField deleteField = gvRowMaterialProblem.FindColumn("delRowMaterialProblem") as LinkButtonField;
|
||||
deleteField.OnClientClick = GetDeleteRowMaterialProblem();
|
||||
}
|
||||
/// <summary>
|
||||
/// 删除提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetDeleteRowMaterialProblem()
|
||||
{
|
||||
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, gvRowMaterialProblem.GetDeleteSelectedRowsReference(), String.Empty);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region gvConstructionProblems 事件
|
||||
/// <summary>
|
||||
/// 增加施工过程问题
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAddConstructionProblems_Click(object sender, EventArgs e)
|
||||
{
|
||||
gvConstructionProblems.Hidden = false;
|
||||
|
||||
JArray teamGroupData = gvConstructionProblems.GetMergedData();
|
||||
List<JObject> list = new List<JObject>();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
values.Add("Id", teamGroupRow.Value<string>("id"));
|
||||
list.Add(values);
|
||||
}
|
||||
JObject defaultObj = new JObject
|
||||
{ { "ConstructionProblemsId",Guid.NewGuid() },
|
||||
{ "ReportId", ReportId },
|
||||
{ "UnitId", "" },
|
||||
{ "ProblemDesrioption",""},
|
||||
{ "TreatmentMeasures", "" },
|
||||
{ "ProcessingResults","" },
|
||||
{ "Remark", "" },
|
||||
{ "delConstructionProblems", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteConstructionProblems(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
||||
};
|
||||
list.Add(defaultObj);
|
||||
gvConstructionProblems.DataSource = list;
|
||||
gvConstructionProblems.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据前事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void gvConstructionProblems_PreDataBound(object sender, EventArgs e)
|
||||
{
|
||||
// 设置LinkButtonField的点击客户端事件
|
||||
LinkButtonField deleteField = gvConstructionProblems.FindColumn("delConstructionProblems") as LinkButtonField;
|
||||
deleteField.OnClientClick = GetDeleteConstructionProblems();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetDeleteConstructionProblems()
|
||||
{
|
||||
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, gvConstructionProblems.GetDeleteSelectedRowsReference(), String.Empty);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 19.下月质量控制重点
|
||||
/// <summary>
|
||||
/// gvNextQualityControl加载前事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void gvNextQualityControl_PreDataBound(object sender, EventArgs e)
|
||||
{
|
||||
// 设置LinkButtonField的点击客户端事件
|
||||
LinkButtonField deleteField = gvNextQualityControl.FindColumn("delNextQualityControl") as LinkButtonField;
|
||||
deleteField.OnClientClick = GetDeleteNextQualityControl();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAddNextControl_Click(object sender, EventArgs e)
|
||||
{
|
||||
gvNextQualityControl.Hidden = false;
|
||||
|
||||
JArray teamGroupData = gvNextQualityControl.GetMergedData();
|
||||
List<JObject> list = new List<JObject>();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
values.Add("Id", teamGroupRow.Value<string>("id"));
|
||||
list.Add(values);
|
||||
}
|
||||
JObject defaultObj = new JObject
|
||||
{ { "NextQualityControlId",Guid.NewGuid().ToString() },
|
||||
{ "ReportId", ReportId },
|
||||
{ "NextQualityControlContent", "" },
|
||||
{ "delNextQualityControl", String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>", GetDeleteNextQualityControl(), IconHelper.GetResolvedIconUrl(Icon.Delete)) }
|
||||
};
|
||||
list.Add(defaultObj);
|
||||
gvNextQualityControl.DataSource = list;
|
||||
gvNextQualityControl.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除提示
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetDeleteNextQualityControl()
|
||||
{
|
||||
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, gvNextQualityControl.GetDeleteSelectedRowsReference(), String.Empty);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存方法
|
||||
#region 15.质量巡检情况
|
||||
/// <summary>
|
||||
/// 15.质量巡检情况
|
||||
/// </summary>
|
||||
void saveQualityInspection()
|
||||
{
|
||||
List<Model.Report_CQMS_MonthReportItem> detailLists = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
JArray teamGroupData = gvQualityInspection.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem
|
||||
{
|
||||
ReportId = ReportId,
|
||||
ReType = "1",
|
||||
ContentName = values.Value<string>("ContentName"),
|
||||
MonthsCount = values.Value<int>("MonthsCount"),
|
||||
ProjectCount = values.Value<int>("ProjectCount"),
|
||||
RectificationRate = values.Value<string>("RectificationRate"),
|
||||
Remarks = values.Value<string>("Remarks")
|
||||
};
|
||||
if (gvQualityInspection.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
newDetail.Id = gvQualityInspection.Rows[rowIndex].DataKeys[0].ToString();
|
||||
}
|
||||
detailLists.Add(newDetail);
|
||||
}
|
||||
if (detailLists.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 16.质量专项检查情况
|
||||
/// <summary>
|
||||
/// 16.质量专项检查情况
|
||||
/// </summary>
|
||||
void saveSpecialCheck()
|
||||
{
|
||||
List<Model.Report_CQMS_MonthReportItem> detailLists = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
JArray teamGroupData = gvSpecialCheck.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem
|
||||
{
|
||||
ReportId = ReportId,
|
||||
ReType = "2",
|
||||
ContentName = values.Value<string>("ContentName"),
|
||||
MonthsCount = values.Value<int>("MonthsCount"),
|
||||
ProjectCount = values.Value<int>("ProjectCount"),
|
||||
Remarks = values.Value<string>("Remarks")
|
||||
};
|
||||
if (gvSpecialCheck.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
newDetail.Id = gvSpecialCheck.Rows[rowIndex].DataKeys[0].ToString();
|
||||
}
|
||||
detailLists.Add(newDetail);
|
||||
}
|
||||
if (detailLists.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 17.质量文件上报情况
|
||||
/// <summary>
|
||||
/// 17.质量文件上报情况
|
||||
/// </summary>
|
||||
void saveFileReport()
|
||||
{
|
||||
List<Model.Report_CQMS_MonthReportItem> detailLists = new List<Model.Report_CQMS_MonthReportItem>();
|
||||
JArray teamGroupData = gvFileReport.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
Model.Report_CQMS_MonthReportItem newDetail = new Model.Report_CQMS_MonthReportItem
|
||||
{
|
||||
ReportId = ReportId,
|
||||
ReType = "3",
|
||||
ContentName = values.Value<string>("ContentName"),
|
||||
//MonthsCount = Funs.GetNewInt(values.Value<int>("MonthsCount").ToString()),
|
||||
//ProjectCount = Funs.GetNewInt(values.Value<int>("ProjectCount").ToString()),
|
||||
//MonthsBackCount = Funs.GetNewInt(values.Value<int>("MonthsBackCount").ToString()),
|
||||
//TotalNoBackCount = Funs.GetNewInt(values.Value<int>("TotalNoBackCount").ToString())
|
||||
};
|
||||
if (gvFileReport.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
newDetail.Id = gvFileReport.Rows[rowIndex].DataKeys[0].ToString();
|
||||
}
|
||||
detailLists.Add(newDetail);
|
||||
}
|
||||
if (detailLists.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_CQMS_MonthReportItem.InsertAllOnSubmit(detailLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 18.本月质量问题处理情况
|
||||
/// <summary>
|
||||
/// (1)原材料问题
|
||||
/// </summary>
|
||||
void saveRowMaterialProblem()
|
||||
{
|
||||
List<Model.Report_RowMaterialProblem> detailLists = new List<Model.Report_RowMaterialProblem>();
|
||||
JArray teamGroupData = gvRowMaterialProblem.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
Model.Report_RowMaterialProblem newDetail = new Model.Report_RowMaterialProblem
|
||||
{
|
||||
ReportId = ReportId,
|
||||
UnitId = values.Value<string>("UnitId"),
|
||||
ProblemDesrioption = values.Value<string>("ProblemDesrioption"),
|
||||
TreatmentMeasures = values.Value<string>("TreatmentMeasures"),
|
||||
ProcessingResults = values.Value<string>("ProcessingResults"),
|
||||
Remark = values.Value<string>("Remark")
|
||||
};
|
||||
if (gvRowMaterialProblem.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
newDetail.RowMaterialProblemId = gvRowMaterialProblem.Rows[rowIndex].DataKeys[0].ToString();
|
||||
}
|
||||
detailLists.Add(newDetail);
|
||||
}
|
||||
if (detailLists.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_RowMaterialProblem.InsertAllOnSubmit(detailLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// (2)施工过程问题
|
||||
/// </summary>
|
||||
void saveConstructionProblems()
|
||||
{
|
||||
List<Model.Report_ConstructionProblems> detailLists = new List<Model.Report_ConstructionProblems>();
|
||||
JArray teamGroupData = gvConstructionProblems.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
Model.Report_ConstructionProblems newDetail = new Model.Report_ConstructionProblems
|
||||
{
|
||||
ReportId = ReportId,
|
||||
UnitId = values.Value<string>("UnitId"),
|
||||
ProblemDesrioption = values.Value<string>("ProblemDesrioption"),
|
||||
TreatmentMeasures = values.Value<string>("TreatmentMeasures"),
|
||||
ProcessingResults = values.Value<string>("ProcessingResults"),
|
||||
Remark = values.Value<string>("Remark")
|
||||
};
|
||||
if (gvConstructionProblems.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
newDetail.ConstructionProblemsId = gvConstructionProblems.Rows[rowIndex].DataKeys[0].ToString();
|
||||
}
|
||||
detailLists.Add(newDetail);
|
||||
}
|
||||
if (detailLists.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_ConstructionProblems.InsertAllOnSubmit(detailLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 19.下月质量控制重点
|
||||
/// <summary>
|
||||
/// 下月质量控制重点
|
||||
/// </summary>
|
||||
void saveNextQualityControl()
|
||||
{
|
||||
List<Model.Report_NextQualityControl> detailLists = new List<Model.Report_NextQualityControl>();
|
||||
JArray teamGroupData = gvNextQualityControl.GetMergedData();
|
||||
foreach (JObject teamGroupRow in teamGroupData)
|
||||
{
|
||||
JObject values = teamGroupRow.Value<JObject>("values");
|
||||
int rowIndex = teamGroupRow.Value<int>("index");
|
||||
Model.Report_NextQualityControl newDetail = new Model.Report_NextQualityControl
|
||||
{
|
||||
ReportId = ReportId,
|
||||
NextQualityControlContent = values.Value<string>("NextQualityControlContent")
|
||||
};
|
||||
if (gvNextQualityControl.Rows[rowIndex].DataKeys.Length > 0)
|
||||
{
|
||||
newDetail.NextQualityControlId = gvNextQualityControl.Rows[rowIndex].DataKeys[0].ToString();
|
||||
}
|
||||
detailLists.Add(newDetail);
|
||||
}
|
||||
if (detailLists.Count > 0)
|
||||
{
|
||||
Funs.DB.Report_NextQualityControl.InsertAllOnSubmit(detailLists);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user