This commit is contained in:
parent
a794871559
commit
ad6116708b
|
|
@ -156,12 +156,14 @@
|
||||||
runat="server" BoxFlex="1" DataKeyNames="JOT_ID" AllowCellEditing="true" AllowColumnLocking="true"
|
runat="server" BoxFlex="1" DataKeyNames="JOT_ID" AllowCellEditing="true" AllowColumnLocking="true"
|
||||||
EnableColumnLines="true" ClicksToEdit="2" DataIDField="JOT_ID" AllowSorting="true"
|
EnableColumnLines="true" ClicksToEdit="2" DataIDField="JOT_ID" AllowSorting="true"
|
||||||
SortField="JOTY_Group,Sort1,Sort2,Sort3,Sort4,Sort5" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true"
|
SortField="JOTY_Group,Sort1,Sort2,Sort3,Sort4,Sort5" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||||
IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" OnRowCommand="Grid1_RowCommand"
|
||||||
EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true"
|
EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" EnableCheckBoxSelect="true" KeepCurrentSelection="true"
|
||||||
OnRowDoubleClick="Grid1_RowDoubleClick" OnRowDataBound="Grid1_RowDataBound">
|
OnRowDoubleClick="Grid1_RowDoubleClick" OnRowDataBound="Grid1_RowDataBound">
|
||||||
<Columns>
|
<Columns>
|
||||||
<%--<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center"
|
<%--<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="60px" HeaderTextAlign="Center"
|
||||||
TextAlign="Center" />--%>
|
TextAlign="Center" />--%>
|
||||||
|
<%--<f:CheckBoxField ColumnID="ckbIsSelected" Width="60px" RenderAsStaticField="false"
|
||||||
|
AutoPostBack="true" CommandName="IsSelected" HeaderText="选择" HeaderTextAlign="Center" />--%>
|
||||||
<f:WindowField ColumnID="JOT_JointNo" HeaderTextAlign="Center" TextAlign="Left" Width="100px"
|
<f:WindowField ColumnID="JOT_JointNo" HeaderTextAlign="Center" TextAlign="Left" Width="100px"
|
||||||
WindowID="Window1" HeaderText="焊口代号" DataTextField="JOT_JointNo" DataIFrameUrlFields="JOT_ID"
|
WindowID="Window1" HeaderText="焊口代号" DataTextField="JOT_JointNo" DataIFrameUrlFields="JOT_ID"
|
||||||
DataIFrameUrlFormatString="JointInfoEdit.aspx?JOT_ID={0}" Title="焊口代号" ToolTip="着色表示该焊口已热处理或所在批已封,不能删除和修改!"
|
DataIFrameUrlFormatString="JointInfoEdit.aspx?JOT_ID={0}" Title="焊口代号" ToolTip="着色表示该焊口已热处理或所在批已封,不能删除和修改!"
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,11 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
{
|
{
|
||||||
public partial class JointInfo : PageBase
|
public partial class JointInfo : PageBase
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 定义集合
|
||||||
|
/// </summary>
|
||||||
|
private static List<string> list = new List<string>();
|
||||||
|
|
||||||
#region 加载
|
#region 加载
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载页面
|
/// 加载页面
|
||||||
|
|
@ -492,13 +497,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
{
|
{
|
||||||
isShow = false;
|
isShow = false;
|
||||||
}
|
}
|
||||||
bool isDelete = false;
|
string err = string.Empty;
|
||||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||||
{
|
{
|
||||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||||
if (judgementDelete(rowID, isShow))
|
string content = judgementDelete(rowID, isShow);
|
||||||
|
if (string.IsNullOrEmpty(content))
|
||||||
{
|
{
|
||||||
isDelete = true;
|
|
||||||
Model.SGGLDB db = Funs.DB;
|
Model.SGGLDB db = Funs.DB;
|
||||||
var hotProessTrustItem = db.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == rowID);
|
var hotProessTrustItem = db.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == rowID);
|
||||||
if (hotProessTrustItem != null)
|
if (hotProessTrustItem != null)
|
||||||
|
|
@ -520,11 +525,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
BLL.HJGL_PW_JointInfoService.DeleteJointInfo(rowID);
|
BLL.HJGL_PW_JointInfoService.DeleteJointInfo(rowID);
|
||||||
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除焊口信息");
|
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除焊口信息");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
err += content;
|
||||||
}
|
}
|
||||||
if (isDelete)
|
}
|
||||||
|
if (string.IsNullOrEmpty(err))
|
||||||
{
|
{
|
||||||
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
|
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert.ShowInTop(err, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
this.BindGrid();
|
this.BindGrid();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -1065,7 +1078,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
/// 判断是否可以删除
|
/// 判断是否可以删除
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private bool judgementDelete(string id, bool isShow)
|
private string judgementDelete(string id, bool isShow)
|
||||||
{
|
{
|
||||||
string content = string.Empty;
|
string content = string.Empty;
|
||||||
//if (BLL.Funs.DB.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == id) != null
|
//if (BLL.Funs.DB.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == id) != null
|
||||||
|
|
@ -1076,7 +1089,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
var joint = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(id);
|
var joint = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(id);
|
||||||
if (!string.IsNullOrEmpty(joint.DReportID))
|
if (!string.IsNullOrEmpty(joint.DReportID))
|
||||||
{
|
{
|
||||||
content = "该焊口已提交焊接记录,不能删除!";
|
content = "焊口"+joint.JOT_JointNo+"已提交焊接记录,不能删除!";
|
||||||
}
|
}
|
||||||
var batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailByJotId(id);
|
var batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailByJotId(id);
|
||||||
if (batchDetail != null)
|
if (batchDetail != null)
|
||||||
|
|
@ -1084,22 +1097,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
var batch = BLL.HJGL_BO_BatchService.GetBatchById(batchDetail.BatchId);
|
var batch = BLL.HJGL_BO_BatchService.GetBatchById(batchDetail.BatchId);
|
||||||
if (batch.BatchIsClosed == true)
|
if (batch.BatchIsClosed == true)
|
||||||
{
|
{
|
||||||
content = "该焊口所在批已关闭,不能删除!";
|
content = "焊口"+ joint.JOT_JointNo + "所在批已关闭,不能删除!";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return content;
|
||||||
if (string.IsNullOrEmpty(content))
|
//if (string.IsNullOrEmpty(content))
|
||||||
{
|
//{
|
||||||
return true;
|
// return true;
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
if (isShow)
|
// if (isShow)
|
||||||
{
|
// {
|
||||||
Alert.ShowInTop(content, MessageBoxIcon.Error);
|
// Alert.ShowInTop(content, MessageBoxIcon.Error);
|
||||||
}
|
// }
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
@ -1274,5 +1287,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Grid行点击事件
|
||||||
|
/// <summary>
|
||||||
|
/// Grid1行点击事件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||||
|
{
|
||||||
|
string rowID = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||||
|
if (e.CommandName == "IsSelected")
|
||||||
|
{
|
||||||
|
CheckBoxField checkField = (CheckBoxField)Grid1.FindColumn("ckbIsSelected");
|
||||||
|
if (checkField.GetCheckedState(e.RowIndex))
|
||||||
|
{
|
||||||
|
if (!list.Contains(rowID))
|
||||||
|
{
|
||||||
|
list.Add(rowID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (list.Contains(rowID))
|
||||||
|
{
|
||||||
|
list.Remove(rowID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue