修改进度报表

This commit is contained in:
2023-06-06 09:54:46 +08:00
parent 6b1271387c
commit 3cf225ea86
31 changed files with 1582 additions and 123 deletions
@@ -169,7 +169,7 @@
<f:RenderField Width="60px" ColumnID="Id" DataField="Id" FieldType="String"
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center" EnableColumnEdit="true">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="Name" DataField="Name" FieldType="String"
<f:RenderField Width="270px" ColumnID="Name" DataField="Name" FieldType="String"
HeaderText="专业和分部工程" HeaderTextAlign="Center" TextAlign="Left" EnableColumnEdit="true">
</f:RenderField>
<f:GroupField HeaderText="本月赢得值参数(单位:万元)" TextAlign="Center">
@@ -197,152 +197,219 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
table4.Columns.Add(new DataColumn("CPI", typeof(String)));
table4.Columns.Add(new DataColumn("SPI", typeof(String)));
Model.SGGLDB db = Funs.DB;
var cnProfessionInits = from x in db.WBS_CnProfessionInit select x;
var cnProfessions = from x in db.WBS_CnProfession where x.ProjectId == this.CurrUser.LoginProjectId select x;
var unitProjectInits = from x in db.Wbs_UnitProjectInit select x;
var unitProjects = from x in db.Wbs_UnitProject where x.ProjectId == this.CurrUser.LoginProjectId select x;
var cnProfessions = from x in db.WBS_CnProfession where x.ProjectId == this.CurrUser.LoginProjectId && x.IsApprove == true select x;
var installationIds = cnProfessions.Select(x => x.InstallationId).Distinct().ToList();
var installations = from x in db.Project_Installation where x.ProjectId == this.CurrUser.LoginProjectId && installationIds.Contains(x.InstallationId) select x;
var unitProjects = from x in db.Wbs_UnitProject where x.ProjectId == this.CurrUser.LoginProjectId && x.IsApprove == true select x;
var details = from x in db.View_WBS_CostControlParentDetail
where x.Months == Funs.GetNewDateTime(date)
select x;
DataRow row4;
decimal cnACWP, cnBCWP, cnBCWS, cnmACWP, cnmBCWP, cnmBCWS, cnCV, cnSV, cnCPI, cnSPI, cnmCV, cnmSV, cnmCPI, cnmSPI,
unACWP, unBCWP, unBCWS, unmACWP, unmBCWP, unmBCWS, unCV, unSV, unCPI, unSPI, unmCV, unmSV, unmCPI, unmSPI;
int a = 1, b = 1;
foreach (var cn in cnProfessionInits)
unACWP, unBCWP, unBCWS, unmACWP, unmBCWP, unmBCWS, unCV, unSV, unCPI, unSPI, unmCV, unmSV, unmCPI, unmSPI,
inACWP, inBCWP, inBCWS, inmACWP, inmBCWP, inmBCWS, inCV, inSV, inCPI, inSPI, inmCV, inmSV, inmCPI, inmSPI;
int a = 1, b = 1, c = 1;
foreach (var item in installations)
{
cnACWP = 0;
cnBCWP = 0;
cnBCWS = 0;
cnmACWP = 0;
cnmBCWP = 0;
cnmBCWS = 0;
cnCV = 0;
cnSV = 0;
cnCPI = 0;
cnSPI = 0;
cnmCV = 0;
cnmSV = 0;
cnmCPI = 0;
cnmSPI = 0;
inACWP = 0;
inBCWP = 0;
inBCWS = 0;
inmACWP = 0;
inmBCWP = 0;
inmBCWS = 0;
inCV = 0;
inSV = 0;
inCPI = 0;
inSPI = 0;
inmCV = 0;
inmSV = 0;
inmCPI = 0;
inmSPI = 0;
row4 = table4.NewRow();
row4[0] = a;
row4[0] = c.ToString();
row4[1] = "0";
row4[2] = cn.CnProfessionName;
var cnDetails = (from x in details
join y in cnProfessions on x.ParentId equals y.CnProfessionId
where y.OldId == cn.CnProfessionId
row4[2] = item.InstallationName;
var inDetails = (from x in details
where x.ParentId == item.InstallationId
select x).ToList();
cnmACWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000;
cnmBCWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000;
cnmBCWS = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000;
cnmCV = cnmBCWP - cnmACWP;
cnmSV = cnmBCWP - cnmBCWS;
if (cnmACWP > 0)
inmACWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000;
inmBCWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000;
inmBCWS = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000;
inmCV = inmBCWP - inmACWP;
inmSV = inmBCWP - inmBCWS;
if (inmACWP > 0)
{
cnmCPI = cnmBCWP / cnmACWP;
inmCPI = inmBCWP / inmACWP;
}
if (cnmBCWS > 0)
if (inmBCWS > 0)
{
cnmSPI = cnmBCWP / cnmBCWS;
inmSPI = inmBCWP / inmBCWS;
}
row4[3] = cnmBCWP.ToString("0.####");
row4[4] = cnmBCWS.ToString("0.####");
row4[5] = cnmACWP.ToString("0.####");
row4[6] = cnmCV.ToString("0.####");
row4[7] = cnmSV.ToString("0.####");
row4[8] = cnmCPI.ToString("0.####");
row4[9] = cnmSPI.ToString("0.####");
cnACWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000;
cnBCWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000;
cnBCWS = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000;
cnCV = cnBCWP - cnACWP;
cnSV = cnBCWP - cnBCWS;
if (cnACWP > 0)
row4[3] = inmBCWP.ToString("0.####");
row4[4] = inmBCWS.ToString("0.####");
row4[5] = inmACWP.ToString("0.####");
row4[6] = inmCV.ToString("0.####");
row4[7] = inmSV.ToString("0.####");
row4[8] = inmCPI.ToString("0.####");
row4[9] = inmSPI.ToString("0.####");
inACWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000;
inBCWP = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000;
inBCWS = Funs.GetNewDecimalOrZero(inDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000;
inCV = inBCWP - inACWP;
inSV = inBCWP - inBCWS;
if (inACWP > 0)
{
cnCPI = cnBCWP / cnACWP;
inCPI = inBCWP / inACWP;
}
if (cnBCWS > 0)
if (inBCWS > 0)
{
cnSPI = cnBCWP / cnBCWS;
inSPI = inBCWP / inBCWS;
}
row4[10] = cnBCWP.ToString("0.####");
row4[11] = cnBCWS.ToString("0.####");
row4[12] = cnACWP.ToString("0.####");
row4[13] = cnCV.ToString("0.####");
row4[14] = cnSV.ToString("0.####");
row4[15] = cnCPI.ToString("0.####");
row4[16] = cnSPI.ToString("0.####");
row4[10] = inBCWP.ToString("0.####");
row4[11] = inBCWS.ToString("0.####");
row4[12] = inACWP.ToString("0.####");
row4[13] = inCV.ToString("0.####");
row4[14] = inSV.ToString("0.####");
row4[15] = inCPI.ToString("0.####");
row4[16] = inSPI.ToString("0.####");
table4.Rows.Add(row4);
b = 1;
var unLists = (from x in unitProjectInits where x.CnProfessionId == cn.CnProfessionId orderby x.SortIndex select x).ToList();
foreach (var un in unLists)
a = 1;
var icnProfessions = cnProfessions.Where(x => x.InstallationId == item.InstallationId);
foreach (var cn in icnProfessions)
{
unACWP = 0;
unBCWP = 0;
unBCWS = 0;
unmACWP = 0;
unmBCWP = 0;
unmBCWS = 0;
unCV = 0;
unSV = 0;
unCPI = 0;
unSPI = 0;
unmCV = 0;
unmSV = 0;
unmCPI = 0;
unmSPI = 0;
cnACWP = 0;
cnBCWP = 0;
cnBCWS = 0;
cnmACWP = 0;
cnmBCWP = 0;
cnmBCWS = 0;
cnCV = 0;
cnSV = 0;
cnCPI = 0;
cnSPI = 0;
cnmCV = 0;
cnmSV = 0;
cnmCPI = 0;
cnmSPI = 0;
row4 = table4.NewRow();
row4[0] = a.ToString() + "." + b.ToString();
row4[1] = a;
row4[2] = un.UnitProjectName;
var unDetails = from x in details
join y in unitProjects on x.ParentId equals y.UnitProjectId
where y.UnitProjectCode == un.UnitProjectCode
select x;
unmACWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000;
unmBCWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000;
unmBCWS = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000;
unmCV = unmBCWP - unmACWP;
unmSV = unmBCWP - unmBCWS;
if (unmACWP > 0)
row4[0] = c.ToString() + "." + a.ToString();
row4[1] = c;
row4[2] = cn.CnProfessionName;
var cnDetails = (from x in details
where x.ParentId == cn.CnProfessionId
select x).ToList();
cnmACWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000;
cnmBCWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000;
cnmBCWS = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000;
cnmCV = cnmBCWP - cnmACWP;
cnmSV = cnmBCWP - cnmBCWS;
if (cnmACWP > 0)
{
unmCPI = unmBCWP / unmACWP;
cnmCPI = cnmBCWP / cnmACWP;
}
if (unmBCWS > 0)
if (cnmBCWS > 0)
{
unmSPI = unmBCWP / unmBCWS;
cnmSPI = cnmBCWP / cnmBCWS;
}
row4[3] = unmBCWP.ToString("0.####");
row4[4] = unmBCWS.ToString("0.####");
row4[5] = unmACWP.ToString("0.####");
row4[6] = unmCV.ToString("0.####");
row4[7] = unmSV.ToString("0.####");
row4[8] = unmCPI.ToString("0.####");
row4[9] = unmSPI.ToString("0.####");
unACWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000;
unBCWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000;
unBCWS = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000;
unCV = unBCWP - unACWP;
unSV = unBCWP - unBCWS;
if (unACWP > 0)
row4[3] = cnmBCWP.ToString("0.####");
row4[4] = cnmBCWS.ToString("0.####");
row4[5] = cnmACWP.ToString("0.####");
row4[6] = cnmCV.ToString("0.####");
row4[7] = cnmSV.ToString("0.####");
row4[8] = cnmCPI.ToString("0.####");
row4[9] = cnmSPI.ToString("0.####");
cnACWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000;
cnBCWP = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000;
cnBCWS = Funs.GetNewDecimalOrZero(cnDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000;
cnCV = cnBCWP - cnACWP;
cnSV = cnBCWP - cnBCWS;
if (cnACWP > 0)
{
unCPI = unBCWP / unACWP;
cnCPI = cnBCWP / cnACWP;
}
if (unBCWS > 0)
if (cnBCWS > 0)
{
unSPI = unBCWP / unBCWS;
cnSPI = cnBCWP / cnBCWS;
}
row4[10] = unBCWP.ToString("0.####");
row4[11] = unBCWS.ToString("0.####");
row4[12] = unACWP.ToString("0.####");
row4[13] = unCV.ToString("0.####");
row4[14] = unSV.ToString("0.####");
row4[15] = unCPI.ToString("0.####");
row4[16] = unSPI.ToString("0.####");
row4[10] = cnBCWP.ToString("0.####");
row4[11] = cnBCWS.ToString("0.####");
row4[12] = cnACWP.ToString("0.####");
row4[13] = cnCV.ToString("0.####");
row4[14] = cnSV.ToString("0.####");
row4[15] = cnCPI.ToString("0.####");
row4[16] = cnSPI.ToString("0.####");
table4.Rows.Add(row4);
b++;
b = 1;
var unLists = from x in unitProjects where x.CnProfessionId == cn.CnProfessionId orderby x.SortIndex select x;
foreach (var un in unLists)
{
unACWP = 0;
unBCWP = 0;
unBCWS = 0;
unmACWP = 0;
unmBCWP = 0;
unmBCWS = 0;
unCV = 0;
unSV = 0;
unCPI = 0;
unSPI = 0;
unmCV = 0;
unmSV = 0;
unmCPI = 0;
unmSPI = 0;
row4 = table4.NewRow();
row4[0] = c.ToString() + "." + a.ToString() + "." + b.ToString();
row4[1] = c.ToString() + "." + a.ToString();
row4[2] = un.UnitProjectName;
var unDetails = from x in details
where x.ParentId == un.UnitProjectId
select x;
unmACWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisRealCost).Sum().ToString()) / 10000;
unmBCWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisPlanCost).Sum().ToString()) / 10000;
unmBCWS = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.ThisPlanValue).Sum().ToString()) / 10000;
unmCV = unmBCWP - unmACWP;
unmSV = unmBCWP - unmBCWS;
if (unmACWP > 0)
{
unmCPI = unmBCWP / unmACWP;
}
if (unmBCWS > 0)
{
unmSPI = unmBCWP / unmBCWS;
}
row4[3] = unmBCWP.ToString("0.####");
row4[4] = unmBCWS.ToString("0.####");
row4[5] = unmACWP.ToString("0.####");
row4[6] = unmCV.ToString("0.####");
row4[7] = unmSV.ToString("0.####");
row4[8] = unmCPI.ToString("0.####");
row4[9] = unmSPI.ToString("0.####");
unACWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalRealCost).Sum().ToString()) / 10000;
unBCWP = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalPlanCost).Sum().ToString()) / 10000;
unBCWS = Funs.GetNewDecimalOrZero(unDetails.Select(x => x.TotalPlanValue).Sum().ToString()) / 10000;
unCV = unBCWP - unACWP;
unSV = unBCWP - unBCWS;
if (unACWP > 0)
{
unCPI = unBCWP / unACWP;
}
if (unBCWS > 0)
{
unSPI = unBCWP / unBCWS;
}
row4[10] = unBCWP.ToString("0.####");
row4[11] = unBCWS.ToString("0.####");
row4[12] = unACWP.ToString("0.####");
row4[13] = unCV.ToString("0.####");
row4[14] = unSV.ToString("0.####");
row4[15] = unCPI.ToString("0.####");
row4[16] = unSPI.ToString("0.####");
table4.Rows.Add(row4);
b++;
}
a++;
}
a++;
c++;
}
if (table4.Rows.Count > 0)
{
@@ -350,7 +417,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
this.Grid4.DataBind();
}
//按专业统计
//按设备材料分类统计
DataTable table5 = new DataTable();
table5.Columns.Add(new DataColumn("Id", typeof(String)));
table5.Columns.Add(new DataColumn("Name", typeof(String)));
@@ -0,0 +1,114 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EquipmentMaterialBigType.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.EquipmentMaterialBigType" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>设备材料大类</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</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" EnableAjax="false" ShowHeader="false" Title="设备材料分类" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="EquipmentMaterialBigTypeId" AllowCellEditing="true" ForceFit="true"
ClicksToEdit="2" DataIDField="EquipmentMaterialBigTypeId" AllowSorting="true" SortField="EquipmentMaterialBigTypeCode"
SortDirection="ASC" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True" OnRowDoubleClick="Grid1_RowDoubleClick" OnPageIndexChange="Grid1_PageIndexChange">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtEquipmentMaterialBigTypeCode" runat="server" Label="编号" Width="250px" LabelWidth="110px"
LabelAlign="Right">
</f:TextBox>
<f:TextBox ID="txtEquipmentMaterialBigTypeName" runat="server" Label="名称" Width="250px" LabelWidth="120px"
LabelAlign="Right">
</f:TextBox>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSearch" Icon="SystemSearch"
EnablePostBack="true" runat="server" OnClick="btnSearch_Click">
</f:Button>
<f:Button ID="btnRset" OnClick="btnRset_Click" ToolTip="重置" Icon="ArrowUndo" EnablePostBack="true" runat="server">
</f:Button>
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" Hidden="true"
runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="EquipmentMaterialBigTypeCode" DataField="EquipmentMaterialBigTypeCode"
SortField="EquipmentMaterialBigTypeCode" FieldType="String" HeaderText="编号" TextAlign="center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="EquipmentMaterialBigTypeName" DataField="EquipmentMaterialBigTypeName"
SortField="EquipmentMaterialBigTypeName" FieldType="String" HeaderText="名称" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="Remark" DataField="Remark"
SortField="Remark" FieldType="String" HeaderText="备注" TextAlign="Center"
HeaderTextAlign="Center">
</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="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="100000" />
</f:DropDownList>
<f:ToolbarFill runat="server">
</f:ToolbarFill>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="设备材料大类" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="500px" Height="300px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"
OnClick="btnMenuModify_Click">
</f:MenuButton>
<%--<f:MenuButton ID="btnMenuView" EnablePostBack="true" runat="server" Text="查看" Icon="ApplicationViewIcons" OnClick="btnMenuView_Click">
</f:MenuButton>--%>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Hidden="true" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
OnClick="btnMenuDel_Click">
</f:MenuButton>
</Items>
</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;
}
</script>
</body>
</html>
@@ -0,0 +1,182 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class EquipmentMaterialBigType : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
// 绑定表格
BindGrid();
btnNew.OnClientClick = Window1.GetShowReference("EquipmentMaterialBigTypeEdit.aspx") + "return false;";
}
}
/// <summary>
/// 绑定数据
/// </summary>
public void BindGrid()
{
DataTable tb = BindData();
Grid1.RecordCount = tb.Rows.Count;
tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
protected DataTable BindData()
{
string strSql = @"select EquipmentMaterialBigTypeId,EquipmentMaterialBigTypeCode,EquipmentMaterialBigTypeName,Remark from [dbo].[WBS_EquipmentMaterialBigType] where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtEquipmentMaterialBigTypeCode.Text.Trim()))
{
strSql += " AND EquipmentMaterialBigTypeCode like @EquipmentMaterialBigTypeCode";
listStr.Add(new SqlParameter("@EquipmentMaterialBigTypeCode", "%" + this.txtEquipmentMaterialBigTypeCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtEquipmentMaterialBigTypeName.Text.Trim()))
{
strSql += " AND EquipmentMaterialBigTypeName like @EquipmentMaterialBigTypeName";
listStr.Add(new SqlParameter("@EquipmentMaterialBigTypeName", "%" + this.txtEquipmentMaterialBigTypeName.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
return tb;
}
protected void btnMenuModify_Click(object sender, EventArgs e)
{
EditData();
}
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.EquipmentMaterialBigTypeService.DeleteEquipmentMaterialBigTypeById(rowID);
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
/// <summary>
/// 编辑数据方法
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
if (this.btnMenuModify.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EquipmentMaterialBigTypeView.aspx?EquipmentMaterialBigTypeId={0}", Grid1.SelectedRowID, "查看 - ")));
}
else
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EquipmentMaterialBigTypeEdit.aspx?EquipmentMaterialBigTypeId={0}", Grid1.SelectedRowID, "编辑 - ")));
}
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EquipmentMaterialBigTypeMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
}
}
#endregion
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
EditData();
}
protected void btnMenuView_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EquipmentMaterialBigTypeView.aspx?EquipmentMaterialBigTypeId={0}", Grid1.SelectedRowID, "查看 - ")));
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
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 btnRset_Click(object sender, EventArgs e)
{
txtEquipmentMaterialBigTypeCode.Text = "";
txtEquipmentMaterialBigTypeName.Text = "";
BindGrid();
}
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
}
}
@@ -0,0 +1,177 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class EquipmentMaterialBigType {
/// <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>
/// txtEquipmentMaterialBigTypeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialBigTypeCode;
/// <summary>
/// txtEquipmentMaterialBigTypeName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialBigTypeName;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnRset 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnRset;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <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>
/// btnMenuModify 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuModify;
/// <summary>
/// btnMenuDel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDel;
}
}
@@ -0,0 +1,54 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EquipmentMaterialBigTypeEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.EquipmentMaterialBigTypeEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>设备材料分类</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="txtEquipmentMaterialBigTypeCode" runat="server" Label="编号"
Required="true" MaxLength="50" ShowRedStar="true" LabelWidth="110px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="txtEquipmentMaterialBigTypeName" runat="server" Label="名称"
Required="true" MaxLength="50" ShowRedStar="true" LabelWidth="110px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注"
MaxLength="100" LabelWidth="110px">
</f:TextBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdCheckerId" runat="server">
</f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false"
runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>
@@ -0,0 +1,61 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class EquipmentMaterialBigTypeEdit : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string EquipmentMaterialBigTypeId = Request.Params["EquipmentMaterialBigTypeId"];
if (!string.IsNullOrEmpty(EquipmentMaterialBigTypeId))
{
Model.WBS_EquipmentMaterialBigType EquipmentMaterialBigType = BLL.EquipmentMaterialBigTypeService.GetEquipmentMaterialBigType(EquipmentMaterialBigTypeId);
if (EquipmentMaterialBigType != null)
{
this.txtEquipmentMaterialBigTypeCode.Text = EquipmentMaterialBigType.EquipmentMaterialBigTypeCode;
this.txtEquipmentMaterialBigTypeName.Text = EquipmentMaterialBigType.EquipmentMaterialBigTypeName;
this.txtRemark.Text = EquipmentMaterialBigType.Remark;
}
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
SaveData(true);
}
private void SaveData(bool b)
{
string EquipmentMaterialBigTypeId = Request.Params["EquipmentMaterialBigTypeId"];
Model.WBS_EquipmentMaterialBigType EquipmentMaterialBigType = new Model.WBS_EquipmentMaterialBigType();
EquipmentMaterialBigType.EquipmentMaterialBigTypeCode = this.txtEquipmentMaterialBigTypeCode.Text.Trim();
EquipmentMaterialBigType.EquipmentMaterialBigTypeName = this.txtEquipmentMaterialBigTypeName.Text.Trim();
EquipmentMaterialBigType.Remark = this.txtRemark.Text.Trim();
if (!string.IsNullOrEmpty(EquipmentMaterialBigTypeId))
{
EquipmentMaterialBigType.EquipmentMaterialBigTypeId = EquipmentMaterialBigTypeId;
BLL.EquipmentMaterialBigTypeService.UpdateEquipmentMaterialBigType(EquipmentMaterialBigType);
}
else
{
EquipmentMaterialBigType.EquipmentMaterialBigTypeId = SQLHelper.GetNewID(typeof(Model.WBS_EquipmentMaterialBigType));
BLL.EquipmentMaterialBigTypeService.AddEquipmentMaterialBigType(EquipmentMaterialBigType);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
}
@@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class EquipmentMaterialBigTypeEdit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtEquipmentMaterialBigTypeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialBigTypeCode;
/// <summary>
/// txtEquipmentMaterialBigTypeName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialBigTypeName;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdCheckerId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdCheckerId;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
}
}
@@ -0,0 +1,54 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EquipmentMaterialBigTypeView.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.EquipmentMaterialBigTypeView" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>设备材料分类</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="txtEquipmentMaterialBigTypeCode" runat="server" Label="编号"
Required="true" MaxLength="50" ShowRedStar="true" LabelWidth="110px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:TextBox ID="txtEquipmentMaterialBigTypeName" runat="server" Label="名称"
Required="true" MaxLength="50" ShowRedStar="true" LabelWidth="110px">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注"
MaxLength="100" LabelWidth="110px">
</f:TextBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdCheckerId" runat="server">
</f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false"
runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>
@@ -0,0 +1,33 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class EquipmentMaterialBigTypeView : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string EquipmentMaterialBigTypeId = Request.Params["EquipmentMaterialBigTypeId"];
if (!string.IsNullOrEmpty(EquipmentMaterialBigTypeId))
{
Model.WBS_EquipmentMaterialBigType EquipmentMaterialBigType = BLL.EquipmentMaterialBigTypeService.GetEquipmentMaterialBigType(EquipmentMaterialBigTypeId);
if (EquipmentMaterialBigType != null)
{
this.txtEquipmentMaterialBigTypeCode.Text = EquipmentMaterialBigType.EquipmentMaterialBigTypeCode;
this.txtEquipmentMaterialBigTypeName.Text = EquipmentMaterialBigType.EquipmentMaterialBigTypeName;
this.txtRemark.Text = EquipmentMaterialBigType.Remark;
}
}
}
}
}
}
@@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class EquipmentMaterialBigTypeView {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtEquipmentMaterialBigTypeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialBigTypeCode;
/// <summary>
/// txtEquipmentMaterialBigTypeName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialBigTypeName;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdCheckerId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdCheckerId;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
}
}
@@ -29,6 +29,7 @@
<f:TextBox ID="txtEquipmentMaterialTypeName" runat="server" Label="名称" Width="250px" LabelWidth="120px"
LabelAlign="Right">
</f:TextBox>
<f:DropDownList runat="server" ID="drpEquipmentMaterialBigTypeId" Label="大类" LabelWidth="110px" EnableEdit="true" LabelAlign="Right"></f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSearch" Icon="SystemSearch"
EnablePostBack="true" runat="server" OnClick="btnSearch_Click">
@@ -52,11 +53,14 @@
SortField="EquipmentMaterialTypeCode" FieldType="String" HeaderText="编号" TextAlign="center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="EquipmentMaterialTypeName" DataField="EquipmentMaterialTypeName"
SortField="EquipmentMaterialTypeName" FieldType="String" HeaderText="名称" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="EquipmentMaterialBigTypeName" DataField="EquipmentMaterialBigTypeName"
SortField="EquipmentMaterialBigTypeName" FieldType="String" HeaderText="大类" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="Remark" DataField="Remark"
SortField="Remark" FieldType="String" HeaderText="备注" TextAlign="Center"
HeaderTextAlign="Center">
@@ -18,7 +18,7 @@ namespace FineUIPro.Web.JDGL.WBS
{
GetButtonPower();
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
BLL.EquipmentMaterialBigTypeService.InitEquipmentMaterialBigTypeDownList(this.drpEquipmentMaterialBigTypeId, true);
// 绑定表格
BindGrid();
btnNew.OnClientClick = Window1.GetShowReference("EquipmentMaterialTypeEdit.aspx") + "return false;";
@@ -42,7 +42,7 @@ namespace FineUIPro.Web.JDGL.WBS
protected DataTable BindData()
{
string strSql = @"select EquipmentMaterialTypeId,EquipmentMaterialTypeCode,EquipmentMaterialTypeName,Remark from [dbo].[WBS_EquipmentMaterialType] where 1=1 ";
string strSql = @"select EquipmentMaterialTypeId,EquipmentMaterialTypeCode,EquipmentMaterialTypeName,a.Remark,b.EquipmentMaterialBigTypeName from [dbo].[WBS_EquipmentMaterialType] a left join WBS_EquipmentMaterialBigType b on a.EquipmentMaterialBigTypeId=b.EquipmentMaterialBigTypeId where 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtEquipmentMaterialTypeCode.Text.Trim()))
@@ -55,6 +55,11 @@ namespace FineUIPro.Web.JDGL.WBS
strSql += " AND EquipmentMaterialTypeName like @EquipmentMaterialTypeName";
listStr.Add(new SqlParameter("@EquipmentMaterialTypeName", "%" + this.txtEquipmentMaterialTypeName.Text.Trim() + "%"));
}
if (this.drpEquipmentMaterialBigTypeId.SelectedValue != BLL.Const._Null)
{
strSql += " AND a.EquipmentMaterialBigTypeId = @EquipmentMaterialBigTypeId";
listStr.Add(new SqlParameter("@EquipmentMaterialBigTypeId", this.drpEquipmentMaterialBigTypeId.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
return tb;
@@ -75,6 +75,15 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialTypeName;
/// <summary>
/// drpEquipmentMaterialBigTypeId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpEquipmentMaterialBigTypeId;
/// <summary>
/// btnSearch 控件。
/// </summary>
@@ -27,6 +27,11 @@
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:DropDownList runat="server" ID="drpEquipmentMaterialBigTypeId" Label="大类" ShowRedStar="true" Required="true" LabelWidth="110px" EnableEdit="true"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注"
@@ -16,6 +16,7 @@ namespace FineUIPro.Web.JDGL.WBS
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string EquipmentMaterialTypeId = Request.Params["EquipmentMaterialTypeId"];
BLL.EquipmentMaterialBigTypeService.InitEquipmentMaterialBigTypeDownList(this.drpEquipmentMaterialBigTypeId, true);
if (!string.IsNullOrEmpty(EquipmentMaterialTypeId))
{
@@ -24,6 +25,10 @@ namespace FineUIPro.Web.JDGL.WBS
{
this.txtEquipmentMaterialTypeCode.Text = EquipmentMaterialType.EquipmentMaterialTypeCode;
this.txtEquipmentMaterialTypeName.Text = EquipmentMaterialType.EquipmentMaterialTypeName;
if (!string.IsNullOrEmpty(EquipmentMaterialType.EquipmentMaterialBigTypeId))
{
this.drpEquipmentMaterialBigTypeId.SelectedValue = EquipmentMaterialType.EquipmentMaterialBigTypeId;
}
this.txtRemark.Text = EquipmentMaterialType.Remark;
}
}
@@ -33,6 +38,11 @@ namespace FineUIPro.Web.JDGL.WBS
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.drpEquipmentMaterialBigTypeId.SelectedValue == BLL.Const._Null)
{
ShowNotify("请选择大类!", MessageBoxIcon.Warning);
return;
}
SaveData(true);
}
@@ -42,6 +52,7 @@ namespace FineUIPro.Web.JDGL.WBS
Model.WBS_EquipmentMaterialType EquipmentMaterialType = new Model.WBS_EquipmentMaterialType();
EquipmentMaterialType.EquipmentMaterialTypeCode = this.txtEquipmentMaterialTypeCode.Text.Trim();
EquipmentMaterialType.EquipmentMaterialTypeName = this.txtEquipmentMaterialTypeName.Text.Trim();
EquipmentMaterialType.EquipmentMaterialBigTypeId = this.drpEquipmentMaterialBigTypeId.SelectedValue;
EquipmentMaterialType.Remark = this.txtRemark.Text.Trim();
if (!string.IsNullOrEmpty(EquipmentMaterialTypeId))
{
@@ -57,6 +57,15 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialTypeName;
/// <summary>
/// drpEquipmentMaterialBigTypeId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpEquipmentMaterialBigTypeId;
/// <summary>
/// txtRemark 控件。
/// </summary>
@@ -27,6 +27,11 @@
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow runat="server">
<Items>
<f:DropDownList runat="server" ID="drpEquipmentMaterialBigTypeId" Label="大类" EnableEdit="true" LabelWidth="110px" Readonly="true"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注"
@@ -16,6 +16,7 @@ namespace FineUIPro.Web.JDGL.WBS
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
string EquipmentMaterialTypeId = Request.Params["EquipmentMaterialTypeId"];
BLL.EquipmentMaterialBigTypeService.InitEquipmentMaterialBigTypeDownList(this.drpEquipmentMaterialBigTypeId, true);
if (!string.IsNullOrEmpty(EquipmentMaterialTypeId))
{
@@ -24,6 +25,10 @@ namespace FineUIPro.Web.JDGL.WBS
{
this.txtEquipmentMaterialTypeCode.Text = EquipmentMaterialType.EquipmentMaterialTypeCode;
this.txtEquipmentMaterialTypeName.Text = EquipmentMaterialType.EquipmentMaterialTypeName;
if (!string.IsNullOrEmpty(EquipmentMaterialType.EquipmentMaterialBigTypeId))
{
this.drpEquipmentMaterialBigTypeId.SelectedValue = EquipmentMaterialType.EquipmentMaterialBigTypeId;
}
this.txtRemark.Text = EquipmentMaterialType.Remark;
}
}
@@ -57,6 +57,15 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks>
protected global::FineUIPro.TextBox txtEquipmentMaterialTypeName;
/// <summary>
/// drpEquipmentMaterialBigTypeId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpEquipmentMaterialBigTypeId;
/// <summary>
/// txtRemark 控件。
/// </summary>