页面提交
This commit is contained in:
parent
ccab4e7401
commit
46efe986a8
|
@ -5,6 +5,11 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
.f-grid-cell[data-yc=yc] {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
|
@ -12,10 +17,9 @@
|
|||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false" ShowHeader="false" Layout="VBox" AutoScroll="true" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" IsFluid="true" ShowBorder="true" ShowHeader="true" Title="现场控制点裁剪"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="ControlId,ParentId,ControlLevel" EnableTree="true"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="ControlId,ParentId,ControlLevel,States" EnableTree="true"
|
||||
TreeColumn="DetectionItems" DataIDField="ControlId" AllowPaging="false" DataParentIDField="ParentId" OnRowDataBound="Grid1_RowDataBound"
|
||||
AllowCellEditing="false" ClicksToEdit="1" OnRowCommand="Grid1_RowCommand"
|
||||
EnableMultiSelect="false">
|
||||
AllowCellEditing="false" ClicksToEdit="1" OnRowCommand="Grid1_RowCommand" ExpandAllTreeNodes="true" EnableMultiSelect="false">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" runat="server">
|
||||
<Items>
|
||||
|
@ -39,10 +43,17 @@
|
|||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="RecordNumber" DataField="RecordNumber" HeaderText="记录格式文本号">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="Partition" Width="100px" DataField="Partition" HeaderText="等级划分">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="ControlCode" Width="100px" DataField="ControlCode" HeaderText="编码">
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField Width="100px" ConfirmText="删除当前选中数据和所有子节点数据?" HeaderText="操作" ConfirmTarget="Top"
|
||||
|
||||
|
||||
<f:LinkButtonField Width="100px" ConfirmText="删除当前选中数据和所有子节点数据?" ColumnID="Delete" ToolTip="删除" ConfirmTarget="Top"
|
||||
CommandName="Delete" Icon="Delete" />
|
||||
<f:LinkButtonField Width="100px" CommandName="fileView" ToolTip="附件" ConfirmTarget="Top" Icon="TableCell" />
|
||||
|
||||
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
@ -54,6 +65,10 @@
|
|||
Target="Parent" EnableResize="true" runat="server" IsModal="true" OnClose="Window1_Close" CloseAction="HidePostBack"
|
||||
Width="800px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="附件查看" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" OnClose="WindowAtt_Close" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<Items>
|
||||
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Text="修改" Icon="Pencil"
|
||||
|
|
|
@ -9,6 +9,7 @@ using System.Linq;
|
|||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using RestSharp;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.WBS.Control
|
||||
{
|
||||
|
@ -29,16 +30,19 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
/// </summary>
|
||||
public void DataBrid()
|
||||
{
|
||||
string strSql = @"select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort from Control_PointCropping as a order by a.ControlLevel,a.Sort asc";
|
||||
string strSql = @"select * from(select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort,a.States,a.Partition from Control_PointCropping as a where isnull(a.ProjectId,'')='' ";
|
||||
string strSql1 = "select a.ControlId,a.ProjectId,a.ParentId,a.ControlCode,a.ControlLevel,a.PlanId,a.PlanTypeId,a.SubItemsId,a.DetectionItems,a.BasedCriterion,a.QualityRecordName,a.RecordNumber,a.Subcontractors,a.OperateTime,a.Sort,a.States,a.Partition from Control_PointCropping as a where a.ProjectId=@ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(sDetectionItems.Text.Trim()))
|
||||
{
|
||||
strSql += " and a.DetectionItems like '%@DetectionItems%'";
|
||||
strSql1 += " and a.DetectionItems like '%@DetectionItems%'";
|
||||
listStr.Add(new SqlParameter("@DetectionItems", this.sDetectionItems.Text.Trim()));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
var zxsql = strSql + " union all " + strSql1 + " ) as t order by t.ControlLevel,t.Sort asc";
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(zxsql, parameter);
|
||||
Grid1.DataSource = tb;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
@ -48,13 +52,17 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
/// </summary>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string rowID = e.RowID;
|
||||
if (e.CommandName == "Delete")
|
||||
{
|
||||
string rowID = e.RowID;
|
||||
DeleteRowByIDInternal(rowID);
|
||||
DataBrid();
|
||||
ShowNotify("删除成功!");
|
||||
}
|
||||
else if (e.CommandName == "fileView")
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/CheckControl&menuId={2}", "-1", rowID, Const.InspectTailTerm)));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -62,11 +70,22 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
/// </summary>
|
||||
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
||||
{
|
||||
int controlLevel = Grid1.DataKeys[e.RowIndex][2] != null ? int.Parse(Grid1.DataKeys[e.RowIndex][2].ToString()) : 2;
|
||||
if (controlLevel < 2)
|
||||
if (Grid1.DataKeys[e.RowIndex][0].ToString() == "595fd674-ca2b-4557-a7c7-1be1096c3825")
|
||||
{
|
||||
e.TreeNodeExpanded = true;
|
||||
|
||||
}
|
||||
var states = int.Parse(Grid1.DataKeys[e.RowIndex][3].ToString());
|
||||
GridColumn isDelete = Grid1.FindColumn("Delete");
|
||||
if (states == 0)
|
||||
{
|
||||
e.CellAttributes[isDelete.ColumnIndex]["data-yc"] = "yc";
|
||||
}
|
||||
|
||||
//int controlLevel = Grid1.DataKeys[e.RowIndex][2] != null ? int.Parse(Grid1.DataKeys[e.RowIndex][2].ToString()) : 2;
|
||||
//if (controlLevel < 2)
|
||||
//{
|
||||
// e.TreeNodeExpanded = true;
|
||||
//}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -94,6 +113,12 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var states = int.Parse(Grid1.DataKeys[rowIndex][3].ToString());
|
||||
if (states == 0)
|
||||
{
|
||||
ShowNotify("系统内置数据,无删除权限!");
|
||||
return;
|
||||
}
|
||||
DeleteRowByIDInternal(rowID);
|
||||
}
|
||||
DataBrid();
|
||||
|
@ -141,8 +166,13 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
ShowNotify("请选择一条数据!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var rowIndex = Grid1.SelectedRowIndex;
|
||||
var states = int.Parse(Grid1.DataKeys[rowIndex][3].ToString());
|
||||
if (states == 0 && !IsEditdata())
|
||||
{
|
||||
ShowNotify("系统内置数据,无编辑权限!");
|
||||
return;
|
||||
}
|
||||
var rowId = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var parentId = Grid1.DataKeys[rowIndex][1] != null ? Grid1.DataKeys[rowIndex][1].ToString() : string.Empty;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference($"PointCroppingEdit.aspx?ControlId={rowId}&ParentId={parentId}", "编辑"));
|
||||
|
@ -156,6 +186,13 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
DataBrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 附件关闭
|
||||
/// </summary>
|
||||
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右击修改
|
||||
/// </summary>
|
||||
|
@ -203,6 +240,21 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否存在删除权限
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool IsEditdata()
|
||||
{
|
||||
var result = false;
|
||||
var userids = new List<string>() { Const.sysglyId, Const.hfnbdId, Const.sedinId };
|
||||
if (userids.Contains(this.CurrUser.UserId))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
@ -122,6 +122,15 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -91,6 +91,19 @@
|
|||
<f:NumberBox runat="server" Label="排序" ID="txtSort" LabelAlign="Right" Required="true" LabelWidth="150"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" ShowHeader="false" ShowBorder="false" Layout="Column" runat="server">
|
||||
<Items>
|
||||
<f:Label runat="server" Text="附件:" CssStyle="padding-left:25px" Width="150px" CssClass="marginr" ShowLabel="false"></f:Label>
|
||||
<f:Button ID="BtnFile" Text="附件" ToolTip="附件" Icon="TableCell" runat="server"
|
||||
OnClick="BtnFile_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</f:ContentPanel>
|
||||
|
@ -98,6 +111,10 @@
|
|||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" Title="附件" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" OnClose="WindowAtt_Close" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -29,12 +29,32 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
set { ViewState["ControlId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string FId
|
||||
{
|
||||
get { return (string)ViewState["FId"]; }
|
||||
set { ViewState["FId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 问题图片是否可编辑
|
||||
/// </summary>
|
||||
public int FileImg
|
||||
{
|
||||
get { return (int)ViewState["FileImg"]; }
|
||||
set { ViewState["FileImg"] = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.ControlId = Request.Params["ControlId"];
|
||||
this.FId = !string.IsNullOrWhiteSpace(this.ControlId) ? this.ControlId : Guid.NewGuid().ToString();
|
||||
this.ParentId = Request.Params["ParentId"];
|
||||
this.FileImg = 0;
|
||||
//绑定数据
|
||||
PageIn();
|
||||
}
|
||||
|
@ -125,19 +145,23 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var model = new Control_PointCropping();
|
||||
model.ControlId = Guid.NewGuid().ToString();
|
||||
model.ControlId = this.FId;
|
||||
var oneControlId = string.Empty;
|
||||
var twoControlId = string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(this.ControlId))
|
||||
{
|
||||
model = Funs.DB.Control_PointCropping.FirstOrDefault(p => p.ControlId == this.ControlId);
|
||||
}
|
||||
else
|
||||
{
|
||||
model.States = 1;
|
||||
model.ProjectId = CurrUser.LoginProjectId;
|
||||
}
|
||||
if (model == null)
|
||||
{
|
||||
ShowNotify("传递参数错误!", MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
//model.ProjectId = CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrWhiteSpace(this.ParentId))
|
||||
{
|
||||
var parenLs = GetAllCropping(this.ParentId);
|
||||
|
@ -183,6 +207,14 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 附件
|
||||
/// </summary>
|
||||
protected void BtnFile_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/CheckControl&menuId={2}", FileImg, this.FId, Const.InspectTailTerm)));
|
||||
}
|
||||
|
||||
#region 私有方法
|
||||
|
||||
/// <summary>
|
||||
|
@ -211,6 +243,15 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 关闭
|
||||
/// </summary>
|
||||
protected void WindowAtt_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
@ -193,5 +193,32 @@ namespace FineUIPro.Web.CQMS.WBS.Control
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtSort;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// BtnFile 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnFile;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue