This commit is contained in:
parent
3351bc42ce
commit
66f479da9c
Binary file not shown.
|
@ -1329,6 +1329,15 @@ namespace Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 确定要删除PMI委托吗 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string DeletePMITrust {
|
||||
get {
|
||||
return ResourceManager.GetString("DeletePMITrust", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 删除项目信息 的本地化字符串。
|
||||
/// </summary>
|
||||
|
@ -3696,6 +3705,15 @@ namespace Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 不存在此PMI委托 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string PMICodeNotExists {
|
||||
get {
|
||||
return ResourceManager.GetString("PMICodeNotExists", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 PMI处理委托 的本地化字符串。
|
||||
/// </summary>
|
||||
|
|
|
@ -2130,4 +2130,10 @@
|
|||
<data name="PMIError" xml:space="preserve">
|
||||
<value>PMI委托单保存失败</value>
|
||||
</data>
|
||||
<data name="DeletePMITrust" xml:space="preserve">
|
||||
<value>确定要删除PMI委托吗</value>
|
||||
</data>
|
||||
<data name="PMICodeNotExists" xml:space="preserve">
|
||||
<value>不存在此PMI委托</value>
|
||||
</data>
|
||||
</root>
|
|
@ -49,7 +49,7 @@
|
|||
Icon="TableEdit" runat="server" OnClick="btnEdit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Text="<%$ Resources:Lan,Delete %>" ToolTip="<%$ Resources:Lan,Delete %>"
|
||||
ConfirmText="<%$ Resources:Lan,DeleteHotProessTrust %>" ConfirmTarget="Top" Icon="Delete"
|
||||
ConfirmText="<%$ Resources:Lan,DeletePMITrust %>" ConfirmTarget="Top" Icon="Delete"
|
||||
runat="server" OnClick="btnDelete_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
@ -159,7 +159,6 @@
|
|||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
|
@ -184,19 +183,10 @@
|
|||
EnableMaximize="true" Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close"
|
||||
IsModal="true" Width="1090px" Height="660px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuHotProessReport" OnClick="btnMenuHotProessReport_Click"
|
||||
EnablePostBack="true" Icon="Pencil" ConfirmTarget="Top" runat="server" Text="<%$ Resources:Lan,PWHTReport %>">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
|
||||
if (!string.IsNullOrEmpty(this.txtIsoNo.Text.Trim()))
|
||||
{
|
||||
strSql += @" and Trust.PipelineCode like '%'+@PipelineCode+'%' ";
|
||||
strSql += @" and PipelineCode like '%'+@PipelineCode+'%' ";
|
||||
listStr.Add(new SqlParameter("@PipelineCode", this.txtIsoNo.Text.Trim()));
|
||||
}
|
||||
|
||||
|
@ -279,7 +279,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationId, Const.BtnAdd))
|
||||
{
|
||||
this.SetTextTemp();
|
||||
string window = String.Format("PMIDelegationEdit.aspx?PMIDelegationId={0}", string.Empty, "新增 - ");
|
||||
string window = String.Format("PMIDelegationEdit.aspx", string.Empty, "新增 - ") ;
|
||||
PageContext.RegisterStartupScript(Window1.GetSaveStateReference(this.PMIDelegationId)
|
||||
+ Window1.GetShowReference(window));
|
||||
}
|
||||
|
@ -302,7 +302,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
var trustManage = Funs.DB.PMI_Delegation.FirstOrDefault (t=>t.Id==this.PMIDelegationId);
|
||||
if (trustManage != null)
|
||||
{
|
||||
string window = String.Format("HotProessTrustEdit.aspx?HotProessTrustId={0}", this.PMIDelegationId, "编辑 - ");
|
||||
string window = String.Format("PMIDelegationEdit.aspx?PMIDelegationId={0}", this.PMIDelegationId, "编辑 - ");
|
||||
PageContext.RegisterStartupScript(Window1.GetSaveStateReference(this.PMIDelegationId)
|
||||
+ Window1.GetShowReference(window));
|
||||
}
|
||||
|
@ -382,23 +382,6 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 右键编辑
|
||||
/// <summary>
|
||||
/// 热处理报告
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuHotProessReport_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HotProessTrustMenuId, Const.BtnSave))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PMIDelegationEdit.aspx?Id={0}", this.Grid1.SelectedRowID, "编辑PMI处理报告 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
|
@ -310,23 +310,5 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuHotProessReport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuHotProessReport;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Services.Description;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
|
@ -49,7 +50,8 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
this.PageInfoLoad(); ///加载页面
|
||||
this.txtDetectionMethod.Text = "PMI光谱分析";
|
||||
this.txtDetectionMethod.Enabled = false;
|
||||
//this.BindGrid(result); ////初始化页面
|
||||
var viewData=Funs.DB.View_PMI_DelegationDetails.Where(t=>t.PMIId==this.PMIDelegationId).ToList();
|
||||
this.BindGrid(viewData); ////初始化页面
|
||||
this.txtDelegationDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
|
@ -181,36 +183,10 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
{
|
||||
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.PMIDelegationId, Const.BtnSave))
|
||||
{
|
||||
var isExists = Funs.DB.PMI_Delegation.Any(t => t.DelegationNo == this.txtDelegationNo.Text.Trim() && t.ProjectId == this.CurrUser.LoginProjectId);
|
||||
if (isExists)
|
||||
{
|
||||
ShowNotify(Resources.Lan.PMICodeExists, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var pmiModel = new Model.PMI_Delegation();
|
||||
pmiModel.Id = SQLHelper.GetNewID(typeof(Model.PMI_Delegation));
|
||||
pmiModel.DelegationNo = txtDelegationNo.Text.Trim();
|
||||
pmiModel.DelegationDate = !string.IsNullOrEmpty(txtDelegationDate.Text.Trim()) ? DateTime.Parse(txtDelegationDate.Text.Trim()) : DateTime.Now;
|
||||
pmiModel.InstallationId = drpInstallationId.SelectedValue;
|
||||
pmiModel.UnitId = drpUnitId.SelectedValue;
|
||||
pmiModel.ProjectId = this.CurrUser.LoginProjectId;
|
||||
pmiModel.Remark = txtRemark.Text.Trim();
|
||||
pmiModel.DetectionStandard=txtDetectionStandard.Text.Trim();
|
||||
pmiModel.CreatedTime = DateTime.Now;
|
||||
pmiModel.Tabler = this.CurrUser.UserId;
|
||||
this.PMIDelegationId = pmiModel.Id;
|
||||
Funs.DB.PMI_Delegation.InsertOnSubmit(pmiModel);
|
||||
//先删除明细表
|
||||
var deleteEntity= Funs.DB.PMI_DelegationDetails.Where(t => t.PMIId == pmiModel.Id).ToList();
|
||||
if (deleteEntity.Any())
|
||||
{
|
||||
Funs.DB.PMI_DelegationDetails.DeleteAllOnSubmit(deleteEntity);
|
||||
}
|
||||
//再插入明细表
|
||||
this.CollectGridJointInfo();
|
||||
Funs.DB.SubmitChanges();
|
||||
SaveData();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -220,8 +196,7 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
}
|
||||
|
||||
ShowNotify(Resources.Lan.SaveSuccessfully, MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.PMIDelegationId)
|
||||
+ ActiveWindow.GetHidePostBackReference());
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.PMIDelegationId));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -229,6 +204,69 @@ namespace FineUIPro.Web.WeldingProcess.PMI
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void SaveData()
|
||||
{
|
||||
|
||||
if (!string.IsNullOrEmpty(this.PMIDelegationId))
|
||||
{
|
||||
|
||||
var isExists = Funs.DB.PMI_Delegation.Any(t => t.DelegationNo == this.txtDelegationNo.Text.Trim()
|
||||
&& t.ProjectId == this.CurrUser.LoginProjectId && t.Id!=this.PMIDelegationId);
|
||||
if (isExists)
|
||||
{
|
||||
ShowNotify(Resources.Lan.PMICodeExists, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var result = Funs.DB.PMI_Delegation.FirstOrDefault(t => t.Id == this.PMIDelegationId);
|
||||
if(result==null)
|
||||
{
|
||||
ShowNotify(Resources.Lan.PMICodeNotExists, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
result.DelegationNo = txtDelegationNo.Text.Trim();
|
||||
result.DelegationDate = !string.IsNullOrEmpty(txtDelegationDate.Text.Trim()) ? DateTime.Parse(txtDelegationDate.Text.Trim()) : DateTime.Now;
|
||||
result.InstallationId = drpInstallationId.SelectedValue;
|
||||
result.UnitId = drpUnitId.SelectedValue;
|
||||
result.ProjectId = this.CurrUser.LoginProjectId;
|
||||
result.Remark = txtRemark.Text.Trim();
|
||||
result.DetectionStandard = txtDetectionStandard.Text.Trim();
|
||||
result.Tabler = this.CurrUser.UserId;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var isExists = Funs.DB.PMI_Delegation.Any(t => t.DelegationNo == this.txtDelegationNo.Text.Trim() && t.ProjectId == this.CurrUser.LoginProjectId);
|
||||
if (isExists)
|
||||
{
|
||||
ShowNotify(Resources.Lan.PMICodeExists, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var pmiModel = new Model.PMI_Delegation();
|
||||
pmiModel.DelegationNo = txtDelegationNo.Text.Trim();
|
||||
pmiModel.DelegationDate = !string.IsNullOrEmpty(txtDelegationDate.Text.Trim()) ? DateTime.Parse(txtDelegationDate.Text.Trim()) : DateTime.Now;
|
||||
pmiModel.InstallationId = drpInstallationId.SelectedValue;
|
||||
pmiModel.UnitId = drpUnitId.SelectedValue;
|
||||
pmiModel.ProjectId = this.CurrUser.LoginProjectId;
|
||||
pmiModel.Remark = txtRemark.Text.Trim();
|
||||
pmiModel.DetectionStandard = txtDetectionStandard.Text.Trim();
|
||||
pmiModel.Tabler = this.CurrUser.UserId;
|
||||
pmiModel.Id = SQLHelper.GetNewID(typeof(Model.PMI_Delegation));
|
||||
this.PMIDelegationId = pmiModel.Id;
|
||||
pmiModel.CreatedTime = DateTime.Now;
|
||||
Funs.DB.PMI_Delegation.InsertOnSubmit(pmiModel);
|
||||
}
|
||||
|
||||
//先删除明细表
|
||||
var deleteEntity = Funs.DB.PMI_DelegationDetails.Where(t => t.PMIId == this.PMIDelegationId).ToList();
|
||||
if (deleteEntity.Any())
|
||||
{
|
||||
Funs.DB.PMI_DelegationDetails.DeleteAllOnSubmit(deleteEntity);
|
||||
}
|
||||
//再插入明细表
|
||||
this.CollectGridJointInfo();
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 收集Grid页面信息,提交明细
|
||||
|
|
Loading…
Reference in New Issue