20241213 Key Quantity
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<f:FormRow ColumnWidths="25% 24% 27% 24%">
|
||||
<Items>
|
||||
<f:TextBox ID="txtJobNo" runat="server" Label="Job No." LabelWidth="120px" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtNotesLink" runat="server" Label="Notes Link" LabelWidth="120px" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtNotesLink" runat="server" Label="SharePoint Link" LabelWidth="120px" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtProjectManager" runat="server" Label="Project Manager" LabelWidth="160px" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtAccount" runat="server" Label="Account No." LabelWidth="130px" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
@@ -966,6 +966,60 @@
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
<f:GroupPanel ID="GroupPanelKeyQuantity" runat="server" Title="Key Quantity Editor" EnableCollapse="true">
|
||||
<Items>
|
||||
<f:Grid ID="GridKeyQuantity" ShowBorder="true" ShowHeader="false" Title="Key Quantity Editor" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="KeyQuantityId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="KeyQuantityId" AllowSorting="true" SortField="DepartName,DisciplinesWBSName"
|
||||
SortDirection="ASC" OnSort="GridKeyQuantity_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="GridKeyQuantity_PageIndexChange">
|
||||
<Columns>
|
||||
<f:RenderField Width="120px" ColumnID="ProjectControl_JobNo" DataField="ProjectControl_JobNo" SortField="ProjectControl_JobNo"
|
||||
FieldType="String" HeaderText="Job No" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
|
||||
FieldType="String" HeaderText="Type" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="DisciplinesWBSCode" DataField="DisciplinesWBSCode"
|
||||
SortField="DisciplinesWBSCode" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="DisciplinesWBSName" DataField="DisciplinesWBSName"
|
||||
FieldType="String" HeaderText="Descipline" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="QuantityDesctiption" DataField="QuantityDesctiption"
|
||||
FieldType="String" HeaderText="Quantity Desctiption" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="InputQuantity" DataField="InputQuantity"
|
||||
FieldType="String" HeaderText="Input Quantity" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanMHRsUnit" DataField="PlanMHRsUnit"
|
||||
FieldType="String" HeaderText="Plan MHRs/Unit" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="PlanMHRs" DataField="PlanMHRs"
|
||||
FieldType="String" HeaderText="Plan MHRs" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanMHRsSummary" DataField="PlanMHRsSummary"
|
||||
FieldType="String" HeaderText="Plan MHRs Summary" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ActualMHRs" DataField="ActualMHRs"
|
||||
FieldType="String" HeaderText="Actual MHRs" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator6" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText6" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlKeyQuantity" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlKeyQuantity_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:GroupPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
|
||||
@@ -406,6 +406,10 @@ namespace FineUIPro.Web.EditorManage
|
||||
#region FCR Log
|
||||
BindGridFCRLog();
|
||||
#endregion
|
||||
|
||||
#region Key Quantity
|
||||
BindGridKeyQuantity();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -698,6 +702,58 @@ namespace FineUIPro.Web.EditorManage
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Key Quantity
|
||||
private void BindGridKeyQuantity()
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@eprojectId", Request.Params["eProjectId"])
|
||||
};
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Proc_KeyQuantityLists", parameter);
|
||||
this.GridKeyQuantity.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(GridKeyQuantity, tb);
|
||||
GridKeyQuantity.DataSource = table;
|
||||
GridKeyQuantity.DataBind();
|
||||
}
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void GridKeyQuantity_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
GridKeyQuantity.PageIndex = e.NewPageIndex;
|
||||
BindGridKeyQuantity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlKeyQuantity_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
GridKeyQuantity.PageSize = Convert.ToInt32(ddlKeyQuantity.SelectedValue);
|
||||
BindGridKeyQuantity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void GridKeyQuantity_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
GridKeyQuantity.SortDirection = e.SortDirection;
|
||||
GridKeyQuantity.SortField = e.SortField;
|
||||
BindGridKeyQuantity();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
+276
-229
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,214 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KeyQuantityEditor.aspx.cs" Inherits="FineUIPro.Web.EditorManage.KeyQuantityEditor" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>Key Quantity Editor</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="Key Quantity Editor" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="EProjectId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="EProjectId" AllowSorting="true" SortField="ProjectControl_JobNo"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" EnableRowSelectEvent="true" OnRowSelect="Grid1_RowSelect"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true" AllowFilters="true" OnFilterChange="Grid1_FilterChange">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpJobType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpJobType_SelectedIndexChanged" NextFocusControl="btnSearch"></f:DropDownList>
|
||||
<f:DropDownList ID="drpJobStatus" runat="server" NextFocusControl="btnSearch"></f:DropDownList>
|
||||
<f:TextBox ID="txtJobNO" runat="server" EmptyText="Enter the Job No." AutoPostBack="true" NextFocusControl="btnSearch"></f:TextBox>
|
||||
<f:Button ID="btnSearch" runat="server" Icon="SystemSearch" Text="Search" OnClick="btnSearch_Click"></f:Button>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnEdit" ToolTip="Modify" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Text="Edit" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField Width="50px" TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label1" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="120px" ColumnID="ProjectControl_JobNo" DataField="ProjectControl_JobNo" EnableFilter="true"
|
||||
SortField="ProjectControl_JobNo" FieldType="String" HeaderText="Job No." HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList1" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ProjectControl_JobType" DataField="ProjectControl_JobType" SortField="ProjectControl_JobType"
|
||||
FieldType="String" HeaderText="Job Type" HeaderTextAlign="Center" EnableFilter="true">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList2" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="ProjectControl_JobTitle" DataField="ProjectControl_JobTitle" SortField="ProjectControl_JobTitle"
|
||||
FieldType="String" HeaderText="Job Title" HeaderTextAlign="Center" ExpandUnusedSpace="true" EnableFilter="true">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList3" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ProjectControl_JobStatus" DataField="ProjectControl_JobStatus" SortField="ProjectControl_JobStatus"
|
||||
FieldType="String" HeaderText="Job Status" HeaderTextAlign="Center" EnableFilter="true">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList4" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ProjectControl_BUCode" DataField="ProjectControl_BUCode"
|
||||
FieldType="String" HeaderText="Bu.Code" HeaderTextAlign="Center" EnableFilter="true">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList5" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="PM_General_Priority" DataField="PM_General_Priority"
|
||||
FieldType="String" HeaderText="Priority" HeaderTextAlign="Center" EnableFilter="true" >
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList6" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="PM_General_Category" DataField="PM_General_Category"
|
||||
FieldType="String" HeaderText="Category" HeaderTextAlign="Center" EnableFilter="true">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList7" runat="server">
|
||||
<f:ListItem Text="equal to" Value="equal" />
|
||||
<f:ListItem Text="include" Value="contain" Selected="true" />
|
||||
</f:DropDownList>
|
||||
</Operator>
|
||||
</Filter>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
<Items>
|
||||
<f:Grid ID="Grid2" ShowBorder="true" ShowHeader="false" Title="Key Quantity" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="KeyQuantityId" AllowCellEditing="true" EnableColumnLines="true" DataIDField="KeyQuantityId" AllowSorting="true" SortField="DepartName,DisciplinesWBSName"
|
||||
SortDirection="ASC" OnSort="Grid2_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid2_PageIndexChange" EnableTextSelection="true">
|
||||
<Columns>
|
||||
<f:RenderField Width="140px" ColumnID="ProjectControl_JobNo" DataField="ProjectControl_JobNo" SortField="ProjectControl_JobNo"
|
||||
FieldType="String" HeaderText="Job No" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
|
||||
FieldType="String" HeaderText="Type" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="DisciplinesWBSCode" DataField="DisciplinesWBSCode"
|
||||
SortField="DisciplinesWBSCode" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="DisciplinesWBSName" DataField="DisciplinesWBSName"
|
||||
FieldType="String" HeaderText="Descipline" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="QuantityDesctiption" DataField="QuantityDesctiption"
|
||||
FieldType="String" HeaderText="Quantity Desctiption" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="InputQuantity" DataField="InputQuantity"
|
||||
FieldType="String" HeaderText="Input Quantity" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanMHRsUnit" DataField="PlanMHRsUnit"
|
||||
FieldType="String" HeaderText="Plan MHRs/Unit" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="PlanMHRs" DataField="PlanMHRs"
|
||||
FieldType="String" HeaderText="Plan MHRs" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanMHRsSummary" DataField="PlanMHRsSummary"
|
||||
FieldType="String" HeaderText="Plan MHRs Summary" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="ActualMHRs" DataField="ActualMHRs"
|
||||
FieldType="String" HeaderText="Actual MHRs" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator2" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText2" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize2" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize2_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="Key Quantity Editor" Hidden="true" EnableIFrame="true" EnableMaximize="false"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="1200px" Height="650px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Icon="BulletEdit" runat="server" Text="Modify" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuView" OnClick="btnMenuView_Click" EnablePostBack="true"
|
||||
Icon="Find" runat="server" Text="View">
|
||||
</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');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,460 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.EditorManage
|
||||
{
|
||||
public partial class KeyQuantityEditor : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// 表头过滤
|
||||
FilterDataRowItem = FilterDataRowItemImplement;
|
||||
if (!IsPostBack)
|
||||
{
|
||||
GetButtonPower();//权限设置
|
||||
|
||||
//项目类型
|
||||
this.drpJobType.DataTextField = "ConstText";
|
||||
this.drpJobType.DataValueField = "ConstValue";
|
||||
this.drpJobType.DataSource = BLL.ConstService.GetConstListByGroupId(BLL.Const.ProjectPlanner_JobType);
|
||||
this.drpJobType.DataBind();
|
||||
Funs.FineUIPleaseSelectJobType(this.drpJobType);
|
||||
|
||||
//项目状态
|
||||
this.drpJobStatus.DataTextField = "ConstText";
|
||||
this.drpJobStatus.DataValueField = "ConstValue";
|
||||
this.drpJobStatus.DataSource = BLL.ConstService.GetConstListByGroupId(BLL.Const.ProjectPlanner_JobStatus);
|
||||
this.drpJobStatus.DataBind();
|
||||
Funs.FineUIPleaseSelectJobStatus(this.drpJobStatus);
|
||||
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = "SELECT EProjectId," +
|
||||
"ProjectControl_JobNo," +
|
||||
"ProjectControl_JobType," +
|
||||
"ProjectControl_JobStatus," +
|
||||
"ProjectControl_JobTitle," +
|
||||
"ProjectControl_BUCode," +
|
||||
"PM_General_Priority," +
|
||||
"PM_General_Category " +
|
||||
"FROM dbo.Editor_EProject WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (this.drpJobType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND ProjectControl_JobType=@JobType ";
|
||||
listStr.Add(new SqlParameter("@JobType", this.drpJobType.SelectedItem.Text));
|
||||
}
|
||||
if (this.drpJobStatus.SelectedValue != BLL.Const._Null && this.drpJobStatus.SelectedValue != null)
|
||||
{
|
||||
strSql += " AND ProjectControl_JobStatus=@Status ";
|
||||
listStr.Add(new SqlParameter("@Status", this.drpJobStatus.SelectedItem.Text));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtJobNO.Text.Trim()))
|
||||
{
|
||||
strSql += " AND ProjectControl_JobNo LIKE @jobNO ";
|
||||
listStr.Add(new SqlParameter("@jobNO", this.txtJobNO.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
// 2.获取当前分页数据
|
||||
//var table = this.GetPagedDataTable(Grid1, tb1);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 过滤表头
|
||||
/// <summary>
|
||||
/// 过滤表头
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_FilterChange(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据表头信息过滤列表数据
|
||||
/// </summary>
|
||||
/// <param name="sourceObj"></param>
|
||||
/// <param name="fillteredOperator"></param>
|
||||
/// <param name="fillteredObj"></param>
|
||||
/// <param name="column"></param>
|
||||
/// <returns></returns>
|
||||
private bool FilterDataRowItemImplement(object sourceObj, string fillteredOperator, object fillteredObj, string column)
|
||||
{
|
||||
bool valid = false;
|
||||
if (column == "ProjectControl_JobNo")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (column == "ProjectControl_JobType")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (column == "ProjectControl_JobTitle")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (column == "ProjectControl_JobStatus")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (column == "ProjectControl_BUCode")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (column == "PM_General_Priority")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
if (column == "PM_General_Category")
|
||||
{
|
||||
string sourceValue = sourceObj.ToString();
|
||||
string fillteredValue = fillteredObj.ToString();
|
||||
if (fillteredOperator == "equal" && sourceValue == fillteredValue)
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
else if (fillteredOperator == "contain" && sourceValue.Contains(fillteredValue))
|
||||
{
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
var eproject = BLL.EProjectService.GeteProjectById(Id);
|
||||
if (eproject != null)
|
||||
{
|
||||
Window1.Title = "Key Quantity Editor(Job No. " + eproject.ProjectControl_JobNo + ")";
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("KeyQuantityEditorList.aspx?eProjectId={0}", Id, "编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnEdit_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnEdit_Click(null, null);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 判断是否可删除
|
||||
/// <summary>
|
||||
/// 判断是否可以删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool judgementDelete(string id, bool isShow)
|
||||
{
|
||||
string content = string.Empty;
|
||||
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
protected void drpJobType_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.drpJobStatus.Items.Clear();
|
||||
if (drpJobType.SelectedText == "Other")
|
||||
{
|
||||
BLL.ConstService.InitConstValueProjectStatus(this.drpJobStatus, BLL.Const.ProjectPlanner_JobStatus, "3", true);
|
||||
}
|
||||
if (drpJobType.SelectedText != "Other")
|
||||
{
|
||||
BLL.ConstService.InitConstValueProjectStatus(this.drpJobStatus, BLL.Const.ProjectPlanner_JobStatus, "2", true);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 下拉框选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSearch_Click(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 菜单按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.KeyQuantityMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Grid1.EnableRowDoubleClickEvent = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 点击Grid1加载Grid2
|
||||
/// <summary>
|
||||
/// Grid1行选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowSelect(object sender, GridRowSelectEventArgs e)
|
||||
{
|
||||
string eProjectId = this.Grid1.SelectedRowID;
|
||||
BindGrid2(eProjectId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid2(string eProjectId)
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@eprojectId", eProjectId)
|
||||
};
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Proc_KeyQuantityLists", parameter);
|
||||
this.Grid2.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid2, tb);
|
||||
Grid2.DataSource = table;
|
||||
Grid2.DataBind();
|
||||
}
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid2_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid2.PageIndex = e.NewPageIndex;
|
||||
BindGrid2(this.Grid1.SelectedRowID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize2_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid2.PageSize = Convert.ToInt32(ddlPageSize2.SelectedValue);
|
||||
BindGrid2(this.Grid1.SelectedRowID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid2_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid2.SortDirection = e.SortDirection;
|
||||
Grid2.SortField = e.SortField;
|
||||
BindGrid2(this.Grid1.SelectedRowID);
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 查看
|
||||
/// <summary>
|
||||
/// 查看
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
var eproject = BLL.EProjectService.GeteProjectById(Id);
|
||||
if (eproject != null)
|
||||
{
|
||||
Window1.Title = "Key Quantity Editor(Job No. " + eproject.ProjectControl_JobNo + ")";
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("KeyQuantityEditorList.aspx?eProjectId={0}&view=1", Id, "编辑 - ")));
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EditorManage
|
||||
{
|
||||
|
||||
|
||||
public partial class KeyQuantityEditor
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpJobType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpJobType;
|
||||
|
||||
/// <summary>
|
||||
/// drpJobStatus 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpJobStatus;
|
||||
|
||||
/// <summary>
|
||||
/// txtJobNO 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtJobNO;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList1;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList2;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList3;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList4;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList5;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList6 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList6;
|
||||
|
||||
/// <summary>
|
||||
/// DropDownList7 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList DropDownList7;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Grid2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid2;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator2;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText2;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize2;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuView 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KeyQuantityEditorEdit.aspx.cs" Inherits="FineUIPro.Web.EditorManage.KeyQuantityEditorEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Key Quantity Editor Edit</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" BodyPadding="10px" Margin="0 5px 0 0" AutoScroll="true" runat="server" EnableCollapse="true" Title="FCR Log" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Form ID="Form2" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownBox runat="server" ID="drpKeyId" LabelWidth="120px" EmptyText="请从下拉表格中选择" Label="Type" MatchFieldWidth="false" AutoPostBack="true" OnTextChanged="drpKeyId_TextChanged">
|
||||
<PopPanel>
|
||||
<f:Grid ID="Grid1" Width="650px" Height="300px" Hidden="true"
|
||||
DataIDField="KeyId" DataTextField="DepartName"
|
||||
PageSize="10" ShowBorder="true" ShowHeader="false"
|
||||
AllowPaging="true" IsDatabasePaging="true" runat="server"
|
||||
DataKeyNames="KeyId"
|
||||
AllowSorting="true" SortField="DepartName,DisciplinesWBSName" SortDirection="ASC"
|
||||
OnSort="Grid1_Sort">
|
||||
<Columns>
|
||||
<f:RowNumberField />
|
||||
<f:BoundField Width="90px" DataField="DepartName" SortField="DepartName" HeaderText="Type" />
|
||||
<f:BoundField Width="80px" SortField="DisciplinesWBSCode" DataField="DisciplinesWBSCode" HeaderText="Identifier" />
|
||||
<f:BoundField Width="100px" SortField="DisciplinesWBSName" DataField="DisciplinesWBSName" HeaderText="Descipline" />
|
||||
<f:BoundField Width="100px" SortField="QuantityDesctiption" DataField="QuantityDesctiption" HeaderText="Quantity Desctiption" ExpandUnusedSpace="true" />
|
||||
<f:BoundField Width="100px" SortField="PlanMHRsUnit" DataField="PlanMHRsUnit" HeaderText="Plan MHRs/Unit" />
|
||||
</Columns>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="5" Value="5" />
|
||||
<f:ListItem Text="10" Value="10" />
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
<Toolbars>
|
||||
<f:Toolbar runat="server" Position="Top">
|
||||
<Items>
|
||||
<f:TextBox ID="txtSearch" runat="server" ShowLabel="false" EmptyText="Type" Width="300px" AutoPostBack="true" OnTextChanged="txtSearch_TextChanged"></f:TextBox>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Grid>
|
||||
</PopPanel>
|
||||
</f:DropDownBox>
|
||||
<f:TextBox ID="txtIdentifier" runat="server" Label="Identifier" LabelWidth="200px" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtDescipline" runat="server" Label="Descipline" LabelWidth="120px" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtQuantityDesctiption" runat="server" Label="Quantity Desctiption" LabelWidth="200px" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtInputQuantity" runat="server" Label="Input Quantity" LabelWidth="120px" NoNegative="true" AutoPostBack="true" OnTextChanged="txtInputQuantity_TextChanged"></f:NumberBox>
|
||||
<f:NumberBox ID="txtPlanMHRsUnit" runat="server" Label="Plan MHRs/Unit" LabelWidth="200px" Readonly="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtPlanMHRs" runat="server" Label="Plan MHRs" LabelWidth="120px" Readonly="true"></f:NumberBox>
|
||||
<f:NumberBox ID="txtPlanMHRsSummary" runat="server" Label="Plan MHRs Summary" LabelWidth="200px" Readonly="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtActualMHRs" runat="server" Label="Actual MHRs" LabelWidth="120px" Readonly="true"></f:NumberBox>
|
||||
<f:Label ID="Label1" runat="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</Items>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="Save" ToolTip="Save" ValidateForms="Panel1"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="Close" Text="Close" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
using BLL;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.EditorManage
|
||||
{
|
||||
public partial class KeyQuantityEditorEdit : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string KeyQuantityId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["KeyQuantityId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["KeyQuantityId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目Id
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
BindGrid();
|
||||
string view = Request.Params["view"];
|
||||
if (view == "1")
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetButtonPower();
|
||||
}
|
||||
this.ProjectId = Request.Params["eProjectId"];
|
||||
this.KeyQuantityId = Request.Params["keyQuantityId"];
|
||||
if (!string.IsNullOrEmpty(this.KeyQuantityId))
|
||||
{
|
||||
Model.Editor_KeyQuantity keyQuantity = BLL.KeyQuantityService.GetKeyQuantityById(this.KeyQuantityId);
|
||||
if (keyQuantity != null)
|
||||
{
|
||||
this.ProjectId = keyQuantity.EProjectId;
|
||||
this.drpKeyId.Value = keyQuantity.KeyId;
|
||||
var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value);
|
||||
if (key != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(key.DisciplinesWBSId))
|
||||
{
|
||||
var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId);
|
||||
if (wbs != null)
|
||||
{
|
||||
this.txtIdentifier.Text = wbs.DisciplinesWBSCode;
|
||||
this.txtDescipline.Text = wbs.DisciplinesWBSName;
|
||||
}
|
||||
|
||||
this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value).ToString();
|
||||
double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
|
||||
where x.EProjectId == this.ProjectId
|
||||
&& x.Discipline == wbs.DisciplinesWBSName
|
||||
select x.Hours).Sum();
|
||||
this.txtActualMHRs.Text = actualHoursSum.ToString();
|
||||
}
|
||||
txtQuantityDesctiption.Text = key.QuantityDesctiption;
|
||||
txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
|
||||
}
|
||||
this.txtInputQuantity.Text = keyQuantity.InputQuantity.HasValue ? keyQuantity.InputQuantity.ToString() : "";
|
||||
this.txtPlanMHRs.Text = keyQuantity.PlanMHRs.HasValue ? keyQuantity.PlanMHRs.ToString() : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 绑定数据
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT qd.KeyId,
|
||||
qd.DepartId,
|
||||
qd.DisciplinesWBSId,
|
||||
qd.QuantityDesctiption,
|
||||
qd.PlanMHRsUnit,
|
||||
d.DepartName,
|
||||
wbs.DisciplinesWBSCode,
|
||||
wbs.DisciplinesWBSName
|
||||
FROM Base_QuantityDesctiption qd
|
||||
left join Base_Depart as d on qd.DepartId = d.DepartId
|
||||
left join Base_DisciplinesWBS as wbs on wbs.DisciplinesWBSId = qd.DisciplinesWBSId WHERE 1=1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.txtSearch.Text.Trim()))
|
||||
{
|
||||
strSql += " AND d.DepartName like @DepartName ";
|
||||
listStr.Add(new SqlParameter("@DepartName", "%" + this.txtSearch.Text.Trim() + "%"));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
// 2.获取当前分页数据
|
||||
//var table = this.GetPagedDataTable(Grid1, tb1);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 筛选
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtSearch_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpKeyId.Value == BLL.Const._Null || string.IsNullOrEmpty(this.drpKeyId.Value))
|
||||
{
|
||||
ShowAlert("Please select Type!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
Model.Editor_KeyQuantity newKeyQuantity = new Model.Editor_KeyQuantity();
|
||||
newKeyQuantity.KeyId = this.drpKeyId.Value;
|
||||
newKeyQuantity.InputQuantity = Funs.GetNewDecimal(this.txtInputQuantity.Text);
|
||||
newKeyQuantity.PlanMHRs = Funs.GetNewDecimal(this.txtPlanMHRs.Text);
|
||||
|
||||
if (!string.IsNullOrEmpty(this.KeyQuantityId))
|
||||
{
|
||||
newKeyQuantity.KeyQuantityId = this.KeyQuantityId;
|
||||
BLL.KeyQuantityService.UpdateKeyQuantity(newKeyQuantity);
|
||||
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Modify Key Quantity Editor information!");
|
||||
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
newKeyQuantity.EProjectId = ProjectId;
|
||||
this.KeyQuantityId = SQLHelper.GetNewID(typeof(Model.Editor_KeyQuantity));
|
||||
newKeyQuantity.KeyQuantityId = this.KeyQuantityId;
|
||||
BLL.KeyQuantityService.AddKeyQuantity(newKeyQuantity);
|
||||
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Add Key Quantity Editor information!");
|
||||
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region DropDownList下拉选择事件
|
||||
/// <summary>
|
||||
/// 部门下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpKeyId_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.txtIdentifier.Text = string.Empty;
|
||||
this.txtDescipline.Text = string.Empty;
|
||||
this.txtQuantityDesctiption.Text = string.Empty;
|
||||
this.txtPlanMHRsUnit.Text = string.Empty;
|
||||
this.txtPlanMHRsSummary.Text = string.Empty;
|
||||
if (!string.IsNullOrEmpty(this.drpKeyId.Value))
|
||||
{
|
||||
var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value);
|
||||
if (key != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(key.DisciplinesWBSId))
|
||||
{
|
||||
var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId);
|
||||
if (wbs != null)
|
||||
{
|
||||
this.txtIdentifier.Text = wbs.DisciplinesWBSCode;
|
||||
this.txtDescipline.Text = wbs.DisciplinesWBSName;
|
||||
}
|
||||
|
||||
decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value);
|
||||
this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
|
||||
|
||||
double? actualHoursSum = (from x in Funs.DB.ManHours_Actual
|
||||
where x.EProjectId == this.ProjectId
|
||||
&& x.Discipline == wbs.DisciplinesWBSName
|
||||
select x.Hours).Sum();
|
||||
this.txtActualMHRs.Text = actualHoursSum.ToString();
|
||||
}
|
||||
txtQuantityDesctiption.Text = key.QuantityDesctiption;
|
||||
txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Input Quantity输入事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtInputQuantity_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.txtPlanMHRs.Text = string.Empty;
|
||||
this.txtPlanMHRsSummary.Text = string.Empty;
|
||||
if (!string.IsNullOrEmpty(this.txtInputQuantity.Text.Trim()))
|
||||
{
|
||||
this.txtPlanMHRs.Text = (Funs.GetNewDecimal(this.txtInputQuantity.Text) * Funs.GetNewDecimal(this.txtPlanMHRsUnit.Text)).ToString();
|
||||
|
||||
decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value);
|
||||
if (s > 0)
|
||||
{
|
||||
this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtPlanMHRsSummary.Text = this.txtPlanMHRs.Text;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 菜单按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.KeyQuantityMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EditorManage
|
||||
{
|
||||
|
||||
|
||||
public partial class KeyQuantityEditorEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Form2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form2;
|
||||
|
||||
/// <summary>
|
||||
/// drpKeyId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownBox drpKeyId;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// txtSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSearch;
|
||||
|
||||
/// <summary>
|
||||
/// txtIdentifier 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdentifier;
|
||||
|
||||
/// <summary>
|
||||
/// txtDescipline 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtDescipline;
|
||||
|
||||
/// <summary>
|
||||
/// txtQuantityDesctiption 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtQuantityDesctiption;
|
||||
|
||||
/// <summary>
|
||||
/// txtInputQuantity 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtInputQuantity;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlanMHRsUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtPlanMHRsUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlanMHRs 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtPlanMHRs;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlanMHRsSummary 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtPlanMHRsSummary;
|
||||
|
||||
/// <summary>
|
||||
/// txtActualMHRs 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtActualMHRs;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="KeyQuantityEditorList.aspx.cs" Inherits="FineUIPro.Web.EditorManage.KeyQuantityEditorList" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Key Quantity Editor List</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="Key Quantity" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="KeyQuantityId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="KeyQuantityId" AllowSorting="true" SortField="DepartName,DisciplinesWBSName"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" ToolTip="Add" Text="Add" Icon="Add" EnablePostBack="false" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" ToolTip="Modify" Text="Modify" Icon="Pencil" runat="server" OnClick="btnEdit_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" ToolTip="Delete" Text="Delete" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="120px" ColumnID="ProjectControl_JobNo" DataField="ProjectControl_JobNo" SortField="ProjectControl_JobNo"
|
||||
FieldType="String" HeaderText="Job No" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
|
||||
FieldType="String" HeaderText="Type" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="DisciplinesWBSCode" DataField="DisciplinesWBSCode"
|
||||
SortField="DisciplinesWBSCode" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="180px" ColumnID="DisciplinesWBSName" DataField="DisciplinesWBSName"
|
||||
FieldType="String" HeaderText="Descipline" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="QuantityDesctiption" DataField="QuantityDesctiption"
|
||||
FieldType="String" HeaderText="Quantity Desctiption" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="InputQuantity" DataField="InputQuantity"
|
||||
FieldType="String" HeaderText="Input Quantity" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanMHRsUnit" DataField="PlanMHRsUnit"
|
||||
FieldType="String" HeaderText="Plan MHRs/Unit" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="PlanMHRs" DataField="PlanMHRs"
|
||||
FieldType="String" HeaderText="Plan MHRs" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanMHRsSummary" DataField="PlanMHRsSummary"
|
||||
FieldType="String" HeaderText="Plan MHRs Summary" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ActualMHRs" DataField="ActualMHRs"
|
||||
FieldType="String" HeaderText="Actual MHRs" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="Number of records per page:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
<f:ListItem Text="15" Value="15" />
|
||||
<f:ListItem Text="20" Value="20" />
|
||||
<f:ListItem Text="25" Value="25" />
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="Key Quantity Editor" Hidden="true" EnableIFrame="true" EnableMaximize="false"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
|
||||
Width="1000px" Height="400px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Icon="BulletEdit" runat="server" Text="Modify" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="Delete selected row?" ConfirmTarget="Top" runat="server" Text="Delete" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuView" OnClick="btnMenuView_Click" EnablePostBack="true"
|
||||
Icon="Find" runat="server" Text="View">
|
||||
</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');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,277 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.EditorManage
|
||||
{
|
||||
public partial class KeyQuantityEditorList : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
string view = Request.Params["view"];
|
||||
if (view == "1")
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
this.btnEdit.Hidden = true;
|
||||
this.btnMenuEdit.Hidden = true;
|
||||
this.btnDelete.Hidden = true;
|
||||
this.btnMenuDelete.Hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GetButtonPower();//权限设置
|
||||
}
|
||||
|
||||
|
||||
btnNew.OnClientClick = Window1.GetShowReference("KeyQuantityEditorEdit.aspx?eProjectId=" + Request.Params["eProjectId"]) + "return false;";
|
||||
btnDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("Please select at least one item!");
|
||||
btnDelete.ConfirmText = String.Format("Are you sure you want to delete the selected <b><script>{0}</script></b> rows?", Grid1.GetSelectedCountReference());
|
||||
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@eprojectId", Request.Params["eProjectId"])
|
||||
};
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunProc("Proc_KeyQuantityLists", parameter);
|
||||
this.Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据
|
||||
/// <summary>
|
||||
/// 批量删除数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var role = BLL.KeyQuantityService.GetKeyQuantityById(rowID);
|
||||
if (role != null)
|
||||
{
|
||||
if (judgementDelete(rowID, false))
|
||||
{
|
||||
BLL.KeyQuantityService.DeleteKeyQuantityById(rowID);
|
||||
BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Delete Key Quantity Editor information");
|
||||
ShowNotify("Deleted successfully!");
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("KeyQuantityEditorEdit.aspx?keyQuantityId={0}", Id, "编辑 - ")));
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
btnEdit_Click(null, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnEdit_Click(null, null);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 判断是否可删除
|
||||
/// <summary>
|
||||
/// 判断是否可以删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool judgementDelete(string id, bool isShow)
|
||||
{
|
||||
string content = string.Empty;
|
||||
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 权限设置
|
||||
/// <summary>
|
||||
/// 菜单按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.UserId, BLL.Const.KeyQuantityMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Grid1.EnableRowDoubleClickEvent = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看
|
||||
/// <summary>
|
||||
/// 查看
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("KeyQuantityEditorEdit.aspx?keyQuantityId={0}&view=1", Id, "编辑 - ")));
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EditorManage
|
||||
{
|
||||
|
||||
|
||||
public partial class KeyQuantityEditorList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuView 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuView;
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
<f:FormRow ColumnWidths="25% 24% 27% 24%">
|
||||
<Items>
|
||||
<f:TextBox ID="txtJobNo" runat="server" Label="Job No." LabelWidth="110px" ShowRedStar="true" Required="true"></f:TextBox>
|
||||
<f:TextBox ID="txtNotesLink" runat="server" Label="Notes Link" LabelWidth="120px"></f:TextBox>
|
||||
<f:TextBox ID="txtNotesLink" runat="server" Label="SharePoint Link" LabelWidth="120px"></f:TextBox>
|
||||
<f:DropDownList ID="drpProjectManager" runat="server" Label="Project Manager" LabelWidth="160px" EnableGroup="true" EnableEdit="true"></f:DropDownList>
|
||||
<f:TextBox ID="txtAccount" runat="server" Label="Account No." LabelWidth="130px"></f:TextBox>
|
||||
</Items>
|
||||
|
||||
Reference in New Issue
Block a user