diff --git a/CreateModel.bat b/CreateModel.bat index 2f27853..27ceb4a 100644 --- a/CreateModel.bat +++ b/CreateModel.bat @@ -25,9 +25,9 @@ REM -------------- @echo 设置.net控制台环境 @echo. -@call "%VS100COMNTOOLS%"vsvars32.bat +@call "%VS150%" -SqlMetal /views /server:.\SQL2016 /database:HJGLDB_ZJBSF /code:%Model_ROOT%\Model.cs /namespace:Model +SqlMetal /views /server:. /database:HJGLDB_ZJBSF /code:%Model_ROOT%\Model.cs /namespace:Model @ECHO 完成 pause diff --git a/HJGL/.vs/HJGL/v17/.suo b/HJGL/.vs/HJGL/v17/.suo index 57b9828..54269fb 100644 Binary files a/HJGL/.vs/HJGL/v17/.suo and b/HJGL/.vs/HJGL/v17/.suo differ diff --git a/HJGL/BLL/WeldingProcess/TestPackageManage/TestPackageManageEditService.cs b/HJGL/BLL/WeldingProcess/TestPackageManage/TestPackageManageEditService.cs index 6ad01a1..c2f45b3 100644 --- a/HJGL/BLL/WeldingProcess/TestPackageManage/TestPackageManageEditService.cs +++ b/HJGL/BLL/WeldingProcess/TestPackageManage/TestPackageManageEditService.cs @@ -169,6 +169,9 @@ namespace BLL newPipelineList.PTP_ID = IsoList.PTP_ID; newPipelineList.PipelineId = IsoList.PipelineId; newPipelineList.PT_DataType = IsoList.PT_DataType; + newPipelineList.IsAll = IsoList.IsAll; + newPipelineList.WorkAreaId= IsoList.WorkAreaId; + newPipelineList.WeldJonintCode = IsoList.WeldJonintCode; db.PTP_PipelineList.InsertOnSubmit(newPipelineList); db.SubmitChanges(); } diff --git a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx index b0bb791..c9bf320 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx +++ b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx @@ -119,7 +119,7 @@ + BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right" Collapsed="false"> @@ -155,20 +155,20 @@ - + - + - + - @@ -230,6 +230,7 @@ diff --git a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs index d6f8508..4555aa1 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.cs @@ -5,6 +5,7 @@ using System.Data.SqlClient; using System.Linq; using System.Web.ModelBinding; using BLL; +using Model; using Newtonsoft.Json.Linq; namespace FineUIPro.Web.WeldingProcess.TestPackageManage @@ -172,6 +173,14 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage } this.txtRemark.Text = testPackageManage.Remark; + var items = Funs.DB.PTP_PipelineList.Where(t => t.PTP_ID == testPackageManage.PTP_ID) + .Select(t=>t.WorkAreaId).FirstOrDefault(); + + if (items != null) + { + drpWorkArea.SelectedValue = items; + } + this.BindGrid(); ////鍒濆鍖栭〉闈 this.ShowGridItem(); } @@ -194,22 +203,46 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage /// private void BindGrid() { - string strSql = @"SELECT IsoInfo.ProjectId,IsoInfo.WorkAreaId,WorkArea.WorkAreaCode,IsoInfo.PipelineId,IsoInfo.PipelineCode, - IsoInfo.DesignPressure,IsoInfo.DesignTemperature, WorkArea.InstallationId,IsoInfo.UnitId, - IsoInfo.TestPressure,IsoInfo.TestTemperature,bs.MediumName,IsoInfo.SingleNumber, - IsoInfo.Specification,IsoInfo.PipingClassId,IsoInfo.MainMaterialId,IsoList.PT_PipeId,IsoList.PTP_ID - FROM dbo.Pipeline_Pipeline AS IsoInfo - LEFT JOIN DBO.Project_WorkArea AS WorkArea ON IsoInfo.WorkAreaId =WorkArea.WorkAreaId - LEFT JOIN dbo.Base_Medium AS bs ON bs.MediumId = IsoInfo.MediumId - LEFT JOIN dbo.PTP_PipelineList AS IsoList ON IsoList.PipelineId = IsoInfo.PipelineId + string strSql = string.Empty; + if (string.IsNullOrEmpty(this.PTP_ID)) + { + strSql = @"SELECT + IsoInfo.ProjectId,IsoInfo.WorkAreaId,WorkArea.WorkAreaCode,IsoInfo.PipelineId,IsoInfo.PipelineCode, + IsoInfo.DesignPressure,IsoInfo.DesignTemperature, WorkArea.InstallationId,IsoInfo.UnitId, + IsoInfo.TestPressure,IsoInfo.TestTemperature,bs.MediumName,IsoInfo.SingleNumber + FROM dbo.Pipeline_Pipeline AS IsoInfo + LEFT JOIN DBO.Project_WorkArea AS WorkArea ON IsoInfo.WorkAreaId =WorkArea.WorkAreaId + LEFT JOIN dbo.Base_Medium AS bs ON bs.MediumId = IsoInfo.MediumId WHERE IsoInfo.ProjectId= @ProjectId AND IsoInfo.UnitId= @UnitId - AND WorkArea.InstallationId= @InstallationId AND (IsoList.PTP_ID IS NULL OR IsoList.PTP_ID = @PTP_ID)"; + AND WorkArea.InstallationId= @InstallationId + AND NOT EXISTS(select 1 from PTP_PipelineList where IsoInfo.PipelineId=PTP_PipelineList.PipelineId and isAll=1) "; + } + else + { + strSql = @"SELECT + IsoInfo.ProjectId,IsoInfo.WorkAreaId,WorkArea.WorkAreaCode,IsoInfo.PipelineId,IsoInfo.PipelineCode, + IsoInfo.DesignPressure,IsoInfo.DesignTemperature, WorkArea.InstallationId,IsoInfo.UnitId, + IsoInfo.TestPressure,IsoInfo.TestTemperature,bs.MediumName,IsoInfo.SingleNumber, + IsoList.isAll,(case when (isnull(IsoList.WeldJonintCode,'')='') then '鍏ㄩ儴' else IsoList.WeldJonintCode end) as WeldJonintCode + FROM dbo.Pipeline_Pipeline AS IsoInfo + LEFT JOIN DBO.Project_WorkArea AS WorkArea ON IsoInfo.WorkAreaId =WorkArea.WorkAreaId + LEFT JOIN dbo.Base_Medium AS bs ON bs.MediumId = IsoInfo.MediumId + LEFT JOIN dbo.PTP_PipelineList AS IsoList ON IsoList.PipelineId = IsoInfo.PipelineId and IsoInfo.WorkAreaId=IsoList.WorkAreaId + WHERE IsoInfo.ProjectId= @ProjectId AND IsoInfo.UnitId= @UnitId + AND WorkArea.InstallationId= @InstallationId "; + } List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); - listStr.Add(new SqlParameter("@PTP_ID", this.PTP_ID)); + listStr.Add(new SqlParameter("@UnitId", this.drpUnit.SelectedValue)); listStr.Add(new SqlParameter("@InstallationId", this.drpInstallation.SelectedValue)); + if (!string.IsNullOrEmpty(this.PTP_ID)) + { + strSql += " AND IsoList.PTP_ID=@PTP_ID"; + listStr.Add(new SqlParameter("@PTP_ID", this.PTP_ID)); + } + if (this.drpWorkArea.SelectedValue != Const._Null && drpWorkArea.SelectedValue!=null) { strSql += " AND IsoInfo.WorkAreaId = @WorkAreaId"; @@ -495,15 +528,26 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage BLL.TestPackageManageEditService.AddTestPackage(testPackage); BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TestPackageManageEditMenuId, Const.BtnAdd, this.PTP_ID); } + JArray teamGroupData = Grid1.GetMergedData(); - foreach (var item in listSelects) + foreach (JObject teamGroupRow in teamGroupData) { - Model.PTP_PipelineList newitem = new Model.PTP_PipelineList(); - newitem.PTP_ID = this.PTP_ID; - newitem.PipelineId = item; - BLL.TestPackageManageEditService.AddPipelineList(newitem); + string PipelineId = teamGroupRow["id"].ToString(); + string status = teamGroupRow.Value("status"); + if (listSelects.Contains(PipelineId)) + { + JObject values = teamGroupRow.Value("values"); + string WeldJonintCodes = values.Value("isALL"); + string workAreaId = values.Value("WorkAreaId"); + Model.PTP_PipelineList newitem = new Model.PTP_PipelineList(); + newitem.PTP_ID = this.PTP_ID; + newitem.PipelineId = PipelineId; + newitem.IsAll = WeldJonintCodes=="鍏ㄩ儴" ? true : false; + newitem.WeldJonintCode = WeldJonintCodes; + newitem.WorkAreaId = workAreaId; + BLL.TestPackageManageEditService.AddPipelineList(newitem); + } } - ShowNotify("淇濆瓨鎴愬姛锛", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.PTP_ID) + ActiveWindow.GetHidePostBackReference()); @@ -537,30 +581,54 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage listSelects.Add(rowID); } } + } #endregion #region 缁戝畾鐒婂彛淇℃伅Grid2鍒楄〃 + private void GetInitGrid1Data() { for (int i = 0; i < Grid1.Rows.Count; i++) { string rowID = Grid1.DataKeys[i][0].ToString(); - this.GetDataJointGrid2(rowID); + this.GetBindGrid2Data(rowID); } } - private void GetDataJointGrid2(string PipelineID) + private void GetBindGrid2Data(string PipelineID) { - string sql = @"SELECT WeldJointId,PipelineId,WeldJointCode FROM View_Pipeline_WeldJoint WHERE PipelineId =@PipelineId order by WeldJointCode"; - SqlParameter[] sp = new SqlParameter[] - { - new SqlParameter("@PipelineId",PipelineID) - }; - DataTable dt=SQLHelper.GetDataTableRunText(sql, sp); - this.Grid2.DataSource = dt; + this.Grid2.DataSource = GetDataJointGrid2(PipelineID); this.Grid2.DataBind(); } + private List GetDataJointGrid2(string PipelineID) + { + string[] arr = null; + var tempData=Funs.DB.PTP_PipelineList.Where(t=>t.PipelineId == PipelineID && t.IsAll==false) + .Select(t=>t.WeldJonintCode).FirstOrDefault(); + + if (tempData != null) + { + arr = tempData.Split(','); + } + var query = Funs.DB.View_Pipeline_WeldJoint.Where(t => t.PipelineId == PipelineID ) + .OrderBy(t => t.WeldJointCode).AsQueryable(); + if (arr != null) + { + query = query.Where(t => !arr.Contains(t.WeldJointCode)); + } + return query.ToList(); + + } + + + + private Dictionary> GetModifiedDict() + { + Dictionary> modifiedDict = Grid2.GetModifiedDict(); + + return modifiedDict; + } #endregion @@ -629,5 +697,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage this.ShowGridItem(); } #endregion + + } } \ No newline at end of file diff --git a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.designer.cs index dee04ac..924c544 100644 --- a/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.designer.cs +++ b/HJGL/FineUIPro.Web/WeldingProcess/TestPackageManage/TestPackageManageItemEdit.aspx.designer.cs @@ -429,13 +429,22 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage protected global::FineUIPro.Grid Grid1; /// - /// DropDownBox1 鎺т欢銆 + /// WorkAreaId 鎺т欢銆 /// /// /// 鑷姩鐢熸垚鐨勫瓧娈点 /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 /// - protected global::FineUIPro.DropDownBox DropDownBox1; + protected global::FineUIPro.RenderField WorkAreaId; + + /// + /// txtIsAll 鎺т欢銆 + /// + /// + /// 鑷姩鐢熸垚鐨勫瓧娈点 + /// 鑻ヨ杩涜淇敼锛岃灏嗗瓧娈靛0鏄庝粠璁捐鍣ㄦ枃浠剁Щ鍒颁唬鐮侀殣钘忔枃浠躲 + /// + protected global::FineUIPro.DropDownBox txtIsAll; /// /// Grid2 鎺т欢銆 diff --git a/HJGL/Model/Model.cs b/HJGL/Model/Model.cs index 8ba37d0..a997062 100644 --- a/HJGL/Model/Model.cs +++ b/HJGL/Model/Model.cs @@ -29,10 +29,6 @@ namespace Model #region 鍙墿灞曟ф柟娉曞畾涔 partial void OnCreated(); - partial void OnCreated() - { - this.CommandTimeout = 600; - } partial void InsertAttachFile(AttachFile instance); partial void UpdateAttachFile(AttachFile instance); partial void DeleteAttachFile(AttachFile instance); @@ -22484,12 +22480,12 @@ namespace Model private string _DetectionStandard; - private string _Tabler; - private string _Remark; private System.Nullable _CreatedTime; + private string _Tabler; + #region 鍙墿灞曟ф柟娉曞畾涔 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -22508,12 +22504,12 @@ namespace Model partial void OnUnitIdChanged(); partial void OnDetectionStandardChanging(string value); partial void OnDetectionStandardChanged(); - partial void OnTablerChanging(string value); - partial void OnTablerChanged(); partial void OnRemarkChanging(string value); partial void OnRemarkChanged(); partial void OnCreatedTimeChanging(System.Nullable value); partial void OnCreatedTimeChanged(); + partial void OnTablerChanging(string value); + partial void OnTablerChanged(); #endregion public PMI_Delegation() @@ -22581,7 +22577,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] public string ProjectId { get @@ -22661,26 +22657,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Tabler", DbType="NVarChar(50)")] - public string Tabler - { - get - { - return this._Tabler; - } - set - { - if ((this._Tabler != value)) - { - this.OnTablerChanging(value); - this.SendPropertyChanging(); - this._Tabler = value; - this.SendPropertyChanged("Tabler"); - this.OnTablerChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(255)")] public string Remark { @@ -22721,6 +22697,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Tabler", DbType="NVarChar(50)")] + public string Tabler + { + get + { + return this._Tabler; + } + set + { + if ((this._Tabler != value)) + { + this.OnTablerChanging(value); + this.SendPropertyChanging(); + this._Tabler = value; + this.SendPropertyChanged("Tabler"); + this.OnTablerChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -22760,10 +22756,10 @@ namespace Model private int _Status; - private System.Nullable _CheckTime; - private string _ReportNo; + private System.Nullable _CheckTime; + private System.Nullable _ReportTime; #region 鍙墿灞曟ф柟娉曞畾涔 @@ -22782,10 +22778,10 @@ namespace Model partial void OnAcceptanceChanged(); partial void OnStatusChanging(int value); partial void OnStatusChanged(); - partial void OnCheckTimeChanging(System.Nullable value); - partial void OnCheckTimeChanged(); partial void OnReportNoChanging(string value); partial void OnReportNoChanged(); + partial void OnCheckTimeChanging(System.Nullable value); + partial void OnCheckTimeChanged(); partial void OnReportTimeChanging(System.Nullable value); partial void OnReportTimeChanged(); #endregion @@ -22895,7 +22891,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Status", DbType="Int NOT NULL")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="status", Storage="_Status", DbType="Int NOT NULL")] public int Status { get @@ -22915,26 +22911,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Name="checkTime", Storage="_CheckTime", DbType="DateTime")] - public System.Nullable CheckTime - { - get - { - return this._CheckTime; - } - set - { - if ((this._CheckTime != value)) - { - this.OnCheckTimeChanging(value); - this.SendPropertyChanging(); - this._CheckTime = value; - this.SendPropertyChanged("CheckTime"); - this.OnCheckTimeChanged(); - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Name="reportNo", Storage="_ReportNo", DbType="NVarChar(50)")] public string ReportNo { @@ -22955,6 +22931,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="checkTime", Storage="_CheckTime", DbType="DateTime")] + public System.Nullable CheckTime + { + get + { + return this._CheckTime; + } + set + { + if ((this._CheckTime != value)) + { + this.OnCheckTimeChanging(value); + this.SendPropertyChanging(); + this._CheckTime = value; + this.SendPropertyChanged("CheckTime"); + this.OnCheckTimeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="reportTime", Storage="_ReportTime", DbType="DateTime")] public System.Nullable ReportTime { @@ -25380,6 +25376,12 @@ namespace Model private string _PT_DataType; + private string _WorkAreaId; + + private System.Nullable _IsAll; + + private string _WeldJonintCode; + private EntityRef _Pipeline_Pipeline; private EntityRef _PTP_TestPackage; @@ -25396,6 +25398,12 @@ namespace Model partial void OnPipelineIdChanged(); partial void OnPT_DataTypeChanging(string value); partial void OnPT_DataTypeChanged(); + partial void OnWorkAreaIdChanging(string value); + partial void OnWorkAreaIdChanged(); + partial void OnIsAllChanging(System.Nullable value); + partial void OnIsAllChanged(); + partial void OnWeldJonintCodeChanging(string value); + partial void OnWeldJonintCodeChanged(); #endregion public PTP_PipelineList() @@ -25493,6 +25501,66 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaId", DbType="NVarChar(50)")] + public string WorkAreaId + { + get + { + return this._WorkAreaId; + } + set + { + if ((this._WorkAreaId != value)) + { + this.OnWorkAreaIdChanging(value); + this.SendPropertyChanging(); + this._WorkAreaId = value; + this.SendPropertyChanged("WorkAreaId"); + this.OnWorkAreaIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="isAll", Storage="_IsAll", DbType="Bit")] + public System.Nullable IsAll + { + get + { + return this._IsAll; + } + set + { + if ((this._IsAll != value)) + { + this.OnIsAllChanging(value); + this.SendPropertyChanging(); + this._IsAll = value; + this.SendPropertyChanged("IsAll"); + this.OnIsAllChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldJonintCode", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string WeldJonintCode + { + get + { + return this._WeldJonintCode; + } + set + { + if ((this._WeldJonintCode != value)) + { + this.OnWeldJonintCodeChanging(value); + this.SendPropertyChanging(); + this._WeldJonintCode = value; + this.SendPropertyChanged("WeldJonintCode"); + this.OnWeldJonintCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_PTP_IsoList_PTP_IsoList", Storage="_Pipeline_Pipeline", ThisKey="PipelineId", OtherKey="PipelineId", IsForeignKey=true)] public Pipeline_Pipeline Pipeline_Pipeline { @@ -38595,6 +38663,8 @@ namespace Model private string _ProjectId; + private System.Nullable _IsPMI; + private string _PipelineCode; private string _PipelineId; @@ -38725,6 +38795,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Name="isPMI", Storage="_IsPMI", DbType="Bit")] + public System.Nullable IsPMI + { + get + { + return this._IsPMI; + } + set + { + if ((this._IsPMI != value)) + { + this._IsPMI = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipelineCode", DbType="NVarChar(100)")] public string PipelineCode { @@ -40733,8 +40819,6 @@ namespace Model private string _PipingClassCode; - private string _PIPClassCode; - private string _WeldingDate; private System.Nullable _IsCancel; @@ -41843,22 +41927,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PIPClassCode", DbType="NVarChar(50)")] - public string PIPClassCode - { - get - { - return this._PIPClassCode; - } - set - { - if ((this._PIPClassCode != value)) - { - this._PIPClassCode = value; - } - } - } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeldingDate", DbType="VarChar(100)")] public string WeldingDate { @@ -46255,7 +46323,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WelderIds", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WelderIds", DbType="VarChar(1000)")] public string WelderIds { get