提交代码
This commit is contained in:
parent
3b18178e30
commit
a75ba9f44a
|
@ -81,6 +81,17 @@ namespace BLL
|
||||||
Funs.FineUIPleaseSelect(dropName);
|
Funs.FineUIPleaseSelect(dropName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public static void InitDistinctCNProfessionalDownList(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease)
|
||||||
|
{
|
||||||
|
dropName.DataValueField = "Value";
|
||||||
|
dropName.DataTextField = "Text";
|
||||||
|
dropName.DataSource = GetDistinctCNProfessionalItem(projectId);
|
||||||
|
dropName.DataBind();
|
||||||
|
if (isShowPlease)
|
||||||
|
{
|
||||||
|
Funs.FineUIPleaseSelect(dropName);
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 专业下拉框
|
/// 专业下拉框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -113,6 +124,24 @@ namespace BLL
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取专业集合
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static ListItem[] GetDistinctCNProfessionalItem(string projectId)
|
||||||
|
{
|
||||||
|
Model.SGGLDB db = Funs.DB;
|
||||||
|
var bases = from x in db.View_QuantityManagement_Base where x.ProjectId == projectId select x;
|
||||||
|
var cnNames = bases.Select(x => x.Major).Distinct().ToList();
|
||||||
|
var q = (from x in db.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId && cnNames.Contains(x.ProfessionalName) orderby x.SortIndex select x).ToList();
|
||||||
|
ListItem[] list = new ListItem[q.Count()];
|
||||||
|
for (int i = 0; i < q.Count(); i++)
|
||||||
|
{
|
||||||
|
list[i] = new ListItem(q[i].ProfessionalName ?? "", q[i].CNProfessionalId);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取一个专业信息
|
/// 获取一个专业信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -42,9 +42,12 @@
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
|
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
|
||||||
<Items>
|
<Items>
|
||||||
<f:TextBox runat="server" ID="txtDrawingNo" Label="图号" LabelWidth="60px" LabelAlign="Right"></f:TextBox>
|
<f:DropDownList ID="drpDrawingNo" runat="server" LabelWidth="60px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
|
||||||
<f:TextBox runat="server" ID="txtPart" Label="部位" LabelWidth="60px" LabelAlign="Right"></f:TextBox>
|
</f:DropDownList>
|
||||||
<f:TextBox runat="server" ID="txtProjectContent" Label="项目内容" LabelWidth="100px" LabelAlign="Right"></f:TextBox>
|
<f:DropDownList ID="drpPart" runat="server" LabelWidth="60px" Required="true" Label="部位" LabelAlign="Right" EnableEdit="true">
|
||||||
|
</f:DropDownList>
|
||||||
|
<f:DropDownList ID="drpProjectContent" runat="server" LabelWidth="100px" Required="true" Label="项目内容" LabelAlign="Right" EnableEdit="true">
|
||||||
|
</f:DropDownList>
|
||||||
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
|
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
|
||||||
</f:Button>
|
</f:Button>
|
||||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||||
|
|
|
@ -19,6 +19,9 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, this.CurrUser.LoginProjectId, true);
|
||||||
|
BLL.BaseService.InitAllPartDropDownList(this.drpPart, this.CurrUser.LoginProjectId, true);
|
||||||
|
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, this.CurrUser.LoginProjectId, true);
|
||||||
GetButtonPower();
|
GetButtonPower();
|
||||||
InitTreeMenu();
|
InitTreeMenu();
|
||||||
}
|
}
|
||||||
|
@ -108,20 +111,20 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||||
listStr.Add(new SqlParameter("@WorkSection", this.trWBS.SelectedNodeID));
|
listStr.Add(new SqlParameter("@WorkSection", this.trWBS.SelectedNodeID));
|
||||||
if (!string.IsNullOrEmpty(this.txtDrawingNo.Text.Trim()))
|
if (this.drpDrawingNo.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND DrawingNo like @DrawingNo";
|
strSql += " AND DrawingId = @DrawingId";
|
||||||
listStr.Add(new SqlParameter("@DrawingNo", "%" + this.txtDrawingNo.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@DrawingId", this.drpDrawingNo.SelectedValue));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(this.txtPart.Text.Trim()))
|
if (this.drpPart.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND Part like @Part";
|
strSql += " AND Part = @Part";
|
||||||
listStr.Add(new SqlParameter("@Part", "%" + this.txtPart.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@Part", this.drpPart.SelectedItem.Text));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(this.txtProjectContent.Text.Trim()))
|
if (this.drpProjectContent.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND ProjectContent like @ProjectContent";
|
strSql += " AND ProjectContent = @ProjectContent";
|
||||||
listStr.Add(new SqlParameter("@ProjectContent", "%" + this.txtProjectContent.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@ProjectContent", this.drpProjectContent.SelectedItem.Text));
|
||||||
}
|
}
|
||||||
SqlParameter[] parameter = listStr.ToArray();
|
SqlParameter[] parameter = listStr.ToArray();
|
||||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||||
|
|
|
@ -94,31 +94,31 @@ namespace FineUIPro.Web.CQMS.QuantityManagement {
|
||||||
protected global::FineUIPro.Toolbar ToolSearch;
|
protected global::FineUIPro.Toolbar ToolSearch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtDrawingNo 控件。
|
/// drpDrawingNo 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtDrawingNo;
|
protected global::FineUIPro.DropDownList drpDrawingNo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtPart 控件。
|
/// drpPart 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtPart;
|
protected global::FineUIPro.DropDownList drpPart;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtProjectContent 控件。
|
/// drpProjectContent 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtProjectContent;
|
protected global::FineUIPro.DropDownList drpProjectContent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnSearch 控件。
|
/// btnSearch 控件。
|
||||||
|
|
|
@ -22,9 +22,12 @@
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
|
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
|
||||||
<Items>
|
<Items>
|
||||||
<f:TextBox runat="server" ID="txtDrawingNo" Label="图号" LabelWidth="60px" LabelAlign="Right"></f:TextBox>
|
<f:DropDownList ID="drpDrawingNo" runat="server" LabelWidth="60px" Required="true" Label="图号" LabelAlign="Right" EnableEdit="true">
|
||||||
<f:TextBox runat="server" ID="txtPart" Label="部位" LabelWidth="60px" LabelAlign="Right"></f:TextBox>
|
</f:DropDownList>
|
||||||
<f:TextBox runat="server" ID="txtProjectContent" Label="项目内容" LabelWidth="100px" LabelAlign="Right"></f:TextBox>
|
<f:DropDownList ID="drpPart" runat="server" LabelWidth="60px" Required="true" Label="部位" LabelAlign="Right" EnableEdit="true">
|
||||||
|
</f:DropDownList>
|
||||||
|
<f:DropDownList ID="drpProjectContent" runat="server" LabelWidth="100px" Required="true" Label="项目内容" LabelAlign="Right" EnableEdit="true">
|
||||||
|
</f:DropDownList>
|
||||||
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
|
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
|
||||||
</f:Button>
|
</f:Button>
|
||||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||||
|
|
|
@ -19,6 +19,9 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, this.CurrUser.LoginProjectId, true);
|
||||||
|
BLL.BaseService.InitAllPartDropDownList(this.drpPart, this.CurrUser.LoginProjectId, true);
|
||||||
|
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, this.CurrUser.LoginProjectId, true);
|
||||||
GetButtonPower();
|
GetButtonPower();
|
||||||
BindGrid();
|
BindGrid();
|
||||||
}
|
}
|
||||||
|
@ -33,20 +36,20 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
where C.ProjectId = @ProjectId";
|
where C.ProjectId = @ProjectId";
|
||||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||||
if (!string.IsNullOrEmpty(this.txtDrawingNo.Text.Trim()))
|
if (this.drpDrawingNo.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND DrawingNo like @DrawingNo";
|
strSql += " AND DrawingId = @DrawingId";
|
||||||
listStr.Add(new SqlParameter("@DrawingNo", "%" + this.txtDrawingNo.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@DrawingId", this.drpDrawingNo.SelectedValue));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(this.txtPart.Text.Trim()))
|
if (this.drpPart.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND Part like @Part";
|
strSql += " AND Part = @Part";
|
||||||
listStr.Add(new SqlParameter("@Part", "%" + this.txtPart.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@Part", this.drpPart.SelectedItem.Text));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(this.txtProjectContent.Text.Trim()))
|
if (this.drpProjectContent.SelectedValue != BLL.Const._Null)
|
||||||
{
|
{
|
||||||
strSql += " AND ProjectContent like @ProjectContent";
|
strSql += " AND ProjectContent = @ProjectContent";
|
||||||
listStr.Add(new SqlParameter("@ProjectContent", "%" + this.txtProjectContent.Text.Trim() + "%"));
|
listStr.Add(new SqlParameter("@ProjectContent", this.drpProjectContent.SelectedItem.Text));
|
||||||
}
|
}
|
||||||
SqlParameter[] parameter = listStr.ToArray();
|
SqlParameter[] parameter = listStr.ToArray();
|
||||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||||
|
|
|
@ -58,31 +58,31 @@ namespace FineUIPro.Web.CQMS.QuantityManagement {
|
||||||
protected global::FineUIPro.Toolbar ToolSearch;
|
protected global::FineUIPro.Toolbar ToolSearch;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtDrawingNo 控件。
|
/// drpDrawingNo 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtDrawingNo;
|
protected global::FineUIPro.DropDownList drpDrawingNo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtPart 控件。
|
/// drpPart 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtPart;
|
protected global::FineUIPro.DropDownList drpPart;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// txtProjectContent 控件。
|
/// drpProjectContent 控件。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 自动生成的字段。
|
/// 自动生成的字段。
|
||||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::FineUIPro.TextBox txtProjectContent;
|
protected global::FineUIPro.DropDownList drpProjectContent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnSearch 控件。
|
/// btnSearch 控件。
|
||||||
|
|
|
@ -119,7 +119,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
}
|
}
|
||||||
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, projectId, true);
|
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, projectId, true);
|
||||||
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, projectId, true);
|
BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, projectId, true);
|
||||||
BLL.CNProfessionalService.InitCNProfessionalDownList(drpMajor, true);
|
BLL.CNProfessionalService.InitDistinctCNProfessionalDownList(drpMajor, projectId, true);
|
||||||
BLL.BaseService.InitAllPartDropDownList(this.drpPart, projectId, true);
|
BLL.BaseService.InitAllPartDropDownList(this.drpPart, projectId, true);
|
||||||
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
|
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
|
||||||
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, projectId, true);
|
BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, projectId, true);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true"
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true"
|
||||||
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true" ForceFit="true"
|
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true" ForceFit="true"
|
||||||
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Major,ProjectContent"
|
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="Major,ProjectContent"
|
||||||
SortDirection="DESC" OnSort="Grid1_Sort"
|
SortDirection="DESC" OnSort="Grid1_Sort" EnableSummary="true" SummaryPosition="Flow"
|
||||||
AllowPaging="false" IsDatabasePaging="true" PageSize="10000"
|
AllowPaging="false" IsDatabasePaging="true" PageSize="10000"
|
||||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using BLL;
|
using BLL;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using NPOI.SS.Util;
|
using NPOI.SS.Util;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -32,7 +33,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
this.drpProject.Hidden = true;
|
this.drpProject.Hidden = true;
|
||||||
projectId = this.drpProject.SelectedValue;
|
projectId = this.drpProject.SelectedValue;
|
||||||
}
|
}
|
||||||
BLL.CNProfessionalService.InitCNProfessionalDownList(drpMajor, true);
|
BLL.CNProfessionalService.InitDistinctCNProfessionalDownList(drpMajor, projectId, true);
|
||||||
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
|
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
|
||||||
GetButtonPower();
|
GetButtonPower();
|
||||||
BindGrid();
|
BindGrid();
|
||||||
|
@ -124,6 +125,27 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
this.Grid1.Rows[i].Values[8] = decimal.Round(completedAmount / totalAmount, 4) * 100;
|
this.Grid1.Rows[i].Values[8] = decimal.Round(completedAmount / totalAmount, 4) * 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
OutputSummaryData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 全部行合计
|
||||||
|
/// </summary>
|
||||||
|
private void OutputSummaryData()
|
||||||
|
{
|
||||||
|
if (this.Grid1.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
decimal d = 0;
|
||||||
|
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
d += Funs.GetNewDecimalOrZero(this.Grid1.Rows[i].Values[8].ToString());
|
||||||
|
}
|
||||||
|
JObject summary = new JObject();
|
||||||
|
summary.Add("MonthComplete", "合计");
|
||||||
|
summary.Add("CompleteRate", decimal.Round(d / this.Grid1.Rows.Count, 2).ToString());
|
||||||
|
Grid1.SummaryData = summary;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -333,6 +355,34 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(Grid1.Rows[i].Values[8].ToString());
|
cell.SetCellValue(Grid1.Rows[i].Values[8].ToString());
|
||||||
}
|
}
|
||||||
|
row = sheet.CreateRow(r + Grid1.Rows.Count);
|
||||||
|
cell = row.CreateCell(0);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(1);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(2);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(3);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(4);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(5);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(6);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(7);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue("合计");
|
||||||
|
cell = row.CreateCell(8);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(Grid1.SummaryData["CompleteRate"].ToString());
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
|
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true"
|
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true"
|
||||||
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true" ForceFit="true"
|
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true" ForceFit="true"
|
||||||
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="WorkSection,ProjectContent"
|
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="WorkSection,ProjectContent"
|
||||||
SortDirection="DESC" OnSort="Grid1_Sort"
|
SortDirection="DESC" OnSort="Grid1_Sort" EnableSummary="true" SummaryPosition="Flow"
|
||||||
AllowPaging="false" IsDatabasePaging="true" PageSize="10000"
|
AllowPaging="false" IsDatabasePaging="true" PageSize="10000"
|
||||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||||
<Toolbars>
|
<Toolbars>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using BLL;
|
using BLL;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
using NPOI.SS.Util;
|
using NPOI.SS.Util;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -33,7 +34,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
projectId = this.drpProject.SelectedValue;
|
projectId = this.drpProject.SelectedValue;
|
||||||
}
|
}
|
||||||
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, projectId, true);
|
BLL.DrawingService.InitWorkSectionDropDownList(drpWorkSection, projectId, true);
|
||||||
BLL.CNProfessionalService.InitCNProfessionalDownList(drpMajor, true);
|
BLL.CNProfessionalService.InitDistinctCNProfessionalDownList(drpMajor, projectId, true);
|
||||||
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
|
BLL.BaseService.InitAllProjectContentDropDownList(this.drpProjectContent, projectId, true);
|
||||||
|
|
||||||
GetButtonPower();
|
GetButtonPower();
|
||||||
|
@ -132,6 +133,27 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
this.Grid1.Rows[i].Values[9] = decimal.Round(completedAmount / totalAmount, 4) * 100;
|
this.Grid1.Rows[i].Values[9] = decimal.Round(completedAmount / totalAmount, 4) * 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
OutputSummaryData();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 全部行合计
|
||||||
|
/// </summary>
|
||||||
|
private void OutputSummaryData()
|
||||||
|
{
|
||||||
|
if (this.Grid1.Rows.Count > 0)
|
||||||
|
{
|
||||||
|
decimal d=0;
|
||||||
|
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||||
|
{
|
||||||
|
d += Funs.GetNewDecimalOrZero(this.Grid1.Rows[i].Values[9].ToString());
|
||||||
|
}
|
||||||
|
JObject summary = new JObject();
|
||||||
|
summary.Add("MonthComplete", "合计");
|
||||||
|
summary.Add("CompleteRate", decimal.Round(d / this.Grid1.Rows.Count, 2).ToString());
|
||||||
|
Grid1.SummaryData = summary;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -344,6 +366,37 @@ namespace FineUIPro.Web.CQMS.QuantityManagement
|
||||||
cell.CellStyle = cellStyle;
|
cell.CellStyle = cellStyle;
|
||||||
cell.SetCellValue(Grid1.Rows[i].Values[9].ToString());
|
cell.SetCellValue(Grid1.Rows[i].Values[9].ToString());
|
||||||
}
|
}
|
||||||
|
row = sheet.CreateRow(r + Grid1.Rows.Count);
|
||||||
|
cell = row.CreateCell(0);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(1);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(2);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(3);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(4);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(5);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(6);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(7);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(string.Empty);
|
||||||
|
cell = row.CreateCell(8);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue("合计");
|
||||||
|
cell = row.CreateCell(9);
|
||||||
|
cell.CellStyle = cellStyle;
|
||||||
|
cell.SetCellValue(Grid1.SummaryData["CompleteRate"].ToString());
|
||||||
// 第三步:写入文件流
|
// 第三步:写入文件流
|
||||||
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
|
using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue