From e3bdc5b3fc5042ec079c7c44668d4bf370151050 Mon Sep 17 00:00:00 2001 From: fei550 <1420031550@qq.com> Date: Thu, 4 Jun 2026 16:28:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=84=8A=E6=8E=A5=E7=AE=A1=E7=90=86=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBase/版本日志/SGGLDB_V2026-06-03-lpf.sql | 103 ++ .../HJGL/PreDesign/PackagingManageService .cs | 117 +- .../HJGL/PreDesign/InstallList.aspx | 14 +- .../HJGL/PreDesign/InstallList.aspx.cs | 82 +- .../WeldingManage/PipelineListPDMSIn.aspx.cs | 121 +- SGGL/Model/Model.cs | 1082 ++++++++++++----- 6 files changed, 1124 insertions(+), 395 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2026-06-03-lpf.sql diff --git a/DataBase/版本日志/SGGLDB_V2026-06-03-lpf.sql b/DataBase/版本日志/SGGLDB_V2026-06-03-lpf.sql new file mode 100644 index 00000000..dcd3cdf7 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-06-03-lpf.sql @@ -0,0 +1,103 @@ + + + +ALTER VIEW [dbo].[View_HJGL_InstallData] + AS + WITH TwOutPutData as (select distinct twRelation.PipelineId, + outdetail.Id as TwOutputDetailId, + twRelation.MaterialCode, + master.Id as OutputMasterId, + LEFT(planmaster.WeldTaskId, CHARINDEX('|', planmaster.WeldTaskId + '|') - 1) AS unitworkid + from Tw_OutputMaster master + join Tw_OutputDetail outdetail on outdetail.OutputMasterId = master.Id + join Tw_InOutPlanMaster planmaster on planmaster.Id = master.InOutPlanMasterId + join Tw_InOutPlanDetail_Relation twRelation + on twRelation.InOutPlanMasterId = planmaster.Id and + outdetail.MaterialCode = twRelation.MaterialCode + where master.TypeInt=70), + packdetailDate as ( + select + packdetail.Id, + packdetail.PipelineComponentId, + pack.TrainNumberId, + pack.PackagingCode, + pack.StackingPosition, + pack.ProjectId, + packdetail.MaterialCode, + packdetail.Number, + packdetail.TwOutputDetailId + from HJGL_PackagingManageDetail packdetail + join HJGL_PackagingManage pack ON packdetail.PackagingManageId = pack.PackagingManageId + ), + PrefabricatedData AS (SELECT pipe.PrefabricatedComponents as Id, + line.PipelineCode, + pipe.PrefabricatedComponents as Code, + '预制组件' as TypeStr, + '' as Matdef, + CAST(NULL AS DECIMAL(18, 2)) as Number, -- 明确指定数据类型 + CAST(NULL AS DECIMAL(18, 2)) as ActNumber, -- 实到数量 + pack.PackagingCode, + trainnumber.TrainNumber, + line.FlowingSection, + line.UnitWorkId, + line.ProjectId, + pack.StackingPosition + FROM dbo.HJGL_PipeLineMat pipe + INNER JOIN dbo.HJGL_Pipeline line -- 改为INNER JOIN,如果管道必须存在 + ON pipe.PipelineId = line.PipelineId + LEFT JOIN dbo.HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + LEFT JOIN HJGL_Pipeline_Component comonent + ON comonent.PipelineComponentCode = pipe.PrefabricatedComponents + LEFT JOIN HJGL_PackagingManageDetail packdetail + ON packdetail.PipelineComponentId = comonent.PipelineComponentId + LEFT JOIN HJGL_PackagingManage pack + ON packdetail.PackagingManageId = pack.PackagingManageId + AND pack.ProjectId = line.ProjectId -- 添加项目关联条件 + LEFT JOIN HJGL_TrainNumberManage trainnumber + ON pack.TrainNumberId = trainnumber.Id + WHERE line.PipeArea = '1' + and (pipe.PrefabricatedComponents != '' + AND pipe.PrefabricatedComponents IS NOT NULL and pipe.PrefabricatedComponents not in('裕-量'))), + LooseComponentsData AS (SELECT distinct pipe.PipeLineMatId as Id, + line.PipelineCode, + pipe.MaterialCode as Code, + '预制散件' as TypeStr, + lib.MaterialDef as Matdef, + cast( packdetail.Number as DECIMAL(18, 2)) as Number, + cast( packdetail.Number as DECIMAL(18, 2)) as ActNumber, + packdetail.PackagingCode, + trainnumber.TrainNumber, + line.FlowingSection, + line.UnitWorkId, + line.ProjectId, + packdetail.StackingPosition + FROM dbo.HJGL_PipeLineMat pipe + INNER JOIN HJGL_Pipeline line -- 改为INNER JOIN + ON pipe.PipelineId = line.PipelineId + LEFT JOIN dbo.HJGL_MaterialCodeLib lib + ON lib.MaterialCode = pipe.MaterialCode + LEFT JOIN TwOutPutData twOutPutData + ON twOutPutData.PipelineId = pipe.PipelineId and + twOutPutData.MaterialCode = pipe.MaterialCode and + twOutPutData.unitworkid =line.UnitWorkId + LEFT JOIN packdetailDate packdetail + ON packdetail.TwOutputDetailId = twOutPutData.TwOutputDetailId and packdetail.ProjectId= line.ProjectId + LEFT JOIN HJGL_TrainNumberManage trainnumber + ON packdetail.TrainNumberId = trainnumber.Id + where line.PipeArea = '1' + and (pipe.PrefabricatedComponents is null or pipe.PrefabricatedComponents = '') ) + +-- 合并结果 + SELECT distinct * + FROM PrefabricatedData + UNION ALL + SELECT distinct * + FROM LooseComponentsData + + + + +GO + + diff --git a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs index a9ad5407..0a1c2e28 100644 --- a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs +++ b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs @@ -287,8 +287,8 @@ namespace BLL { // 从子表HJGL_PackagingManageDetail中获取关联的组件ID var PipelineComponentIdList = (from x in Funs.DB.HJGL_PackagingManageDetail - where x.PackagingManageId == PackagingManageId - select x.PipelineComponentId).ToList(); + where x.PackagingManageId == PackagingManageId + select x.PipelineComponentId).ToList(); if (PipelineComponentIdList == null || PipelineComponentIdList.Count == 0) return new List(); @@ -322,7 +322,7 @@ namespace BLL PipelineComponentCode = x.MaterialCode, num = x.Number.ToString(), CU = x.MaterialUnit, - UnitWorkName = UnitWorkService.GetNameById( TwOutputdetailService.GetInOutMasterById(x.TwOutputDetailId)?.UnitWorkId ), + UnitWorkName = UnitWorkService.GetNameById(TwOutputdetailService.GetInOutMasterById(x.TwOutputDetailId)?.UnitWorkId), FlowingSection = model.StackingPosition, }; result = detailList.ToList(); @@ -421,54 +421,85 @@ namespace BLL return q; } - public static (List Data, int Total) GetPackagingManageList(string projectId, string PackagingCode, int pageIndex = 0, int pageSize = 20) + public static (List Data, int Total) GetPackagingManageList(string projectId, string PackagingCode, int pageIndex = 0, int pageSize = 20) { using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) { - var baseQuery = (from x in db.HJGL_PackagingManage - join n in db.Base_Project on x.ProjectId equals n.ProjectId - join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt - from t in tt.DefaultIfEmpty() - join train in db.HJGL_TrainNumberManage on x.TrainNumberId equals train.Id into trains + var filteredQuery = from x in db.HJGL_PackagingManage + join p in db.Person_Persons + on x.CompileMan equals p.PersonId into personGroup + from p in personGroup.DefaultIfEmpty() + join u in db.Base_Unit + on p.UnitId equals u.UnitId into unitGroup + from u in unitGroup.DefaultIfEmpty() + where x.ProjectId == projectId + && (string.IsNullOrEmpty(PackagingCode) || x.PackagingCode.Contains(PackagingCode)) + select new { x, u }; + + // 获取总记录数(延迟计数优化) + var totalCount = filteredQuery.Count(); + var pagedData = (from z in filteredQuery + join n in db.Base_Project on z.x.ProjectId equals n.ProjectId + join train in db.HJGL_TrainNumberManage on z.x.TrainNumberId equals train.Id into trains from train in trains.DefaultIfEmpty() - where x.ProjectId == projectId - && (string.IsNullOrEmpty(PackagingCode) || x.PackagingCode.Contains(PackagingCode)) + orderby z.x.PackagingCode descending select new PackagingManageOutput { - PackagingManageId = x.PackagingManageId, - PackagingCode = x.PackagingCode, + PackagingManageId = z.x.PackagingManageId, + PackagingCode = z.x.PackagingCode, ProjectName = n.ProjectName, ContactName = train.ContactName, ContactPhone = train.ContactPhone, DriverName = train.DriverName, DriverPhone = train.DriverPhone, LicensePlateNumber = train.LicensePlateNumber, - StackingPosition = x.StackingPosition, - State = x.State, - TypeInt = x.TypeInt, - CategoryInt = x.CategoryInt, - TypeString = GetTypeString(x.TypeInt), - CategoryString = GetCategoryString(x.CategoryInt), - ReceiveMan = train.ContactName,//t.PersonName, - ReceiveDate = x.ReceiveDate.HasValue ? string.Format("{0:g}", x.ReceiveDate) : "", - PlanStartDate = GetMinPlanStartDate(x.PackagingManageId), - TrainNumberOld = x.TrainNumber, + StackingPosition = z.x.StackingPosition, + State = z.x.State, + TypeInt = z.x.TypeInt, + CategoryInt = z.x.CategoryInt, + TypeString = GetTypeString(z.x.TypeInt), + CategoryString = GetCategoryString(z.x.CategoryInt), + ReceiveMan = train.ContactName, + ReceiveDate = z.x.ReceiveDate.HasValue ? string.Format("{0:g}", z.x.ReceiveDate) : "", + TrainNumberOld = z.x.TrainNumber, TrainNumber = train.TrainNumber, - Code = x.PackagingCode.Substring(0, x.PackagingCode.LastIndexOf("-")).Substring(x.PackagingCode.Substring(0, x.PackagingCode.LastIndexOf("-")).LastIndexOf("-") + 1), - }).Distinct(); + }) + .Skip(pageIndex * pageSize) + .Take(pageSize) + .ToList(); - var pagedData = baseQuery - .OrderByDescending(x => x.Code) - .Skip((pageIndex) * pageSize) - .Take(pageSize) - .ToList(); + foreach (var item in pagedData) + { + item.Code = GetPackagingCodeSortPart(item.PackagingCode); + } - // 获取总记录数(延迟计数优化) - var totalCount = baseQuery.Count(); return (pagedData, totalCount); } } + private static string GetPackagingCodeSortPart(string packagingCode) + { + if (string.IsNullOrEmpty(packagingCode)) + { + return string.Empty; + } + + var lastIndex = packagingCode.LastIndexOf("-"); + if (lastIndex <= 0) + { + return packagingCode; + } + + var beforeLast = packagingCode.Substring(0, lastIndex); + var secondLastIndex = beforeLast.LastIndexOf("-"); + if (secondLastIndex < 0 || secondLastIndex >= beforeLast.Length - 1) + { + return beforeLast; + } + + return beforeLast.Substring(secondLastIndex + 1); + } + /// /// 获取包装管理列表(带过滤条件) /// @@ -486,9 +517,15 @@ namespace BLL join n in db.Base_Project on x.ProjectId equals n.ProjectId join m in db.Person_Persons on x.ReceiveMan equals m.PersonId into tt from t in tt.DefaultIfEmpty() - join train in db.HJGL_TrainNumberManage on x.TrainNumberId equals train.Id into trains - from train in trains.DefaultIfEmpty() - select new { x, n, t , train }; + join p in db.Person_Persons + on x.CompileMan equals p.PersonId into personGroup + from p in personGroup.DefaultIfEmpty() // 实现 Left Join + join u in db.Base_Unit + on p.UnitId equals u.UnitId into unitGroup + from u in unitGroup.DefaultIfEmpty() // 实现 Left Join + join train in db.HJGL_TrainNumberManage on x.TrainNumberId equals train.Id into trains + from train in trains.DefaultIfEmpty() + select new { x, n, t, u.UnitId, u.UnitName, train }; if (filter != null) { @@ -499,7 +536,7 @@ namespace BLL if (!string.IsNullOrEmpty(filter.PackagingCode)) { baseQuery = baseQuery.Where(z => z.x.PackagingCode.Contains(filter.PackagingCode)); - } + } if (!string.IsNullOrEmpty(filter.ProjectId)) { baseQuery = baseQuery.Where(z => z.x.ProjectId == filter.ProjectId); @@ -574,7 +611,7 @@ namespace BLL ReceiveDate = string.Format("{0:g}", z.x.ReceiveDate), TrainNumber = z.train.TrainNumber, ComponentCount = db.HJGL_PackagingManageDetail.Count(d => d.PackagingManageId == z.x.PackagingManageId), - CategoryInt = z.x.CategoryInt, + CategoryInt = z.x.CategoryInt, CategoryString = z.x.CategoryInt == 10 ? "打捆" : (z.x.CategoryInt == 20 ? "装箱" : (z.x.CategoryInt == 30 ? "散装" : "")) }).Distinct(); @@ -626,8 +663,8 @@ namespace BLL { // 获取现有的组件ID列表 var existingComponentIds = (from x in db.HJGL_PackagingManageDetail - where x.PackagingManageId == packagingManageId - select x.PipelineComponentId).ToList(); + where x.PackagingManageId == packagingManageId + select x.PipelineComponentId).ToList(); // 合并新旧组件ID(去重) HashSet allComponentIds = new HashSet(existingComponentIds); @@ -696,7 +733,7 @@ namespace BLL } var existDetail = (from detail in Funs.DB.HJGL_PackagingManageDetail - join pack in Funs.DB.HJGL_PackagingManage on detail.PackagingManageId equals pack.PackagingManageId + join pack in Funs.DB.HJGL_PackagingManage on detail.PackagingManageId equals pack.PackagingManageId where detail.PipelineComponentId == pipelineComponentId select new { diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx index ec822dc6..df30634f 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx @@ -111,7 +111,11 @@ TextAlign="Left"> + + +function reloadGrid() { + __doPostBack(null, 'reloadGrid'); +} + diff --git a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs index 5c36064d..012d3230 100644 --- a/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/PreDesign/InstallList.aspx.cs @@ -213,8 +213,8 @@ namespace FineUIPro.Web.HJGL.PreDesign private void BindGrid() { if (tvControlItem.SelectedNode == null) return; - var view_HJGL_InstallDatas = BindData(Grid1.PageIndex+1, Grid1.PageSize,out int totalCount, out int componentCount, out int partCount); - // 2.获取当前分页数据 + var view_HJGL_InstallDatas = BindData(Grid1.PageIndex + 1, Grid1.PageSize, out int totalCount, out int componentCount, out int partCount); + // 2.获取当前分页数据 Grid1.RecordCount = totalCount; var table = view_HJGL_InstallDatas; Grid1.DataSource = table; @@ -247,33 +247,34 @@ namespace FineUIPro.Web.HJGL.PreDesign /// 查询数据 /// /// - private List BindData(int pageIndex, int pageSize, out int totalCount, out int componentCount, out int partCount) + private List BindData(int pageIndex, int pageSize, out int totalCount, out int componentCount, out int partCount) { var baseQuery = GetIQueryableInstallDatas(); - + // 一次性统计所有需要的数据(使用 GroupBy 优化) var stats = baseQuery .GroupBy(x => x.TypeStr) .Select(g => new { TypeStr = g.Key, Count = g.Count() }) .ToList(); - + // 从统计结果中提取数据 totalCount = stats.Sum(s => s.Count); componentCount = stats.FirstOrDefault(s => s.TypeStr == "预制组件")?.Count ?? 0; partCount = stats.FirstOrDefault(s => s.TypeStr == "预制散件")?.Count ?? 0; - + // 分页保护 if (pageIndex <= 0) pageIndex = 1; if (pageSize <= 0) pageSize = 10; - + var query = baseQuery.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList(); - + // 预制组件数量显示为1,预制散件保持原始数量 foreach (var item in query) { if (item.TypeStr == "预制组件") { item.Number = 1; + item.ActNumber = 1; } } return query; @@ -281,9 +282,9 @@ namespace FineUIPro.Web.HJGL.PreDesign private IQueryable GetIQueryableInstallDatas() - { + { var baseQuery = from x in Funs.DB.View_HJGL_InstallData - select x; + select x; if (tvControlItem.SelectedNode.CommandName.Split('|').Length == 2) { baseQuery = baseQuery.Where(x => x.UnitWorkId == tvControlItem.SelectedNode.NodeID); @@ -315,7 +316,7 @@ namespace FineUIPro.Web.HJGL.PreDesign { baseQuery = baseQuery.Where(x => x.PipelineCode.Contains(txtPipelineCode.Text.Trim())); - } + } baseQuery = baseQuery.OrderBy(x => x.PipelineCode).ThenBy(x => x.Code); return baseQuery; @@ -410,38 +411,39 @@ namespace FineUIPro.Web.HJGL.PreDesign /// protected void btnOut_Click(object sender, EventArgs e) { - - var baseQuery = GetIQueryableInstallDatas(); - var q = (from x in baseQuery - select new - { - 管线号 = x.PipelineCode, - 类型 = x.TypeStr, - 编号 = x.Code, - 预制散件材料描述 = (x.Matdef=="" || x.Matdef==null)?"-":x.Matdef, - 数量 = x.TypeStr == "预制组件" ? 1 : (x.Number ?? 1), - 所在包装编号 = x.PackagingCode, - 车次 = x.TrainNumber, - 流水段 = x.FlowingSection - }); - string path = Funs.RootPath + @"File\Excel\Temp\PrePipelineInstallList.xlsx"; - path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx"); + var baseQuery = GetIQueryableInstallDatas(); - MiniExcel.SaveAs(path, q, overwriteFile: true); + var q = (from x in baseQuery + select new + { + 管线号 = x.PipelineCode, + 类型 = x.TypeStr, + 编号 = x.Code, + 预制散件材料描述 = (x.Matdef == "" || x.Matdef == null) ? "-" : x.Matdef, + 所需数量 = x.TypeStr == "预制组件" ? 1 : (x.Number ?? 1), + 实到数量 = x.TypeStr == "预制组件" ? 1 : (x.ActNumber ?? 1), + 所在包装编号 = x.PackagingCode, + 车次 = x.TrainNumber, + 流水段 = x.FlowingSection + }); + string path = Funs.RootPath + @"File\Excel\Temp\PrePipelineInstallList.xlsx"; + path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx"); + + MiniExcel.SaveAs(path, q, overwriteFile: true); + + string fileName = $"安装清单-" + this.tvControlItem.SelectedNode.Text + "-" + string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx"; + FileInfo info = new FileInfo(path); + long fileSize = info.Length; + System.Web.HttpContext.Current.Response.Clear(); + System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; + System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); + System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize); + System.Web.HttpContext.Current.Response.Flush(); + System.Web.HttpContext.Current.Response.Close(); + File.Delete(path); - string fileName = $"安装清单-" + this.tvControlItem.SelectedNode.Text + "-" + string.Format("{0:yyyy-MM-dd}", DateTime.Now) + ".xlsx"; - FileInfo info = new FileInfo(path); - long fileSize = info.Length; - System.Web.HttpContext.Current.Response.Clear(); - System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed"; - System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); - System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString()); - System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize); - System.Web.HttpContext.Current.Response.Flush(); - System.Web.HttpContext.Current.Response.Close(); - File.Delete(path); - } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs index 1cbd2ad9..0c8c237e 100644 --- a/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/WeldingManage/PipelineListPDMSIn.aspx.cs @@ -238,7 +238,93 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.UnitId = unitWork.UnitId; } - string col0 = pds[i].A; + string col0 = Convert.ToString(pds[i].A); + string col1 = Convert.ToString(pds[i].B); + string col2 = Convert.ToString(pds[i].C); + string col3 = Convert.ToString(pds[i].D); + string col4 = Convert.ToString(pds[i].E); + string col5 = Convert.ToString(pds[i].F); + string col6 = Convert.ToString(pds[i].G); + string col19 = Convert.ToString(pds[i].U); + string col20 = Convert.ToString(pds[i].V); + string col21 = Convert.ToString(pds[i].W); + string col22 = Convert.ToString(pds[i].X); + string col23 = Convert.ToString(pds[i].Y); + string col24 = Convert.ToString(pds[i].Z); + string col25 = Convert.ToString(pds[i].AA); + string col26 = Convert.ToString(pds[i].AB); + string col27 = Convert.ToString(pds[i].AC); + bool hasRequiredError = false; + Action addRequiredError = colName => + { + result.Add("第" + (i + 1).ToString() + "行," + colName + "," + "此项为必填项!" + "|"); + hasRequiredError = true; + }; + + if (string.IsNullOrEmpty(col0)) + { + addRequiredError("管线号"); + } + if (string.IsNullOrEmpty(col3)) + { + addRequiredError("介质代号"); + } + if (string.IsNullOrEmpty(col4)) + { + addRequiredError("管道等级"); + } + if (string.IsNullOrEmpty(col5)) + { + addRequiredError("探伤比例"); + } + if (string.IsNullOrEmpty(col6)) + { + addRequiredError("探伤类型"); + } + if (string.IsNullOrEmpty(col19)) + { + addRequiredError("焊口号"); + } + if (string.IsNullOrEmpty(col20)) + { + addRequiredError("材质1"); + } + if (string.IsNullOrEmpty(col21)) + { + addRequiredError("材质2"); + } + if (rbDiaType.SelectedValue == "1") + { + if (string.IsNullOrEmpty(col27)) + { + addRequiredError("外径"); + } + } + else if (string.IsNullOrEmpty(col22)) + { + addRequiredError("DN公称直径"); + } + if (string.IsNullOrEmpty(col23)) + { + addRequiredError("达因"); + } + if (string.IsNullOrEmpty(col24)) + { + addRequiredError("壁厚"); + } + if (string.IsNullOrEmpty(col25)) + { + addRequiredError("焊缝类型"); + } + if (string.IsNullOrEmpty(col26)) + { + addRequiredError("焊口属性"); + } + if (hasRequiredError) + { + continue; + } + string pipeLineId = string.Empty; if (string.IsNullOrEmpty(col0)) { @@ -249,10 +335,9 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.PipelineCode = col0; } - pipeline.SingleNumber = pds[i].B; - pipeline.SingleName = pds[i].C; + pipeline.SingleNumber = col1; + pipeline.SingleName = col2; - string col3 = pds[i].D; if (string.IsNullOrEmpty(col3)) { result.Add("第" + (i + 1).ToString() + "行," + "介质代号" + "," + "此项为必填项!" + "|"); @@ -271,7 +356,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.MediumName = col3; } } - string col4 = pds[i].E; if (string.IsNullOrEmpty(col4)) { result.Add("第" + (i + 1).ToString() + "行," + "管道等级" + "," + "此项为必填项!" + "|"); @@ -290,7 +374,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.PipingClassCode = col4; } } - string col5 = pds[i].F; if (!string.IsNullOrEmpty(col5)) { var DetectionRate = getDetectionRate.FirstOrDefault(x => x.DetectionRateValue.ToString() == col5.Replace("%", "") || x.DetectionRateCode == col5); @@ -310,7 +393,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage result.Add("第" + (i + 1).ToString() + "行," + "探伤比例" + "," + "此项为必填项!" + "|"); } - string col6 = pds[i].G; if (!string.IsNullOrEmpty(col6)) { string typeStr = col6.ToString(); @@ -449,7 +531,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.Remark = Convert.ToString(pds[i].T); // 以下是焊口信息 - string col19 = Convert.ToString(pds[i].U); if (string.IsNullOrEmpty(col19)) { result.Add("第" + (i + 1).ToString() + "行," + "焊口号" + "," + "此项为必填项!" + "|"); @@ -468,12 +549,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage pipeline.WeldJointCode = col19; } - string col20 = ""; - if (pds[i].V != null) - { - col20 = pds[i].V.ToString(); - } - if (!string.IsNullOrEmpty(col20)) { var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col20); @@ -493,12 +568,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage result.Add("第" + (i + 1).ToString() + "行," + "材质1" + "," + "此项为必填项!" + "|"); } - string col21 = ""; - if (pds[i].W != null) - { - col21 = pds[i].W.ToString(); - } - if (!string.IsNullOrEmpty(col21)) { var material = getMaterial.FirstOrDefault(x => x.MaterialCode == col21); @@ -518,12 +587,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage result.Add("第" + (i + 1).ToString() + "行," + "材质2" + "," + "此项为必填项!" + "|"); } - string col22 = Convert.ToString(pds[i].X); - string col27 = ""; - if (pds[i].AC != null) - { - col27 = pds[i].AC.ToString(); - } if (rbDiaType.SelectedValue == "1") { if (!string.IsNullOrEmpty(col27)) @@ -564,7 +627,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage } - var col23 = Convert.ToString(pds[i].Y); if (col23 != null) { try @@ -582,7 +644,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage result.Add("第" + (i + 1).ToString() + "行," + "达因" + "," + "此项为必填项!" + "|"); } - var col24 = Convert.ToString(pds[i].Z); if (col24 != null) { // var Thickness = Convert.ToDecimal(col24); @@ -641,7 +702,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage } - string col25 = Convert.ToString(pds[i].AA); if (!string.IsNullOrEmpty(col25)) { var weldType = getWeldType.FirstOrDefault(x => x.WeldTypeCode == col25); @@ -699,7 +759,6 @@ namespace FineUIPro.Web.HJGL.WeldingManage { result.Add("第" + (i + 1).ToString() + "行," + "焊缝类型" + "," + "此项为必填项!" + "|"); } - string col26 = Convert.ToString(pds[i].AB); if (!string.IsNullOrEmpty(col26)) { var JointAttribute = BLL.DropListService.HJGL_JointAttribute(); @@ -1324,4 +1383,4 @@ namespace FineUIPro.Web.HJGL.WeldingManage } -} \ No newline at end of file +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 0d237201..8f3f6bdb 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -173,6 +173,9 @@ namespace Model partial void InsertBase_MaterialType(Base_MaterialType instance); partial void UpdateBase_MaterialType(Base_MaterialType instance); partial void DeleteBase_MaterialType(Base_MaterialType instance); + partial void InsertBase_MaterialUnit(Base_MaterialUnit instance); + partial void UpdateBase_MaterialUnit(Base_MaterialUnit instance); + partial void DeleteBase_MaterialUnit(Base_MaterialUnit instance); partial void InsertBase_Medium(Base_Medium instance); partial void UpdateBase_Medium(Base_Medium instance); partial void DeleteBase_Medium(Base_Medium instance); @@ -1019,6 +1022,9 @@ namespace Model partial void InsertMaterial_NoticeAndSupervision(Material_NoticeAndSupervision instance); partial void UpdateMaterial_NoticeAndSupervision(Material_NoticeAndSupervision instance); partial void DeleteMaterial_NoticeAndSupervision(Material_NoticeAndSupervision instance); + partial void InsertMaterialInAndOutRecord(MaterialInAndOutRecord instance); + partial void UpdateMaterialInAndOutRecord(MaterialInAndOutRecord instance); + partial void DeleteMaterialInAndOutRecord(MaterialInAndOutRecord instance); partial void InsertMeeting_AttendMeeting(Meeting_AttendMeeting instance); partial void UpdateMeeting_AttendMeeting(Meeting_AttendMeeting instance); partial void DeleteMeeting_AttendMeeting(Meeting_AttendMeeting instance); @@ -2347,6 +2353,14 @@ namespace Model } } + public System.Data.Linq.Table Base_MaterialUnit + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Base_Medium { get @@ -4611,6 +4625,14 @@ namespace Model } } + public System.Data.Linq.Table MaterialInAndOutRecord + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Meeting_AttendMeeting { get @@ -12453,7 +12475,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(2000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(200)")] public string ApproveIdea { get @@ -22632,6 +22654,8 @@ namespace Model private string _UnitId; + private string _ProjectId; + private string _MaterialId; private string _ColorName; @@ -22642,8 +22666,6 @@ namespace Model private string _Remark; - private string _ProjectId; - #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -22652,6 +22674,8 @@ namespace Model partial void OnMaterialColorIdChanged(); partial void OnUnitIdChanging(string value); partial void OnUnitIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); partial void OnMaterialIdChanging(string value); partial void OnMaterialIdChanged(); partial void OnColorNameChanging(string value); @@ -22662,8 +22686,6 @@ namespace Model partial void OnRGBChanged(); partial void OnRemarkChanging(string value); partial void OnRemarkChanged(); - partial void OnProjectIdChanging(string value); - partial void OnProjectIdChanged(); #endregion public Base_MaterialColor() @@ -22711,6 +22733,26 @@ namespace Model } } + [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="_MaterialId", DbType="NVarChar(50)")] public string MaterialId { @@ -22811,26 +22853,6 @@ namespace Model } } - [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; @@ -23014,6 +23036,140 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Base_MaterialUnit")] + public partial class Base_MaterialUnit : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _MaterialUnitId; + + private string _MaterialUnitName; + + private string _MaterialUnitCode; + + private string _Remark; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnMaterialUnitIdChanging(string value); + partial void OnMaterialUnitIdChanged(); + partial void OnMaterialUnitNameChanging(string value); + partial void OnMaterialUnitNameChanged(); + partial void OnMaterialUnitCodeChanging(string value); + partial void OnMaterialUnitCodeChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + #endregion + + public Base_MaterialUnit() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialUnitId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string MaterialUnitId + { + get + { + return this._MaterialUnitId; + } + set + { + if ((this._MaterialUnitId != value)) + { + this.OnMaterialUnitIdChanging(value); + this.SendPropertyChanging(); + this._MaterialUnitId = value; + this.SendPropertyChanged("MaterialUnitId"); + this.OnMaterialUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialUnitName", DbType="NVarChar(100)")] + public string MaterialUnitName + { + get + { + return this._MaterialUnitName; + } + set + { + if ((this._MaterialUnitName != value)) + { + this.OnMaterialUnitNameChanging(value); + this.SendPropertyChanging(); + this._MaterialUnitName = value; + this.SendPropertyChanged("MaterialUnitName"); + this.OnMaterialUnitNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialUnitCode", DbType="NVarChar(50)")] + public string MaterialUnitCode + { + get + { + return this._MaterialUnitCode; + } + set + { + if ((this._MaterialUnitCode != value)) + { + this.OnMaterialUnitCodeChanging(value); + this.SendPropertyChanging(); + this._MaterialUnitCode = value; + this.SendPropertyChanged("MaterialUnitCode"); + this.OnMaterialUnitCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(200)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + 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.Base_Medium")] public partial class Base_Medium : INotifyPropertyChanging, INotifyPropertyChanged { @@ -24808,8 +24964,6 @@ namespace Model private EntitySet _Base_ProjectSate; - private EntitySet _Base_Warehouse; - private EntitySet _HJGL_Batch_NDE; private EntitySet _HJGL_Batch_PointBatch; @@ -25094,6 +25248,8 @@ namespace Model private EntitySet _Sys_FlowOperate; + private EntitySet _Sys_Log; + private EntitySet _Sys_RoleItem; private EntitySet _Sys_UserRead; @@ -25240,7 +25396,6 @@ namespace Model this._Base_ProjectType = default(EntityRef); this._Base_Unit = default(EntityRef); this._Base_ProjectSate = new EntitySet(new Action(this.attach_Base_ProjectSate), new Action(this.detach_Base_ProjectSate)); - this._Base_Warehouse = new EntitySet(new Action(this.attach_Base_Warehouse), new Action(this.detach_Base_Warehouse)); this._HJGL_Batch_NDE = new EntitySet(new Action(this.attach_HJGL_Batch_NDE), new Action(this.detach_HJGL_Batch_NDE)); this._HJGL_Batch_PointBatch = new EntitySet(new Action(this.attach_HJGL_Batch_PointBatch), new Action(this.detach_HJGL_Batch_PointBatch)); this._Check_CheckColligation = new EntitySet(new Action(this.attach_Check_CheckColligation), new Action(this.detach_Check_CheckColligation)); @@ -25383,6 +25538,7 @@ namespace Model this._Sys_CodeRecords = new EntitySet(new Action(this.attach_Sys_CodeRecords), new Action(this.detach_Sys_CodeRecords)); this._Sys_CQMS_DataInTemp = new EntitySet(new Action(this.attach_Sys_CQMS_DataInTemp), new Action(this.detach_Sys_CQMS_DataInTemp)); this._Sys_FlowOperate = new EntitySet(new Action(this.attach_Sys_FlowOperate), new Action(this.detach_Sys_FlowOperate)); + this._Sys_Log = new EntitySet(new Action(this.attach_Sys_Log), new Action(this.detach_Sys_Log)); this._Sys_RoleItem = new EntitySet(new Action(this.attach_Sys_RoleItem), new Action(this.detach_Sys_RoleItem)); this._Sys_UserRead = new EntitySet(new Action(this.attach_Sys_UserRead), new Action(this.detach_Sys_UserRead)); this._Technical_TechnicalDisclose = new EntitySet(new Action(this.attach_Technical_TechnicalDisclose), new Action(this.detach_Technical_TechnicalDisclose)); @@ -26427,19 +26583,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Warehouse_Project", Storage="_Base_Warehouse", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] - public EntitySet Base_Warehouse - { - get - { - return this._Base_Warehouse; - } - set - { - this._Base_Warehouse.Assign(value); - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Batch_NDECheck_Base_Project", Storage="_HJGL_Batch_NDE", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] public EntitySet HJGL_Batch_NDE { @@ -28286,6 +28429,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_Log_Base_Project", Storage="_Sys_Log", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] + public EntitySet Sys_Log + { + get + { + return this._Sys_Log; + } + set + { + this._Sys_Log.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_RoleItem_Base_Project", Storage="_Sys_RoleItem", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] public EntitySet Sys_RoleItem { @@ -28773,18 +28929,6 @@ namespace Model entity.Base_Project = null; } - private void attach_Base_Warehouse(Base_Warehouse entity) - { - this.SendPropertyChanging(); - entity.Base_Project = this; - } - - private void detach_Base_Warehouse(Base_Warehouse entity) - { - this.SendPropertyChanging(); - entity.Base_Project = null; - } - private void attach_HJGL_Batch_NDE(HJGL_Batch_NDE entity) { this.SendPropertyChanging(); @@ -30489,6 +30633,18 @@ namespace Model entity.Base_Project = null; } + private void attach_Sys_Log(Sys_Log entity) + { + this.SendPropertyChanging(); + entity.Base_Project = this; + } + + private void detach_Sys_Log(Sys_Log entity) + { + this.SendPropertyChanging(); + entity.Base_Project = null; + } + private void attach_Sys_RoleItem(Sys_RoleItem entity) { this.SendPropertyChanging(); @@ -39019,8 +39175,6 @@ namespace Model private System.Nullable _ModifyTime; - private EntityRef _Base_Project; - #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -39045,7 +39199,6 @@ namespace Model public Base_Warehouse() { - this._Base_Project = default(EntityRef); OnCreated(); } @@ -39120,10 +39273,6 @@ namespace Model { if ((this._ProjectId != value)) { - if (this._Base_Project.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } this.OnProjectIdChanging(value); this.SendPropertyChanging(); this._ProjectId = value; @@ -39213,40 +39362,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Base_Warehouse_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.Base_Warehouse.Remove(this); - } - this._Base_Project.Entity = value; - if ((value != null)) - { - value.Base_Warehouse.Add(this); - this._ProjectId = value.ProjectId; - } - else - { - this._ProjectId = default(string); - } - this.SendPropertyChanged("Base_Project"); - } - } - } - public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -61320,6 +61435,8 @@ namespace Model private string _SType; + private string _SourceDes; + private string _MeasurementRange; private string _Precision; @@ -61346,8 +61463,6 @@ namespace Model private string _Remark; - private string _SourceDes; - private EntityRef _Base_CNProfessional; private EntityRef _Base_Project; @@ -61402,6 +61517,8 @@ namespace Model partial void OnIsCheckOKChanged(); partial void OnSTypeChanging(string value); partial void OnSTypeChanged(); + partial void OnSourceDesChanging(string value); + partial void OnSourceDesChanged(); partial void OnMeasurementRangeChanging(string value); partial void OnMeasurementRangeChanged(); partial void OnPrecisionChanging(string value); @@ -61428,8 +61545,6 @@ namespace Model partial void OnCalibrationWarningChanged(); partial void OnRemarkChanging(string value); partial void OnRemarkChanged(); - partial void OnSourceDesChanging(string value); - partial void OnSourceDesChanged(); #endregion public Comprehensive_InspectionMachine() @@ -61892,6 +62007,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SourceDes", DbType="NVarChar(500)")] + public string SourceDes + { + get + { + return this._SourceDes; + } + set + { + if ((this._SourceDes != value)) + { + this.OnSourceDesChanging(value); + this.SendPropertyChanging(); + this._SourceDes = value; + this.SendPropertyChanged("SourceDes"); + this.OnSourceDesChanged(); + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MeasurementRange", DbType="NVarChar(50)")] public string MeasurementRange { @@ -62152,26 +62287,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SourceDes", DbType="NVarChar(500)")] - public string SourceDes - { - get - { - return this._SourceDes; - } - set - { - if ((this._SourceDes != value)) - { - this.OnSourceDesChanging(value); - this.SendPropertyChanging(); - this._SourceDes = value; - this.SendPropertyChanged("SourceDes"); - this.OnSourceDesChanged(); - } - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Comprehensive_InspectionMachine_Base_CNProfessional", Storage="_Base_CNProfessional", ThisKey="CNProfessionalId", OtherKey="CNProfessionalId", IsForeignKey=true)] public Base_CNProfessional Base_CNProfessional { @@ -101519,10 +101634,10 @@ namespace Model private string _TrainNumber; - private System.Nullable _TypeInt; - private string _TrainNumberId; + private System.Nullable _TypeInt; + private string _CompileMan; private System.Nullable _CompileDate; @@ -101557,10 +101672,10 @@ namespace Model partial void OnReceiveDateChanged(); partial void OnTrainNumberChanging(string value); partial void OnTrainNumberChanged(); - partial void OnTypeIntChanging(System.Nullable value); - partial void OnTypeIntChanged(); partial void OnTrainNumberIdChanging(string value); partial void OnTrainNumberIdChanged(); + partial void OnTypeIntChanging(System.Nullable value); + partial void OnTypeIntChanged(); partial void OnCompileManChanging(string value); partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); @@ -101814,26 +101929,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeInt", DbType="Int")] - public System.Nullable TypeInt - { - get - { - return this._TypeInt; - } - set - { - if ((this._TypeInt != value)) - { - this.OnTypeIntChanging(value); - this.SendPropertyChanging(); - this._TypeInt = value; - this.SendPropertyChanged("TypeInt"); - this.OnTypeIntChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TrainNumberId", DbType="VarChar(50)")] public string TrainNumberId { @@ -101854,6 +101949,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeInt", DbType="Int")] + public System.Nullable TypeInt + { + get + { + return this._TypeInt; + } + set + { + if ((this._TypeInt != value)) + { + this.OnTypeIntChanging(value); + this.SendPropertyChanging(); + this._TypeInt = value; + this.SendPropertyChanged("TypeInt"); + this.OnTypeIntChanged(); + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] public string CompileMan { @@ -113739,7 +113854,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Rectification", DbType="NVarChar(50)")] public string Rectification { get @@ -113865,7 +113980,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Measures", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Measures", DbType="NVarChar(50)")] public string Measures { get @@ -164903,6 +165018,356 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.MaterialInAndOutRecord")] + public partial class MaterialInAndOutRecord : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _Id; + + private string _ProjectId; + + private string _GoodsCategoryId; + + private string _GoodsCategoryName; + + private string _MaterialModel; + + private System.Nullable _InOutDate; + + private string _UnitId; + + private string _InOrOut; + + private System.Nullable _Number; + + private string _MaterialUnitId; + + private string _Remark; + + private string _CompileMan; + + private System.Nullable _CompileDate; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnIdChanging(string value); + partial void OnIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnGoodsCategoryIdChanging(string value); + partial void OnGoodsCategoryIdChanged(); + partial void OnGoodsCategoryNameChanging(string value); + partial void OnGoodsCategoryNameChanged(); + partial void OnMaterialModelChanging(string value); + partial void OnMaterialModelChanged(); + partial void OnInOutDateChanging(System.Nullable value); + partial void OnInOutDateChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnInOrOutChanging(string value); + partial void OnInOrOutChanged(); + partial void OnNumberChanging(System.Nullable value); + partial void OnNumberChanged(); + partial void OnMaterialUnitIdChanging(string value); + partial void OnMaterialUnitIdChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public MaterialInAndOutRecord() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string Id + { + get + { + return this._Id; + } + set + { + if ((this._Id != value)) + { + this.OnIdChanging(value); + this.SendPropertyChanging(); + this._Id = value; + this.SendPropertyChanged("Id"); + this.OnIdChanged(); + } + } + } + + [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="_GoodsCategoryId", DbType="NVarChar(50)")] + public string GoodsCategoryId + { + get + { + return this._GoodsCategoryId; + } + set + { + if ((this._GoodsCategoryId != value)) + { + this.OnGoodsCategoryIdChanging(value); + this.SendPropertyChanging(); + this._GoodsCategoryId = value; + this.SendPropertyChanged("GoodsCategoryId"); + this.OnGoodsCategoryIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_GoodsCategoryName", DbType="NVarChar(100)")] + public string GoodsCategoryName + { + get + { + return this._GoodsCategoryName; + } + set + { + if ((this._GoodsCategoryName != value)) + { + this.OnGoodsCategoryNameChanging(value); + this.SendPropertyChanging(); + this._GoodsCategoryName = value; + this.SendPropertyChanged("GoodsCategoryName"); + this.OnGoodsCategoryNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialModel", DbType="NVarChar(100)")] + public string MaterialModel + { + get + { + return this._MaterialModel; + } + set + { + if ((this._MaterialModel != value)) + { + this.OnMaterialModelChanging(value); + this.SendPropertyChanging(); + this._MaterialModel = value; + this.SendPropertyChanged("MaterialModel"); + this.OnMaterialModelChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InOutDate", DbType="DateTime")] + public System.Nullable InOutDate + { + get + { + return this._InOutDate; + } + set + { + if ((this._InOutDate != value)) + { + this.OnInOutDateChanging(value); + this.SendPropertyChanging(); + this._InOutDate = value; + this.SendPropertyChanged("InOutDate"); + this.OnInOutDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")] + public string UnitId + { + get + { + return this._UnitId; + } + set + { + if ((this._UnitId != value)) + { + this.OnUnitIdChanging(value); + this.SendPropertyChanging(); + this._UnitId = value; + this.SendPropertyChanged("UnitId"); + this.OnUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_InOrOut", DbType="NVarChar(10)")] + public string InOrOut + { + get + { + return this._InOrOut; + } + set + { + if ((this._InOrOut != value)) + { + this.OnInOrOutChanging(value); + this.SendPropertyChanging(); + this._InOrOut = value; + this.SendPropertyChanged("InOrOut"); + this.OnInOrOutChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Number", DbType="Decimal(18,2)")] + public System.Nullable Number + { + get + { + return this._Number; + } + set + { + if ((this._Number != value)) + { + this.OnNumberChanging(value); + this.SendPropertyChanging(); + this._Number = value; + this.SendPropertyChanged("Number"); + this.OnNumberChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialUnitId", DbType="NVarChar(50)")] + public string MaterialUnitId + { + get + { + return this._MaterialUnitId; + } + set + { + if ((this._MaterialUnitId != value)) + { + this.OnMaterialUnitIdChanging(value); + this.SendPropertyChanging(); + this._MaterialUnitId = value; + this.SendPropertyChanged("MaterialUnitId"); + this.OnMaterialUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(200)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")] + public string CompileMan + { + get + { + return this._CompileMan; + } + set + { + if ((this._CompileMan != value)) + { + this.OnCompileManChanging(value); + this.SendPropertyChanging(); + this._CompileMan = value; + this.SendPropertyChanged("CompileMan"); + this.OnCompileManChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")] + public System.Nullable CompileDate + { + get + { + return this._CompileDate; + } + set + { + if ((this._CompileDate != value)) + { + this.OnCompileDateChanging(value); + this.SendPropertyChanging(); + this._CompileDate = value; + this.SendPropertyChanged("CompileDate"); + this.OnCompileDateChanged(); + } + } + } + + 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.Meeting_AttendMeeting")] public partial class Meeting_AttendMeeting : INotifyPropertyChanging, INotifyPropertyChanged { @@ -167242,7 +167707,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(3000)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(500)")] public string AttentPerson { get @@ -198249,7 +198714,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDescription", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectDescription", DbType="VarChar(255)")] public string ProjectDescription { get @@ -198369,7 +198834,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalculationRule", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CalculationRule", DbType="VarChar(255)")] public string CalculationRule { get @@ -198429,7 +198894,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionSubcontractor", DbType="VarChar(100)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionSubcontractor", DbType="VarChar(50)")] public string ConstructionSubcontractor { get @@ -198813,7 +199278,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,3)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,2)")] public System.Nullable WorkPackageEstimate { get @@ -199118,16 +199583,6 @@ namespace Model private string _ProjectId; - private string _ContractId; - - private string _OrderCode; - - private System.Nullable _OrderInDate; - - private System.Nullable _OrderOutDate; - - private string _MaterialRequisitionUnit; - private System.Nullable _State; private string _InvoiceCode; @@ -199156,6 +199611,16 @@ namespace Model private string _CreateUser; + private string _ContractId; + + private System.Nullable _OrderInDate; + + private string _OrderCode; + + private System.Nullable _OrderOutDate; + + private string _MaterialRequisitionUnit; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -199164,16 +199629,6 @@ namespace Model partial void OnInvoiceIdChanged(); partial void OnProjectIdChanging(string value); partial void OnProjectIdChanged(); - partial void OnContractIdChanging(string value); - partial void OnContractIdChanged(); - partial void OnOrderCodeChanging(string value); - partial void OnOrderCodeChanged(); - partial void OnOrderInDateChanging(System.Nullable value); - partial void OnOrderInDateChanged(); - partial void OnOrderOutDateChanging(System.Nullable value); - partial void OnOrderOutDateChanged(); - partial void OnMaterialRequisitionUnitChanging(string value); - partial void OnMaterialRequisitionUnitChanged(); partial void OnStateChanging(System.Nullable value); partial void OnStateChanged(); partial void OnInvoiceCodeChanging(string value); @@ -199202,6 +199657,16 @@ namespace Model partial void OnCreateDateChanged(); partial void OnCreateUserChanging(string value); partial void OnCreateUserChanged(); + partial void OnContractIdChanging(string value); + partial void OnContractIdChanged(); + partial void OnOrderInDateChanging(System.Nullable value); + partial void OnOrderInDateChanged(); + partial void OnOrderCodeChanging(string value); + partial void OnOrderCodeChanged(); + partial void OnOrderOutDateChanging(System.Nullable value); + partial void OnOrderOutDateChanged(); + partial void OnMaterialRequisitionUnitChanging(string value); + partial void OnMaterialRequisitionUnitChanged(); #endregion public PHTGL_Invoice() @@ -199249,106 +199714,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractId", DbType="NVarChar(50)")] - public string ContractId - { - get - { - return this._ContractId; - } - set - { - if ((this._ContractId != value)) - { - this.OnContractIdChanging(value); - this.SendPropertyChanging(); - this._ContractId = value; - this.SendPropertyChanged("ContractId"); - this.OnContractIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderCode", DbType="NVarChar(50)")] - public string OrderCode - { - get - { - return this._OrderCode; - } - set - { - if ((this._OrderCode != value)) - { - this.OnOrderCodeChanging(value); - this.SendPropertyChanging(); - this._OrderCode = value; - this.SendPropertyChanged("OrderCode"); - this.OnOrderCodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderInDate", DbType="Date")] - public System.Nullable OrderInDate - { - get - { - return this._OrderInDate; - } - set - { - if ((this._OrderInDate != value)) - { - this.OnOrderInDateChanging(value); - this.SendPropertyChanging(); - this._OrderInDate = value; - this.SendPropertyChanged("OrderInDate"); - this.OnOrderInDateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderOutDate", DbType="Date")] - public System.Nullable OrderOutDate - { - get - { - return this._OrderOutDate; - } - set - { - if ((this._OrderOutDate != value)) - { - this.OnOrderOutDateChanging(value); - this.SendPropertyChanging(); - this._OrderOutDate = value; - this.SendPropertyChanged("OrderOutDate"); - this.OnOrderOutDateChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialRequisitionUnit", DbType="NVarChar(100)")] - public string MaterialRequisitionUnit - { - get - { - return this._MaterialRequisitionUnit; - } - set - { - if ((this._MaterialRequisitionUnit != value)) - { - this.OnMaterialRequisitionUnitChanging(value); - this.SendPropertyChanging(); - this._MaterialRequisitionUnit = value; - this.SendPropertyChanged("MaterialRequisitionUnit"); - this.OnMaterialRequisitionUnitChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_State", DbType="Int")] public System.Nullable State { @@ -199629,6 +199994,106 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractId", DbType="NVarChar(50)")] + public string ContractId + { + get + { + return this._ContractId; + } + set + { + if ((this._ContractId != value)) + { + this.OnContractIdChanging(value); + this.SendPropertyChanging(); + this._ContractId = value; + this.SendPropertyChanged("ContractId"); + this.OnContractIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderInDate", DbType="Date")] + public System.Nullable OrderInDate + { + get + { + return this._OrderInDate; + } + set + { + if ((this._OrderInDate != value)) + { + this.OnOrderInDateChanging(value); + this.SendPropertyChanging(); + this._OrderInDate = value; + this.SendPropertyChanged("OrderInDate"); + this.OnOrderInDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderCode", DbType="NVarChar(50)")] + public string OrderCode + { + get + { + return this._OrderCode; + } + set + { + if ((this._OrderCode != value)) + { + this.OnOrderCodeChanging(value); + this.SendPropertyChanging(); + this._OrderCode = value; + this.SendPropertyChanged("OrderCode"); + this.OnOrderCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_OrderOutDate", DbType="Date")] + public System.Nullable OrderOutDate + { + get + { + return this._OrderOutDate; + } + set + { + if ((this._OrderOutDate != value)) + { + this.OnOrderOutDateChanging(value); + this.SendPropertyChanging(); + this._OrderOutDate = value; + this.SendPropertyChanged("OrderOutDate"); + this.OnOrderOutDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialRequisitionUnit", DbType="NVarChar(100)")] + public string MaterialRequisitionUnit + { + get + { + return this._MaterialRequisitionUnit; + } + set + { + if ((this._MaterialRequisitionUnit != value)) + { + this.OnMaterialRequisitionUnitChanging(value); + this.SendPropertyChanging(); + this._MaterialRequisitionUnit = value; + this.SendPropertyChanged("MaterialRequisitionUnit"); + this.OnMaterialRequisitionUnitChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -201007,7 +201472,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReviewResults", DbType="NVarChar(50)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReviewResults", DbType="NVarChar(1000)")] public string ReviewResults { get @@ -260119,6 +260584,8 @@ namespace Model private System.Nullable _LogSource; + private EntityRef _Base_Project; + private EntityRef _Person_Persons; #region 可扩展性方法定义 @@ -260153,6 +260620,7 @@ namespace Model public Sys_Log() { + this._Base_Project = default(EntityRef); this._Person_Persons = default(EntityRef); OnCreated(); } @@ -260292,6 +260760,10 @@ namespace Model { if ((this._ProjectId != value)) { + if (this._Base_Project.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } this.OnProjectIdChanging(value); this.SendPropertyChanging(); this._ProjectId = value; @@ -260401,6 +260873,40 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_Log_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.Sys_Log.Remove(this); + } + this._Base_Project.Entity = value; + if ((value != null)) + { + value.Sys_Log.Add(this); + this._ProjectId = value.ProjectId; + } + else + { + this._ProjectId = default(string); + } + this.SendPropertyChanged("Base_Project"); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_Log_Person_Persons", Storage="_Person_Persons", ThisKey="UserId", OtherKey="PersonId", IsForeignKey=true)] public Person_Persons Person_Persons { @@ -276354,7 +276860,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(300)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialCode", DbType="NVarChar(50)")] public string MaterialCode { get @@ -298193,6 +298699,8 @@ namespace Model private System.Nullable _Number; + private System.Nullable _ActNumber; + private string _PackagingCode; private string _TrainNumber; @@ -298209,7 +298717,7 @@ namespace Model { } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50)")] public string Id { get @@ -298305,6 +298813,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActNumber", DbType="Decimal(18,2)")] + public System.Nullable ActNumber + { + get + { + return this._ActNumber; + } + set + { + if ((this._ActNumber != value)) + { + this._ActNumber = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackagingCode", DbType="NVarChar(50)")] public string PackagingCode { @@ -324994,7 +325518,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")] public string Name { get @@ -325571,7 +326095,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] public string PackageContent { get @@ -325762,7 +326286,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] public string PackageContent { get @@ -331101,7 +331625,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] public string PackageContent { get @@ -332573,7 +333097,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PackageContent", DbType="NVarChar(50)")] public string PackageContent { get @@ -342474,7 +342998,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractNo", DbType="NVarChar(1500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractNo", DbType="NVarChar(500)")] public string ContractNo { get @@ -342494,7 +343018,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorks", DbType="NVarChar(1500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorks", DbType="NVarChar(500)")] public string UnitWorks { get