From d22783f08fc4e67d231848f9925deb9c2b5d1830 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Fri, 13 Jun 2025 10:54:16 +0800 Subject: [PATCH] =?UTF-8?q?20250613=20=E8=AF=95=E5=8E=8B=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SGGLDB_V2025-06-10-001_bwj.sql | 26 + SGGL/BLL/Common/Const.cs | 10 +- .../TestPackage/TestPackageEditService.cs | 52 +- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 8 + .../HJGL/TestPackage/TestPackageEdit.aspx | 2 + .../HJGL/TestPackage/TestPackageEdit.aspx.cs | 30 + .../TestPackageEdit.aspx.designer.cs | 9 + .../HJGL/TestPackage/TestPackageImport.aspx | 154 ++++ .../TestPackage/TestPackageImport.aspx.cs | 761 ++++++++++++++++++ .../TestPackageImport.aspx.designer.cs | 161 ++++ SGGL/Model/Model.cs | 323 ++++++++ 11 files changed, 1534 insertions(+), 2 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2025-06-10-001_bwj.sql create mode 100644 SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx create mode 100644 SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2025-06-10-001_bwj.sql b/DataBase/版本日志/SGGLDB_V2025-06-10-001_bwj.sql new file mode 100644 index 00000000..f2487412 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2025-06-10-001_bwj.sql @@ -0,0 +1,26 @@ +CREATE VIEW View_TestPackage_PipelineList +as +/*********ѹϸ**********/ +select l.PT_PipeId, +l.PTP_ID, +l.PipelineId, +l.TestPressure, +t.ProjectId, +t.TestPackageNo, +t.TestPackageName, +t.Remark, +t.UnitWorkId, +t.Tabler, +t.TableDate, +p.PipelineCode, +uw.UnitWorkCode, +uw.UnitWorkName, +uw.UnitId, +u.UnitCode, +u.UnitName +from PTP_PipelineList l +left join PTP_TestPackage as t on t.PTP_ID=l.PTP_ID +left join HJGL_Pipeline p on p.PipelineId = l.PipelineId +left join WBS_UnitWork uw on uw.UnitWorkId = t.UnitWorkId +left join Base_Unit u on u.UnitId =uw.UnitId +go diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 00cd10f3..a7db9083 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3504,6 +3504,11 @@ namespace BLL /// 施工作业风险导出模板 /// public const string ConstructionRiskOutTemplateUrl = "File\\Excel\\DataOut\\每周施工作业风险动态管控表.xlsx"; + + /// + /// 试压包导入模板 + /// + public const string TestPackageTemplateUrl = "File\\Excel\\DataIn\\试压包导入模版.xlsx"; #endregion #region 初始化上传路径 @@ -4806,7 +4811,10 @@ namespace BLL /// public const string HJGL_ProductionSchedulingPlanPath = "File\\Excel\\DataOut\\排产计划导出模板.xlsx"; - + /// + /// 试压包导入文件路径 + /// + public static string TestPackageDataImportPath = "FileUpload\\TestPackageDataImport\\"; #region 焊接报表 /// /// 管道焊接工作记录 diff --git a/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs b/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs index 4edc35dd..a3314e5e 100644 --- a/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs +++ b/SGGL/BLL/HJGL/TestPackage/TestPackageEditService.cs @@ -1,4 +1,5 @@ -using System; +using Model; +using System; using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; @@ -405,5 +406,54 @@ namespace BLL return null; } + /// + /// 根据试压包号、单位工程获取试压包信息 + /// + /// + /// + /// + public static PTP_TestPackage GetTestPackageByNo(string testPackageNo, string unitWorkId) + { + Model.SGGLDB db = Funs.DB; + Model.PTP_TestPackage q = null; + q = Funs.DB.PTP_TestPackage.FirstOrDefault(x => x.TestPackageNo == testPackageNo && x.UnitWorkId == unitWorkId); + return q; + } + + + public static List GetTestPackageByUnitWordId(string unitworkId) + { + var q = Funs.DB.PTP_TestPackage.Where(e => e.UnitWorkId == unitworkId).ToList(); + return q; + } + + + public static void DeletePipelineListByUnitWorkId(string unitworkId) + { + var oldPipeline = GetTestPackageByUnitWordId(unitworkId); + if (oldPipeline != null) + { + foreach (var pipeline in oldPipeline) + { + DeletePipelineListByPTP_ID(pipeline.PTP_ID); + } + + } + } + + /// + /// 根据单位工程删除相关试压包 + /// + /// + public static void DeleteTestPackageByUnitworkId(string unitworkId) + { + Model.SGGLDB db = Funs.DB; + var pipeline = db.PTP_TestPackage.Where(e => e.UnitWorkId == unitworkId); + if (pipeline != null) + { + db.PTP_TestPackage.DeleteAllOnSubmit(pipeline); + db.SubmitChanges(); + } + } } } diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 0fbcf266..b54734ff 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1590,6 +1590,7 @@ + @@ -10810,6 +10811,13 @@ TestPackageEdit.aspx + + TestPackageImport.aspx + ASPXCodeBehind + + + TestPackageImport.aspx + TestPackageItemEdit.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx index 9f590f08..7438d6ff 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx @@ -111,6 +111,8 @@ + diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.cs index 9c99a3f2..f22e2e7d 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.cs @@ -597,5 +597,35 @@ namespace FineUIPro.Web.HJGL.TestPackage ctlAuditFlow.data = parameter3D; ctlAuditFlow.BindData(); } + + /// + /// 导入 + /// + /// + /// + protected void btnMenuImport_Click(object sender, EventArgs e) + { + if (this.tvControlItem.SelectedNode.CommandName == "单位工程") + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.TestPackageEditMenuId, Const.BtnAdd)) + { + if (this.tvControlItem.SelectedNode != null && this.tvControlItem.SelectedNode.CommandName == "单位工程") + { + this.SetTextTemp(); + string window = String.Format("TestPackageImport.aspx?unitWorkId={0}", this.tvControlItem.SelectedNodeID, "导入 - "); + PageContext.RegisterStartupScript(Window1.GetSaveStateReference(this.hdPTP_ID.ClientID) + + Window1.GetShowReference(window)); + } + } + else + { + ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("非单位工程类型无法导入!", MessageBoxIcon.Warning); + } + } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.designer.cs index f1512f8c..de7d8cb1 100644 --- a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageEdit.aspx.designer.cs @@ -230,6 +230,15 @@ namespace FineUIPro.Web.HJGL.TestPackage /// protected global::FineUIPro.Menu Menu1; + /// + /// btnMenuImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuImport; + /// /// btnMenuNew 控件。 /// diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx new file mode 100644 index 00000000..4f1ec36d --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx @@ -0,0 +1,154 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPackageImport.aspx.cs" Inherits="FineUIPro.Web.HJGL.TestPackage.TestPackageImport" %> + + + + + + + 试压包导入 + + +
+ + + + + + + + + + + + + + + + + <%----%> + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + --%> + + + + + diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.cs new file mode 100644 index 00000000..99040cf3 --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.cs @@ -0,0 +1,761 @@ +using BLL; +using MiniExcelLibs; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.HJGL.TestPackage +{ + public partial class TestPackageImport : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + /// + /// 试压包集合 + /// + public static List PipelineList = new List(); + + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + /// + /// 导入数据分类(管线) + /// + //public static string DataClassification = "Pipeline"; + public enum ButtonState { Check = 0, Import = 1, Save = 2 } + + public static int State; + + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.hdFileName.Text = string.Empty; + State = (int)ButtonState.Check; + + if (PipelineList != null) + { + PipelineList.Clear(); + } + errorInfos = string.Empty; + //lbVersion.Text = BLL.HJGL_DesignBasisDataImportService.GetNowVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification).ToString(); + //BindGrid2(); + } + } + #endregion + //void BindGrid2() + //{ + // string strSql = @" select Import.DesignBasisDataImportId + // ,Import.ProjectId + // ,Import.UnitWorkId + // ,(Case Import.ImportType when '0' then '补充导入' + // when '1' then '更新导入' end) as ImportType + // ,Import.FileName + // ,Import.FilePath + // ,Import.DataClassification + // ,Import.FileType + // ,Import.FileSize + // ,Import.FileId + // ,Import.Version + // ,Import.Remark + // ,Import.CreateMan + // ,Import.CreateDate + // , Users.PersonName + // from HJGL_DesignBasisDataImport as Import + // left join Person_Persons as Users on Users.PersonId=Import.CreateMan + // where Import.UnitWorkId=@UnitWorkId and Import.ProjectId=@ProjectId and Import.DataClassification=@DataClassification + // order by Import.CreateDate"; + // List listStr = new List(); + // listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + // listStr.Add(new SqlParameter("@UnitWorkId", Request.Params["UnitWorkId"])); + // //listStr.Add(new SqlParameter("@DataClassification", DataClassification)); + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + // // 2.获取当前分页数据 + // //var table = this.GetPagedDataTable(Grid1, tb1); + // Grid2.RecordCount = tb.Rows.Count; + // tb = GetFilteredTable(Grid2.FilteredData, tb); + // var table = this.GetPagedDataTable(Grid2, tb); + // Grid2.DataSource = table; + // Grid2.DataBind(); + // drpVersion.DataSource = BLL.HJGL_DesignBasisDataImportService.GetListVersionByUnitWorkId(Request.Params["UnitWorkId"], DataClassification); + // drpVersion.DataBind(); + + //} + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xlsx") + { + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (PipelineList != null) + { + PipelineList.Clear(); + } + if (!string.IsNullOrEmpty(errorInfos)) + { + errorInfos = string.Empty; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); + } + catch (Exception ex) + { + Alert alert = new Alert + { + Message = "'" + ex.Message + "'", + Target = Target.Self + }; + alert.Show(); + } + } + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + var ds = MiniExcel.Query(fileName).ToList(); + var columns = MiniExcel.GetColumns(fileName); + var cnt = columns.Count; + var reposedata = AddDatasetToSQL(ds, cnt); + if (reposedata.code == 1) + { + State = (int)ButtonState.Import; + ShowNotify("审核完成请点击导入"); + } + else + { + Alert alert = new Alert + { + Message = reposedata.message, + Target = Target.Self + }; + alert.Show(); + //ShowNotify(reposedata.message); + } + } + catch (Exception exc) + { + + ErrLogInfo.WriteLog("试压包导入数据上传失败!", exc); + + } + } + #endregion + + + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集行数 + /// + private Model.ResponeData AddDatasetToSQL(List pds, int count) + { + Model.ResponeData responeData = new Model.ResponeData(); + // string result = string.Empty; + List result = new List(); + //pds = BLL.Funs.FilterBlankLines(pds); + if (count < 5) + { + responeData.code = 0; + responeData.message = "导入Excel格式错误!Excel只有" + count.ToString().Trim() + "列"; + return responeData; + } + if (pds.Count > 0 && pds != null) + { + Model.SGGLDB db = Funs.DB; + var getPipeline = from x in db.View_HJGL_WeldJoint where x.ProjectId == this.CurrUser.LoginProjectId select x; + + Model.WBS_UnitWork unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(Request.Params["UnitWorkId"]); + for (int i = 1; i < pds.Count; i++) + { + Model.View_TestPackage_PipelineList pipeline = new Model.View_TestPackage_PipelineList(); + + if (unitWork != null) + { + pipeline.UnitWorkId = Request.Params["UnitWorkId"]; + pipeline.UnitId = unitWork.UnitId; + } + + string col0 = pds[i].A; + if (string.IsNullOrEmpty(col0)) + { + result.Add("第" + (i + 1).ToString() + "行," + "试压包编号" + "," + "此项为必填项!" + "|"); + } + else + { + pipeline.TestPackageNo = col0; + } + + pipeline.TestPackageName = pds[i].B;//系统名称 + + string col2 = pds[i].C; + if (string.IsNullOrEmpty(col2)) + { + result.Add("第" + (i + 1).ToString() + "行," + "管线号" + "," + "此项为必填项!" + "|"); + } + else + { + var line = getPipeline.FirstOrDefault(u => u.PipelineCode == col2); + if (line!=null) + { + pipeline.PipelineId = line.PipelineId; + pipeline.PipelineCode = col2; + } + } + string col3 = pds[i].D; + if (!string.IsNullOrEmpty(col3)) + { + try + { + decimal testPressure = Convert.ToDecimal(col3); + pipeline.TestPressure = testPressure; + } + catch (Exception) + { + result.Add("第" + (i + 1).ToString() + "行," + "调整试验压力格式输入有误" + "|"); + } + } + pipeline.Remark = pds[i].E; + pipeline.Tabler = this.CurrUser.PersonId; + pipeline.TableDate = DateTime.Now; + + if (!string.IsNullOrEmpty(pipeline.PipelineCode) && !string.IsNullOrEmpty(pipeline.TestPackageNo)) + { + pipeline.ProjectId = this.CurrUser.LoginProjectId; + PipelineList.Add(pipeline); + } + } + if (result.Count > 0) + { + PipelineList.Clear(); + errorInfos = string.Join("|", result.Distinct()); + responeData.code = 0; + responeData.message = errorInfos; + } + else + { + errorInfos = string.Empty; + } + + } + else + { + responeData.code = 0; + responeData.message = "导入数据为空!"; + } + return responeData; + } + #endregion + #endregion + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (State != (int)ButtonState.Import) + { + ShowNotify("请先审核"); + return; + } + if (string.IsNullOrEmpty(errorInfos)) + { + if (!string.IsNullOrEmpty(this.hdFileName.Text)) + { + if (PipelineList.Count > 0) + { + this.Grid1.Hidden = false; + this.Grid1.DataSource = PipelineList; + this.Grid1.DataBind(); + Grid1.RecordCount = PipelineList.Count; + State = (int)ButtonState.Save; + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + + #endregion + #region 提交 + /// + /// 提交 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (State != (int)ButtonState.Save) + { + ShowNotify("请先审核/导入"); + return; + } + if (string.IsNullOrEmpty(errorInfos)) + { + string rootPath = Server.MapPath("~/"); + string oldefilePath = rootPath + initPath + this.hdFileName.Text; + string unitworkId = Request.Params["UnitWorkId"]; + string filePath = rootPath + Const.TestPackageDataImportPath + this.hdFileName.Text; + if (oldefilePath != string.Empty && System.IO.File.Exists(oldefilePath)) + { + if (!Directory.Exists(rootPath + Const.TestPackageDataImportPath)) + { + Directory.CreateDirectory(rootPath + Const.TestPackageDataImportPath); + } + File.Move(oldefilePath, filePath); + } + string FileName = this.fuAttachUrl.FileName; + + if (DrpType.SelectedValue == "1")//更新导入 + { + //BLL.PipelineMatService.DeletePipeLineMatByUnitWorkId(unitworkId);//删除原有管线对应材料 + BLL.WeldJointService.DeleteWeldJointByUnitWorkId(unitworkId);////删除原有管线对应焊口 + BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线 + AddView_HJGL_WeldJoint(PipelineList);//导入数据 + + //Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport(); + //hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID(); + //hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId; + //hJGL_DesignBasisDataImport.UnitWorkId = unitworkId; + //hJGL_DesignBasisDataImport.ImportType = "1"; + //hJGL_DesignBasisDataImport.DataClassification = DataClassification; + //hJGL_DesignBasisDataImport.FileName = FileName; + //hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, ""); + //hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName); + //hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNewVersionByUnitWorkId(unitworkId, DataClassification); + //hJGL_DesignBasisDataImport.Remark = txtRemark.Text; + //hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId; + //hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss"); + //BLL.HJGL_DesignBasisDataImportService.AddHJGL_DesignBasisDataImport(hJGL_DesignBasisDataImport); + + //BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, (decimal)hJGL_DesignBasisDataImport.Version, DataClassification); + + + } + else //补充导入 + { + AddView_HJGL_WeldJoint(PipelineList); + + //Model.HJGL_DesignBasisDataImport hJGL_DesignBasisDataImport = new Model.HJGL_DesignBasisDataImport(); + //hJGL_DesignBasisDataImport.DesignBasisDataImportId = SQLHelper.GetNewID(); + //hJGL_DesignBasisDataImport.ProjectId = this.CurrUser.LoginProjectId; + //hJGL_DesignBasisDataImport.UnitWorkId = unitworkId; + //hJGL_DesignBasisDataImport.ImportType = "0"; + //hJGL_DesignBasisDataImport.DataClassification = DataClassification; + //hJGL_DesignBasisDataImport.FileName = FileName; + //hJGL_DesignBasisDataImport.FilePath = filePath.Replace(rootPath, ""); ; + //hJGL_DesignBasisDataImport.FileType = BLL.HJGL_DesignBasisDataImportService.GetFileType(FileName); + //hJGL_DesignBasisDataImport.Version = BLL.HJGL_DesignBasisDataImportService.GetNowVersionByUnitWorkId(unitworkId, DataClassification); + //hJGL_DesignBasisDataImport.Remark = txtRemark.Text; + //hJGL_DesignBasisDataImport.CreateMan = this.CurrUser.PersonId; + //hJGL_DesignBasisDataImport.CreateDate = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss"); + //BLL.HJGL_DesignBasisDataImportService.AddHJGL_DesignBasisDataImport(hJGL_DesignBasisDataImport); + + //BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, (decimal)hJGL_DesignBasisDataImport.Version, DataClassification); + + } + + ShowNotify("导入成功!", MessageBoxIcon.Success); + PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId); + + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + public void AddView_HJGL_WeldJoint(List PipelineList) + { + string unitworkId = Request.Params["UnitWorkId"]; + + addTestPackage(PipelineList, unitworkId); + addHJGL_WeldJoints(PipelineList, unitworkId); + + } + void addTestPackage(List PipelineList, string UnitWorkId) + { + var pipelines = (from x in PipelineList + select new Model.PTP_TestPackage + { + PTP_ID = x.PTP_ID, + ProjectId = this.CurrUser.LoginProjectId, + UnitId = x.UnitId, + UnitWorkId = x.UnitWorkId, + TestPackageNo=x.TestPackageNo, + TestPackageName=x.TestPackageName, + Tabler =x.Tabler, + TableDate=x.TableDate, + Remark = x.Remark + }).DistinctBy(temp => new + { + temp.PTP_ID, + temp.ProjectId, + temp.UnitId, + temp.UnitWorkId, + temp.TestPackageNo, + temp.TestPackageName, + temp.Remark + }).ToList(); + for (int i = 0; i < pipelines.Count(); i++) + { + Model.PTP_TestPackage pipeline = new Model.PTP_TestPackage(); + pipeline.PTP_ID = pipelines[i].PTP_ID; + pipeline.ProjectId = this.CurrUser.LoginProjectId; + pipeline.UnitId = pipelines[i].UnitId; + pipeline.UnitWorkId = pipelines[i].UnitWorkId; + pipeline.TestPackageNo = pipelines[i].TestPackageNo; + pipeline.TestPackageName = pipelines[i].TestPackageName; + pipeline.Tabler = pipelines[i].Tabler; + pipeline.TableDate = pipelines[i].TableDate; + pipeline.Remark = pipelines[i].Remark; + + var isExistTestPackageNo = TestPackageEditService.GetTestPackageByNo(pipeline.TestPackageNo, pipeline.UnitWorkId); + if (isExistTestPackageNo != null) // 更新试压包 + { + pipeline.PTP_ID = isExistTestPackageNo.PTP_ID; + BLL.TestPackageEditService.UpdateTestPackage(pipeline); + } + else // 增加试压包 + { + pipeline.PTP_ID = SQLHelper.GetNewID(); + BLL.TestPackageEditService.AddTestPackage(pipeline); + } + } + } + void addHJGL_WeldJoints(List PipelineList, string UnitWorkId) + { + Model.SGGLDB db = Funs.DB; + var getpipelines = from y in db.PTP_TestPackage where y.UnitWorkId == UnitWorkId select y; + var allWeldJoints = from x in db.PTP_PipelineList + join y in db.PTP_TestPackage on x.PTP_ID equals y.PTP_ID + where y.UnitWorkId == UnitWorkId + select x; + List weldJoints_add = new List(); + + var weldJoints = (from x in PipelineList + select new Model.PTP_PipelineList + { + PTP_ID = x.PTP_ID, + PipelineId = x.PipelineId, + TestPressure = x.TestPressure, + }).DistinctBy(temp => new + { + temp.PTP_ID, + temp.PipelineId, + temp.TestPressure + }).ToList(); + + var pipelineCodes = weldJoints.Select(x => x.PTP_ID).Distinct().ToList(); + for (int i = 0; i < weldJoints.Count(); i++) + { + Model.PTP_PipelineList weldJoint = new Model.PTP_PipelineList(); + //weldJoint.PipelineId = getpipelines.Where(x => x.TestPackageNo == weldJoints[i].PipelineCode).FirstOrDefault().PipelineId; + //weldJoint.WeldJointCode = weldJoints[i].WeldJointCode; + //weldJoint.PipelineCode = weldJoints[i].PipelineCode; + + + var isExistJot = allWeldJoints.FirstOrDefault(x => x.PTP_ID == weldJoint.PTP_ID && x.PipelineId == weldJoint.PipelineId); + if (isExistJot != null) // 更新焊口 + { + weldJoint.PT_PipeId = isExistJot.PT_PipeId; + BLL.TestPackageEditService.UpdatePipelineList(weldJoint); + } + else // 增加试压管线 + { + weldJoint.PT_PipeId = SQLHelper.GetNewID(); + weldJoints_add.Add(weldJoint); + } + } + if (weldJoints_add.Count > 0) + { + //BLL.TestPackageEditService.AddPipelineList(weldJoints_add); + } + Model.SGGLDB db2 = Funs.DB; + List delJoints = new List(); + var allWeldJoints2 = from x in db2.PTP_PipelineList + join y in db2.PTP_TestPackage on x.PTP_ID equals y.PTP_ID + where y.UnitWorkId == Request.Params["UnitWorkId"] + select x; + foreach (var pipelineCode in pipelineCodes) + { + var pipelineWeldJointCodes = weldJoints.Where(x => x.PTP_ID == pipelineCode).Select(x => x.PipelineId).ToList(); + var q = allWeldJoints2.Where(x => x.PTP_ID == pipelineCode && !pipelineWeldJointCodes.Contains(x.PipelineId)).ToList(); + delJoints.AddRange(q); + } + if (delJoints.Count() > 0) + { + try + { + db2.PTP_PipelineList.DeleteAllOnSubmit(delJoints); + db2.SubmitChanges(); + } + catch (Exception) + { + string weldJointCodes = string.Empty; + foreach (var item in delJoints) + { + weldJointCodes += item.PipelineId + ","; + } + Alert.ShowInParent(weldJointCodes, MessageBoxIcon.Warning); + } + } + } + + //public void AddView_HJGL_WeldJoint(List PipelineList) + //{ + // string unitworkId = Request.Params["UnitWorkId"]; + + // var getPipeline = from x in Funs.DB.View_HJGL_WeldJoint where x.UnitWorkId== unitworkId select x; + // List weldJoints_add = new List(); + + // for (int i = 0; i < PipelineList.Count(); i++) + // { + // var pipeLineId = string.Empty; + // var WeldJointId = string.Empty; + + // Model.HJGL_Pipeline pipeline = new Model.HJGL_Pipeline(); + // pipeline.PipelineId = PipelineList[i].PipelineId; + // pipeline.ProjectId = this.CurrUser.LoginProjectId; + // pipeline.UnitId = PipelineList[i].UnitId; + // pipeline.UnitWorkId = PipelineList[i].UnitWorkId; + // pipeline.PipelineCode = PipelineList[i].PipelineCode; + // pipeline.SingleName = PipelineList[i].SingleName; + // pipeline.SingleNumber = PipelineList[i].SingleNumber; + // pipeline.MediumId = PipelineList[i].MediumId; + // pipeline.PipingClassId = PipelineList[i].PipingClassId; + // pipeline.DetectionRateId = PipelineList[i].DetectionRateId; + // pipeline.DetectionType = PipelineList[i].DetectionType; + // pipeline.DesignPress = PipelineList[i].DesignPress; + // pipeline.DesignTemperature = PipelineList[i].DesignTemperature; + // pipeline.TestMedium = PipelineList[i].TestMedium; + // pipeline.TestPressure = PipelineList[i].TestPressure; + // pipeline.PressurePipingClassId = PipelineList[i].PressurePipingClassId; + // pipeline.PipeLenth = PipelineList[i].PipeLenth; + // pipeline.LeakMedium = PipelineList[i].LeakMedium; + // pipeline.LeakPressure = PipelineList[i].LeakPressure; + // pipeline.VacuumPressure = PipelineList[i].VacuumPressure; + // pipeline.PCMedium = PipelineList[i].PCMedium; + // pipeline.MaterialId = PipelineList[i].MaterialId; + // pipeline.Remark = PipelineList[i].Remark; + + // var isExistPipelineCode = getPipeline.FirstOrDefault(x => x.PipelineCode == pipeline.PipelineCode && x.UnitWorkId == Request.Params["UnitWorkId"]); + // if (isExistPipelineCode != null) // 更新管线 + // { + // pipeLineId = isExistPipelineCode.PipelineId; + // pipeline.PipelineId = isExistPipelineCode.PipelineId; + // BLL.PipelineService.UpdatePipeline(pipeline); + // } + // else // 增加管线 + // { + // pipeLineId = SQLHelper.GetNewID(); + // pipeline.PipelineId = pipeLineId; + // BLL.PipelineService.AddPipeline(pipeline); + + // } + + // Model.HJGL_WeldJoint weldJoint = new Model.HJGL_WeldJoint(); + // weldJoint.PipelineId = pipeLineId; + // weldJoint.WeldJointCode = PipelineList[i].WeldJointCode; + // weldJoint.PipelineCode = PipelineList[i].PipelineCode; + // weldJoint.Material1Id = PipelineList[i].Material1Id; + // weldJoint.Material2Id = PipelineList[i].Material2Id; + // weldJoint.Dia = PipelineList[i].Dia; + // weldJoint.Size = PipelineList[i].Size; + // weldJoint.Thickness = PipelineList[i].Thickness; + // weldJoint.Specification = PipelineList[i].Specification; + // weldJoint.WeldTypeId = PipelineList[i].WeldTypeId; + // weldJoint.DetectionTypeId = PipelineList[i].DetectionTypeId; + // weldJoint.JointAttribute = PipelineList[i].JointAttribute; + // weldJoint.ProjectId= PipelineList[i].ProjectId; + // var isExistJot = getPipeline.FirstOrDefault(x => x.PipelineId == pipeLineId && x.WeldJointCode == PipelineList[i].WeldJointCode); + // if (isExistJot != null) // 更新焊口 + // { + // weldJoint.WeldJointId = isExistJot.WeldJointId; + // BLL.WeldJointService.UpdateWeldJoint(weldJoint); + // } + // else // 增加焊口 + // { + // weldJoint.WeldJointId=SQLHelper.GetNewID(); + // weldJoints_add.Add(weldJoint); + // //BLL.WeldJointService.AddWeldJoint(weldJoint); + // } + // } + // if (weldJoints_add.Count>0) + // { + // BLL.WeldJointService.AddBulkWeldJoint(weldJoints_add); + + // } + + //} + #endregion + + /// + /// 恢复版本 + /// + /// + /// + private void RestoreVersion(string unitworkId, decimal version) + { + //var model = BLL.HJGL_DesignBasisDataImportService.GetDataByUnitWorkIdAndVersion(unitworkId, version, DataClassification); + //if (model != null && model.Count > 0) + //{ + // foreach (var item in model) + // { + + // string rootPath = Server.MapPath("~/"); + // // initFullPath = rootPath + initPath; + // string filePath = rootPath + item.FilePath; + // ImportXlsToData(filePath); + // BLL.PipelineMatService.DeletePipeLineMatByUnitWorkId(unitworkId);//删除原有管线对应材料 + // BLL.WeldJointService.DeleteWeldJointByUnitWorkId(unitworkId);////删除原有管线对应焊口 + // BLL.PipelineService.DeletePipelineByUnitworkId(unitworkId);//删除原有管线 + // AddView_HJGL_WeldJoint(PipelineList);//导入数据 + // PipelineList.Clear(); + + // } + // BLL.HJGL_DesignBasisDataImportVerSionLogService.UpdateVersion(this.CurrUser.LoginProjectId, unitworkId, version, DataClassification); + // PipelineService.RestPipelineAndJoints(this.CurrUser.LoginProjectId); + + // ShowNotify("恢复成功!"); + + //} + + + } + + protected void btnRestore_Click(object sender, EventArgs e) + { + //if (string.IsNullOrEmpty(drpVersion.SelectedValue)) + //{ + // ShowNotify("请选择版本"); + //} + //else + //{ + // PageContext.RegisterStartupScript(Confirm.GetShowReference("确定恢复至该版本吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_Restore"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + + //} + + } + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.TestPackageTemplateUrl; + string filePath = Const.TestPackageTemplateUrl; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + //else if (e.EventArgument == "Confirm_Restore") + //{ + // var unitworkid = Request.Params["UnitWorkId"]; + // decimal version = decimal.Parse(drpVersion.SelectedValue); + // RestoreVersion(unitworkid, version); + //} + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + this.Grid1.DataSource = PipelineList; + this.Grid1.DataBind(); + Grid1.RecordCount = PipelineList.Count; + } + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.designer.cs b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.designer.cs new file mode 100644 index 00000000..c152620c --- /dev/null +++ b/SGGL/FineUIPro.Web/HJGL/TestPackage/TestPackageImport.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HJGL.TestPackage +{ + + + public partial class TestPackageImport + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// DrpType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList DrpType; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 50d54249..c626c90a 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -7241,6 +7241,14 @@ namespace Model } } + public System.Data.Linq.Table View_TestPackage_PipelineList + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table View_Training_TestTrainingItem { get @@ -307737,6 +307745,321 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_TestPackage_PipelineList")] + public partial class View_TestPackage_PipelineList + { + + private string _PT_PipeId; + + private string _PTP_ID; + + private string _PipelineId; + + private System.Nullable _TestPressure; + + private string _ProjectId; + + private string _TestPackageNo; + + private string _TestPackageName; + + private string _Remark; + + private string _UnitWorkId; + + private string _Tabler; + + private System.Nullable _TableDate; + + private string _PipelineCode; + + private string _UnitWorkCode; + + private string _UnitWorkName; + + private string _UnitId; + + private string _UnitCode; + + private string _UnitName; + + public View_TestPackage_PipelineList() + { + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PT_PipeId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string PT_PipeId + { + get + { + return this._PT_PipeId; + } + set + { + if ((this._PT_PipeId != value)) + { + this._PT_PipeId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PTP_ID", DbType="NVarChar(50)")] + public string PTP_ID + { + get + { + return this._PTP_ID; + } + set + { + if ((this._PTP_ID != value)) + { + this._PTP_ID = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineId", DbType="NVarChar(50)")] + public string PipelineId + { + get + { + return this._PipelineId; + } + set + { + if ((this._PipelineId != value)) + { + this._PipelineId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPressure", DbType="Decimal(9,2)")] + public System.Nullable TestPressure + { + get + { + return this._TestPressure; + } + set + { + if ((this._TestPressure != value)) + { + this._TestPressure = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + this._ProjectId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageNo", DbType="VarChar(50)")] + public string TestPackageNo + { + get + { + return this._TestPackageNo; + } + set + { + if ((this._TestPackageNo != value)) + { + this._TestPackageNo = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageName", DbType="VarChar(50)")] + public string TestPackageName + { + get + { + return this._TestPackageName; + } + set + { + if ((this._TestPackageName != value)) + { + this._TestPackageName = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="VarChar(100)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this._Remark = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorkId", DbType="NVarChar(50)")] + public string UnitWorkId + { + get + { + return this._UnitWorkId; + } + set + { + if ((this._UnitWorkId != value)) + { + this._UnitWorkId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Tabler", DbType="NVarChar(50)")] + public string Tabler + { + get + { + return this._Tabler; + } + set + { + if ((this._Tabler != value)) + { + this._Tabler = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TableDate", DbType="DateTime")] + public System.Nullable TableDate + { + get + { + return this._TableDate; + } + set + { + if ((this._TableDate != value)) + { + this._TableDate = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineCode", DbType="NVarChar(200)")] + public string PipelineCode + { + get + { + return this._PipelineCode; + } + set + { + if ((this._PipelineCode != value)) + { + this._PipelineCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorkCode", DbType="NVarChar(10)")] + public string UnitWorkCode + { + get + { + return this._UnitWorkCode; + } + set + { + if ((this._UnitWorkCode != value)) + { + this._UnitWorkCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitWorkName", DbType="NVarChar(30)")] + public string UnitWorkName + { + get + { + return this._UnitWorkName; + } + set + { + if ((this._UnitWorkName != value)) + { + this._UnitWorkName = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(300)")] + public string UnitId + { + get + { + return this._UnitId; + } + set + { + if ((this._UnitId != value)) + { + this._UnitId = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitCode", DbType="NVarChar(100)")] + public string UnitCode + { + get + { + return this._UnitCode; + } + set + { + if ((this._UnitCode != value)) + { + this._UnitCode = value; + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitName", DbType="NVarChar(200)")] + public string UnitName + { + get + { + return this._UnitName; + } + set + { + if ((this._UnitName != value)) + { + this._UnitName = value; + } + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_Training_TestTrainingItem")] public partial class View_Training_TestTrainingItem {