提交代码
This commit is contained in:
		
							parent
							
								
									d609421334
								
							
						
					
					
						commit
						8c55c6f470
					
				|  | @ -4,6 +4,7 @@ using System.Linq; | |||
| using System.Text; | ||||
| using System.Collections; | ||||
| using System.Web.UI.WebControls; | ||||
| using System.Data; | ||||
| 
 | ||||
| namespace BLL | ||||
| { | ||||
|  | @ -269,5 +270,121 @@ namespace BLL | |||
|             else | ||||
|                 return null; | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 获取模拟树表格 | ||||
|         /// </summary> | ||||
|         /// <returns></returns> | ||||
|         public static DataTable GetAllTreeDataTable(string projectId) | ||||
|         { | ||||
|             using (var db = new Model.SGGLDB(Funs.ConnString)) | ||||
|             { | ||||
|                 IQueryable<Model.Base_CNProfessional> cNProfessionals = from x in db.Base_CNProfessional where x.CNProfessionalId != BLL.Const.CNProfessionalConstructId orderby x.SortIndex select x; | ||||
|                 IQueryable<Model.View_QuantityManagement_Base> bases = from x in db.View_QuantityManagement_Base where x.ProjectId == projectId select x; | ||||
|                 DataTable table = new DataTable(); | ||||
|                 table.Columns.Add(new DataColumn("BaseId", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("SupId", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("Name", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("ProjectId", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("DrawingNo", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("DrawingName", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("Part", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("ProjectContent", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("Unit", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("Amount", typeof(decimal))); | ||||
|                 table.Columns.Add(new DataColumn("WorkTeam", typeof(String))); | ||||
|                 table.Columns.Add(new DataColumn("State", typeof(String))); | ||||
| 
 | ||||
|                 DataRow row; | ||||
|                 row = table.NewRow(); | ||||
|                 row[0] = "0"; | ||||
|                 row[1] = null; | ||||
|                 row[2] = "工程量基础表"; | ||||
|                 row[3] = projectId; | ||||
|                 row[4] = ""; | ||||
|                 row[5] = ""; | ||||
|                 row[6] = ""; | ||||
|                 row[7] = ""; | ||||
|                 row[8] = ""; | ||||
|                 row[9] = DBNull.Value; | ||||
|                 row[10] = ""; | ||||
|                 row[11] = ""; | ||||
|                 table.Rows.Add(row); | ||||
|                 foreach (var item in cNProfessionals) | ||||
|                 { | ||||
|                     row = table.NewRow(); | ||||
|                     row[0] = item.CNProfessionalId; | ||||
|                     row[1] = "0"; | ||||
|                     row[2] = item.ProfessionalName; | ||||
|                     row[3] = projectId; | ||||
|                     row[4] = ""; | ||||
|                     row[5] = ""; | ||||
|                     row[6] = ""; | ||||
|                     row[7] = ""; | ||||
|                     row[8] = ""; | ||||
|                     row[9] = DBNull.Value; | ||||
|                     row[10] = ""; | ||||
|                     row[11] = ""; | ||||
|                     table.Rows.Add(row); | ||||
|                     var workSections = bases.Where(x => x.Major == item.ProfessionalName).Select(x => x.WorkSection).Distinct().ToList(); | ||||
|                     foreach (var workSection in workSections) | ||||
|                     { | ||||
|                         row = table.NewRow(); | ||||
|                         row[0] = item.CNProfessionalId + workSection; | ||||
|                         row[1] = item.CNProfessionalId; | ||||
|                         row[2] = workSection; | ||||
|                         row[3] = projectId; | ||||
|                         row[4] = ""; | ||||
|                         row[5] = ""; | ||||
|                         row[6] = ""; | ||||
|                         row[7] = ""; | ||||
|                         row[8] = ""; | ||||
|                         row[9] = DBNull.Value; | ||||
|                         row[10] = ""; | ||||
|                         row[11] = ""; | ||||
|                         table.Rows.Add(row); | ||||
|                         var bs = from x in bases | ||||
|                                  where x.WorkSection == workSection && x.Major == item.ProfessionalName | ||||
|                                  orderby x.DrawingNo, x.Part, x.WorkSection | ||||
|                                  select x; | ||||
|                         foreach (var b in bs) | ||||
|                         { | ||||
|                             row = table.NewRow(); | ||||
|                             row[0] = b.BaseId; | ||||
|                             row[1] = item.CNProfessionalId + workSection; | ||||
|                             row[2] = b.Part; | ||||
|                             row[3] = projectId; | ||||
|                             row[4] = b.DrawingNo; | ||||
|                             row[5] = b.DrawingName; | ||||
|                             row[6] = b.Part; | ||||
|                             row[7] = b.ProjectContent; | ||||
|                             row[8] = b.Unit; | ||||
|                             row[9] = b.Amount; | ||||
|                             row[10] = b.WorkTeam; | ||||
|                             row[11] = b.State; | ||||
|                             table.Rows.Add(row); | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|                 //foreach (var item in bases) | ||||
|                 //{ | ||||
|                 //    row = table.NewRow(); | ||||
|                 //    row[0] = item.BaseId; | ||||
|                 //    row[1] = "0"; | ||||
|                 //    row[2] = item.ProfessionalName; | ||||
|                 //    row[3] = projectId; | ||||
|                 //    row[4] = ""; | ||||
|                 //    row[5] = ""; | ||||
|                 //    row[6] = ""; | ||||
|                 //    row[7] = ""; | ||||
|                 //    row[8] = ""; | ||||
|                 //    row[9] = DBNull.Value; | ||||
|                 //    row[10] = ""; | ||||
|                 //    row[11] = ""; | ||||
|                 //    table.Rows.Add(row); | ||||
|                 //} | ||||
|                 return table; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -13,8 +13,8 @@ | |||
|         <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="工程量基础表" EnableCollapse="true" | ||||
|                     runat="server" BoxFlex="1" DataKeyNames="BaseId" AllowCellEditing="true" EnableColumnLines="true" | ||||
|                 <f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="工程量基础表" EnableCollapse="true" DataParentIDField="SupId" ExpandAllTreeNodes="true" | ||||
|                     runat="server" BoxFlex="1" DataKeyNames="BaseId" AllowCellEditing="true" EnableColumnLines="true" TreeColumn="Name" EnableTree="true" | ||||
|                     ClicksToEdit="2" DataIDField="BaseId" AllowSorting="true" SortField="DrawingNo,Part,ProjectContent" ForceFit="true" | ||||
|                     SortDirection="DESC" OnSort="Grid1_Sort" | ||||
|                     AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" | ||||
|  | @ -42,21 +42,21 @@ | |||
|                                 <asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label> | ||||
|                             </ItemTemplate> | ||||
|                         </f:TemplateField> | ||||
|                         <f:RenderField ColumnID="WorkSection" DataField="WorkSection" FieldType="String" HeaderText="工段" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="120px"> | ||||
|                         <f:RenderField ColumnID="Name" DataField="Name" FieldType="String" HeaderText="层级" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="420px"> | ||||
|                         </f:RenderField> | ||||
|                         <%--<f:RenderField ColumnID="WorkSection" DataField="WorkSection" FieldType="String" HeaderText="工段" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="120px"> | ||||
|                         </f:RenderField>--%> | ||||
|                         <f:RenderField ColumnID="DrawingNo" DataField="DrawingNo" FieldType="String" HeaderText="图号" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="250px"> | ||||
|                         </f:RenderField> | ||||
|                         <f:RenderField ColumnID="DrawingName" DataField="DrawingName" FieldType="String" HeaderText="图纸名称" TextAlign="Center" | ||||
|                         <%--<f:RenderField ColumnID="DrawingName" DataField="DrawingName" FieldType="String" HeaderText="图纸名称" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="200px"> | ||||
|                         </f:RenderField> | ||||
|                         <f:RenderField ColumnID="Major" DataField="Major" FieldType="String" HeaderText="专业" TextAlign="Center" | ||||
|                         </f:RenderField>--%> | ||||
|                         <%--<f:RenderField ColumnID="Part" DataField="Part" FieldType="String" HeaderText="部位" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="120px"> | ||||
|                         </f:RenderField> | ||||
|                         <f:RenderField ColumnID="Part" DataField="Part" FieldType="String" HeaderText="部位" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="120px"> | ||||
|                         </f:RenderField> | ||||
|                         </f:RenderField>--%> | ||||
|                         <f:RenderField ColumnID="ProjectContent" DataField="ProjectContent" FieldType="String" HeaderText="项目内容" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="120px"> | ||||
|                         </f:RenderField> | ||||
|  |  | |||
|  | @ -20,7 +20,10 @@ namespace FineUIPro.Web.CQMS.QuantityManagement | |||
|             if (!IsPostBack) | ||||
|             { | ||||
|                 GetButtonPower(); | ||||
|                 BindGrid(); | ||||
|                 DataTable table = BLL.BaseService.GetAllTreeDataTable(this.CurrUser.LoginProjectId); | ||||
|                 Grid1.DataSource = table; | ||||
|                 Grid1.DataBind(); | ||||
|                 //BindGrid(); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
|  | @ -60,9 +60,6 @@ | |||
|                         <f:RenderField ColumnID="Amount" DataField="Amount" FieldType="Float" HeaderText="总数" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="100px"> | ||||
|                         </f:RenderField> | ||||
|                         <f:RenderField ColumnID="WorkTeam" DataField="WorkTeam" FieldType="String" HeaderText="作业队" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="150px"> | ||||
|                         </f:RenderField> | ||||
|                         <f:RenderField ColumnID="TotalComplete" DataField="TotalComplete" FieldType="Float" HeaderText="累计完成" TextAlign="Center" | ||||
|                             HeaderTextAlign="Center" Width="100px"> | ||||
|                         </f:RenderField> | ||||
|  |  | |||
|  | @ -113,7 +113,7 @@ namespace FineUIPro.Web.CQMS.QuantityManagement | |||
|                 } | ||||
|                 completedAmount= totalDayInputs.Where(x => x.WorkSection == workSection && x.ProjectContent == projectContent && x.WorkTeam == workTeam).ToList().Sum(x => x.DayAmount ?? 0); | ||||
|                 totalCompletedAmount = totalDayInputs.Where(x => x.WorkSection == workSection && x.ProjectContent == projectContent).ToList().Sum(x => x.DayAmount ?? 0); | ||||
|                 this.Grid1.Rows[i].Values[4] = totalAmount.ToString("0.##"); | ||||
|                 this.Grid1.Rows[i].Values[5] = totalAmount.ToString("0.##"); | ||||
|                 this.Grid1.Rows[i].Values[6] = completedAmount.ToString("0.##"); | ||||
|                 this.Grid1.Rows[i].Values[7] = (totalAmount - totalCompletedAmount).ToString("0.##"); | ||||
|                 this.Grid1.Rows[i].Values[8] = monthComplete.ToString("0.##"); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue