test packege

This commit is contained in:
jackchenyang 2024-05-22 20:36:40 +08:00
parent cc686533f3
commit ff6c6d3470
7 changed files with 270 additions and 111 deletions

View File

@ -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

Binary file not shown.

View File

@ -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();
}

View File

@ -119,7 +119,7 @@
</Items>
<Items>
<f:Form ID="Form2" ShowBorder="true" ShowHeader="true" AutoScroll="true" Title="查询条件" EnableCollapse="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right" Collapsed="true">
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right" Collapsed="false">
<Rows>
<f:FormRow>
<Items>
@ -155,20 +155,20 @@
<f:RenderField HeaderText="工作区" ColumnID="WorkAreaCode" DataField="WorkAreaCode" SortField="WorkAreaCode"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField ID="WorkAreaId" ColumnID="WorkAreaId" DataField="WorkAreaId" runat="server" Hidden="true"></f:RenderField>
<f:RenderField HeaderText="管线编号" ColumnID="PipelineCode" DataField="PipelineCode" SortField="PipelineCode"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="220px">
</f:RenderField>
<f:RenderField HeaderText="部分/全部" Width="200" ColumnID="isALL">
<f:RenderField HeaderText="部分/全部焊口" Width="200" RendererFunction="selectData" ColumnID="isALL" DataField="WeldJonintCode" >
<Editor>
<f:DropDownBox runat="server" ID="DropDownBox1" EmptyText="请选择"
EnableMultiSelect="true" AutoShowClearIcon="true">
<f:DropDownBox runat="server" ID="txtIsAll" EmptyText="全部"
EnableMultiSelect="true" TopSpaceFirst="true" AutoShowClearIcon="true" >
<PopPanel>
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true" KeepCurrentSelection="true"
Hidden="true" DataIDField="WeldJointCode" DataTextField="WeldJointCode" EnableMultiSelect="true"
<f:Grid ID="Grid2" Width="300" ShowBorder="true" ShowHeader="false" runat="server" EnableCheckBoxSelect="true" KeepCurrentSelection="true"
Hidden="true" DataKeyNames="PipelineId" DataIDField="WeldJointCode" DataTextField="WeldJointCode" EnableMultiSelect="true"
AllowPaging="true" PageSize="10" ShowPagingMessage="false" PagingType="NumberButton">
<Columns>
<f:RenderField ColumnID="WeldJointCode" ExpandUnusedSpace="true" MinWidth="150px" DataField="WeldJointCode" HeaderText="焊口号" />
<f:RenderField ColumnID="WeldJointCode" ExpandUnusedSpace="true" DataField="WeldJointCode" HeaderText="焊口号" />
</Columns>
</f:Grid>
</PopPanel>
@ -230,6 +230,7 @@
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
var txtIsAllClientID = '<%= txtIsAll.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
@ -238,8 +239,16 @@
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
function selectData(value) {
if (value == '')
return '全部';
var ddlHobby = F(txtIsAllClientID);
var hobbies = value.split(',');
console.log(hobbies);
}
</script>
</body>
</html>

View File

@ -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
/// </summary>
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<SqlParameter> listStr = new List<SqlParameter>();
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<string>("status");
if (listSelects.Contains(PipelineId))
{
JObject values = teamGroupRow.Value<JObject>("values");
string WeldJonintCodes = values.Value<string>("isALL");
string workAreaId = values.Value<string>("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<View_Pipeline_WeldJoint> 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<int, Dictionary<string, object>> GetModifiedDict()
{
Dictionary<int, Dictionary<string, object>> modifiedDict = Grid2.GetModifiedDict();
return modifiedDict;
}
#endregion
@ -629,5 +697,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
this.ShowGridItem();
}
#endregion
}
}

View File

@ -429,13 +429,22 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// DropDownBox1 控件。
/// WorkAreaId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox DropDownBox1;
protected global::FineUIPro.RenderField WorkAreaId;
/// <summary>
/// txtIsAll 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox txtIsAll;
/// <summary>
/// Grid2 控件。

View File

@ -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<System.DateTime> _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<System.DateTime> 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<System.DateTime> _CheckTime;
private string _ReportNo;
private System.Nullable<System.DateTime> _CheckTime;
private System.Nullable<System.DateTime> _ReportTime;
#region
@ -22782,10 +22778,10 @@ namespace Model
partial void OnAcceptanceChanged();
partial void OnStatusChanging(int value);
partial void OnStatusChanged();
partial void OnCheckTimeChanging(System.Nullable<System.DateTime> value);
partial void OnCheckTimeChanged();
partial void OnReportNoChanging(string value);
partial void OnReportNoChanged();
partial void OnCheckTimeChanging(System.Nullable<System.DateTime> value);
partial void OnCheckTimeChanged();
partial void OnReportTimeChanging(System.Nullable<System.DateTime> 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<System.DateTime> 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<System.DateTime> 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<System.DateTime> ReportTime
{
@ -25380,6 +25376,12 @@ namespace Model
private string _PT_DataType;
private string _WorkAreaId;
private System.Nullable<bool> _IsAll;
private string _WeldJonintCode;
private EntityRef<Pipeline_Pipeline> _Pipeline_Pipeline;
private EntityRef<PTP_TestPackage> _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<bool> 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<bool> 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<bool> _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<bool> 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<bool> _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