This commit is contained in:
2023-06-29 21:45:21 +08:00
23 changed files with 5396 additions and 28 deletions
@@ -0,0 +1,110 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckTemplate.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CheckTemplate" %>
<!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>本部检查项</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.f-grid-row .f-grid-cell-inner {
white-space: normal;
word-break: break-all;
}
</style>
</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" AutoScroll="true"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="本部检查项" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="ID" ForceFit="true" DataIDField="ID" AllowSorting="true" SortField="Indexs"
SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Button ID="btnNew" ToolTip="新增" Text="新增" Hidden="true" Icon="Add" runat="server"
OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="60px" ColumnID="Indexs" DataField="Indexs" SortField="Indexs"
FieldType="Int" HeaderText="行号" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="60px" ColumnID="SortIndex" DataField="SortIndex"
FieldType="Int" HeaderText="序号" TextAlign="Center" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="CheckItem" DataField="CheckItem"
FieldType="String" HeaderText="检查项" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="CheckStandard" DataField="CheckStandard"
FieldType="String" HeaderText="检查标准" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="300px" ColumnID="CheckMethod" DataField="CheckMethod"
FieldType="String" HeaderText="检查方法" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="BaseScore" DataField="BaseScore"
FieldType="Double" HeaderText="基准分" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="dataload" Handler="onGridDataLoad" />
<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:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" runat="server" Hidden="true" ShowHeader="true"
IsModal="true" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
Title="编辑" EnableIFrame="true" Height="500px"
Width="900px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnEdit_Click" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnDelete_Click" EnablePostBack="true" Icon="Delete"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</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 onGridDataLoad(event) {
this.mergeColumns(['SortIndex', 'CheckItem', 'CheckMethod', 'BaseScore',], {
dependsFirst: true
});
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>
@@ -0,0 +1,187 @@
using BLL;
using System;
using System.Text;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.BaseInfo
{
public partial class CheckTemplate : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.GetButtonPower();
Funs.DropDownPageSize(this.ddlPageSize);
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
// 绑定表格
this.BindGrid();
}
}
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
var tb = BLL.CheckTemplateService.getListData( Grid1);
Grid1.RecordCount = CheckTemplateService.count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
Grid1.DataSource = tb;
Grid1.DataBind();
}
#endregion
#region GV
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
this.Grid1.PageIndex = e.NewPageIndex;
this.BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
this.BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 新增
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckTemplateEdit.aspx?CheckTemplateID={0}", string.Empty, "增加 - ")));
}
/// <summary>
/// 编辑按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnEdit_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CheckTemplateEdit.aspx?CheckTemplateID={0}", Grid1.SelectedRowID, "编辑 - ")));
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.btnEdit_Click(null, null);
}
/// <summary>
/// 批量删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
BLL.CheckTemplateService.DeleteCheckTemplateById(rowID);
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
#region
/// <summary>
/// 关闭弹出窗
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CheckTemplateMenuId);
if (buttonList.Count > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("本部检查项" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = this.Grid1.RecordCount;
//this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#endregion
}
}
+143
View File
@@ -0,0 +1,143 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo
{
public partial class CheckTemplate
{
/// <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>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <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;
}
}
@@ -0,0 +1,74 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckTemplateEdit.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.CheckTemplateEdit" %>
<!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></title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:NumberBox ID="txtIndexs" runat="server" Label="行号"
NoDecimal="true" NoNegative="true" Required="true" ShowRedStar="true">
</f:NumberBox>
<f:NumberBox ID="txtSortIndex" runat="server" Label="序号" FocusOnPageLoad="true"
NoDecimal="true" NoNegative="true" Required="true" ShowRedStar="true">
</f:NumberBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtCheckItem" runat="server" Label="检查项" MaxLength="50" Required="true" ShowRedStar="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtCheckStandard" runat="server" Label="检查标准" MaxLength="2000" Required="true" ShowRedStar="true">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtCheckMethod" runat="server" Label="检查方法" MaxLength="800" Required="true" ShowRedStar="true">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:NumberBox ID="txtBaseScore" runat="server" Label="基准分" DecimalPrecision="2" NoNegative="true" Required="true" ShowRedStar="true">
</f:NumberBox>
<f:Label runat="server" ID="lb"></f:Label>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1" Hidden="true"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" Text="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="Window1" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form>
</body>
</html>
@@ -0,0 +1,107 @@
using BLL;
using System;
using System.Linq;
namespace FineUIPro.Web.BaseInfo
{
public partial class CheckTemplateEdit : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string CheckTemplateID
{
get
{
return (string)ViewState["CheckTemplateID"];
}
set
{
ViewState["CheckTemplateID"] = value;
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
////权限按钮方法
this.GetButtonPower();
this.CheckTemplateID = Request.Params["CheckTemplateID"];
if (!string.IsNullOrEmpty(this.ID))
{
var getData = BLL.CheckTemplateService.GetCheckTemplateById(this.CheckTemplateID);
if (getData != null)
{
this.txtSortIndex.Text = getData.SortIndex.ToString();
this.txtCheckItem.Text = getData.CheckItem;
this.txtCheckStandard.Text = getData.CheckStandard;
this.txtCheckMethod.Text = getData.CheckMethod;
this.txtBaseScore.Text = getData.BaseScore.ToString();
this.txtIndexs.Text = getData.Indexs.ToString();
}
}
else
{
this.txtIndexs.Text= ((Funs.DB.ProjectSupervision_CheckTemplate.Max(x => x.Indexs) ?? 0) + 1).ToString();
}
}
}
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
Model.ProjectSupervision_CheckTemplate newCheckTemplate = new Model.ProjectSupervision_CheckTemplate
{
ID = this.CheckTemplateID,
SortIndex = Funs.GetNewInt( this.txtSortIndex.Text),
CheckItem = this.txtCheckItem.Text.Trim(),
CheckStandard = this.txtCheckStandard.Text.Trim(),
CheckMethod = this.txtCheckMethod.Text.Trim(),
BaseScore = Funs.GetNewDecimal(this.txtBaseScore.Text.Trim()),
Indexs = Funs.GetNewInt(this.txtIndexs.Text),
};
if (string.IsNullOrEmpty(this.CheckTemplateID))
{
newCheckTemplate.ID = SQLHelper.GetNewID();
BLL.CheckTemplateService.AddCheckTemplate(newCheckTemplate);
}
else
{
newCheckTemplate.ID = this.CheckTemplateID;
BLL.CheckTemplateService.UpdateCheckTemplate(newCheckTemplate);
}
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CheckTemplateMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
#endregion
}
}
@@ -0,0 +1,143 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo
{
public partial class CheckTemplateEdit
{
/// <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>
/// txtIndexs 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtIndexs;
/// <summary>
/// txtSortIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtSortIndex;
/// <summary>
/// txtCheckItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCheckItem;
/// <summary>
/// txtCheckStandard 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtCheckStandard;
/// <summary>
/// txtCheckMethod 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtCheckMethod;
/// <summary>
/// txtBaseScore 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtBaseScore;
/// <summary>
/// lb 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lb;
/// <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;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}
@@ -19,7 +19,8 @@
runat="server" BoxFlex="1" DataKeyNames="ProjectId" DataIDField="ProjectId" AllowSorting="true"
SortField="ProjectName" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true"
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
EnableSummary="true" SummaryPosition="Bottom">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
@@ -31,8 +32,8 @@
</f:DatePicker>
<f:RadioButtonList runat="server" ID="rbType" Width="200px" Label="级别" LabelWidth="50px"
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
<f:RadioItem Text="重大" Value="0" Selected="true" />
<f:RadioItem Text="一般" Value="1" />
<f:RadioItem Text="重大" Value="0" />
<f:RadioItem Text="一般" Value="1" Selected="true" />
</f:RadioButtonList>
<f:Label ID="Label3" runat="server" Text="至">
</f:Label>
@@ -1,4 +1,5 @@
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -62,7 +63,33 @@ namespace FineUIPro.Web.DataShow
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
Grid1.DataBind();
this.OutputSummaryData(); ///取合计值
}
public static int allCount = 0, okCount = 0, unCount = 0;
/// <summary>
/// 计算合计
/// </summary>
private void OutputSummaryData()
{
string rate = "0%";
unCount = allCount - okCount;
if (allCount > 0)
{
rate = Math.Round(okCount * 1.0 / allCount * 100, 1).ToString() + "%";
}
JObject summary = new JObject
{
{ "ProjectName", "合计" },
{ "Count1", allCount.ToString() },
{ "Count2", okCount.ToString() },
{ "Count3", unCount.ToString() },
{ "Count4", rate}
};
Grid1.SummaryData = summary;
}
#endregion
@@ -166,7 +193,7 @@ namespace FineUIPro.Web.DataShow
{
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States != "4");
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.States != "4");
if (datetime1.HasValue)
{
getT = getT.Where(x => x.RegisterDate >= datetime1);
@@ -183,7 +210,13 @@ namespace FineUIPro.Web.DataShow
{
getT = getT.Where(x => x.HazardValue != "3");
}
cout1 = getT.Count();
allCount = getT.Count();
if (allCount > 0)
{
getT = getT.Where(x => x.ProjectId == projectId.ToString());
cout1 = getT.Count();
}
}
return cout1;
}
@@ -195,7 +228,7 @@ namespace FineUIPro.Web.DataShow
{
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.ProjectId == projectId.ToString() && x.States == "3");
var getT = Funs.DB.HSSE_Hazard_HazardRegister.Where(x => x.States == "3");
if (datetime1.HasValue)
{
getT = getT.Where(x => x.RegisterDate >= datetime1);
@@ -212,7 +245,14 @@ namespace FineUIPro.Web.DataShow
{
getT = getT.Where(x => x.HazardValue != "3");
}
cout1 = getT.Count();
okCount = getT.Count();
if (okCount > 0)
{
getT = getT.Where(x => x.ProjectId == projectId.ToString());
cout1 = getT.Count();
}
}
return cout1;
}
@@ -19,7 +19,8 @@
runat="server" BoxFlex="1" DataKeyNames="ProjectId" DataIDField="ProjectId" AllowSorting="true"
SortField="ProjectName" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true"
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
EnableSummary="true" SummaryPosition="Bottom">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
@@ -1,13 +1,10 @@
using Aspose.Words;
using BLL;
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.ServiceModel.Configuration;
using System.Text;
namespace FineUIPro.Web.DataShow
{
@@ -28,9 +25,9 @@ namespace FineUIPro.Web.DataShow
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
BLL.ProjectService.InitProjectDropDownList(this.drpProject, true);
LargerHazard = (from x in Funs.DB.Solution_LargerHazard
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x).ToList();
join y in Funs.DB.Base_Project on x.ProjectId equals y.ProjectId
where y.ProjectState == Const.ProjectState_1
select x).ToList();
// 绑定表格t
BindGrid();
}
@@ -58,6 +55,28 @@ namespace FineUIPro.Web.DataShow
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
this.OutputSummaryData(); ///取合计值
}
public static int allCount1 = 0, allCount2 = 0, allCount3 = 0, allCount4 = 0, allCount5 = 0, allCount6 = 0;
/// <summary>
/// 计算合计
/// </summary>
private void OutputSummaryData()
{
JObject summary = new JObject
{
{ "ProjectName", "合计" },
{ "Count1", allCount1.ToString() },
{ "Count2", allCount2.ToString() },
{ "Count3", allCount3.ToString() },
{ "Count4", allCount4.ToString() },
{ "Count5", allCount5.ToString() },
{ "Count6", allCount6.ToString() }
};
Grid1.SummaryData = summary;
}
#endregion
@@ -162,9 +181,10 @@ namespace FineUIPro.Web.DataShow
protected int Count1(object projectId)
{
int cout1 = 0;
allCount1= LargerHazard.Where(x => x.IsSuperLargerHazard == false || !x.IsSuperLargerHazard.HasValue ).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.IsSuperLargerHazard == false).Count();
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && (x.IsSuperLargerHazard == false || !x.IsSuperLargerHazard.HasValue)).Count();
}
return cout1;
}
@@ -177,6 +197,7 @@ namespace FineUIPro.Web.DataShow
protected int Count2(object projectId)
{
int cout1 = 0;
allCount2 = LargerHazard.Where(x => x.IsSuperLargerHazard == true).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.IsSuperLargerHazard == true).Count();
@@ -191,6 +212,7 @@ namespace FineUIPro.Web.DataShow
protected int Count3(object projectId)
{
int cout1 = 0;
allCount3 = LargerHazard.Where(x => x.States == Const.State_2).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.States == Const.State_2).Count();
@@ -206,6 +228,7 @@ namespace FineUIPro.Web.DataShow
protected int Count4(object projectId)
{
int cout1 = 0;
allCount4 = LargerHazard.Where(x => x.States == Const.State_1).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.States == Const.State_1).Count();
@@ -222,6 +245,7 @@ namespace FineUIPro.Web.DataShow
protected int Count5(object projectId)
{
int cout1 = 0;
allCount5 = LargerHazard.Sum(x => x.TrainPersonNum ?? 0);
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString()).Sum(x=>x.TrainPersonNum ?? 0);
@@ -237,6 +261,7 @@ namespace FineUIPro.Web.DataShow
protected int Count6(object projectId)
{
int cout1 = 0;
allCount6 = LargerHazard.Where(x => x.States == Const.State_3).Count();
if (projectId != null)
{
cout1 = LargerHazard.Where(x => x.ProjectId == projectId.ToString() && x.States == Const.State_3).Count();
+3 -1
View File
@@ -1,5 +1,7 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Data;
@@ -57,7 +59,7 @@ namespace FineUIPro.Web.DataShow
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
Grid1.DataSource = this.GetPagedDataTable(Grid1, tb);
Grid1.DataBind();
Grid1.DataBind();
}
#endregion
@@ -19,7 +19,8 @@
runat="server" BoxFlex="1" DataKeyNames="ProjectId" DataIDField="ProjectId" AllowSorting="true"
SortField="ProjectName" SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true"
IsDatabasePaging="true" PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
EnableSummary="true" SummaryPosition="Bottom">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
@@ -1,4 +1,5 @@
using BLL;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -63,6 +64,32 @@ namespace FineUIPro.Web.DataShow
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
this.OutputSummaryData(); ///取合计值
}
public static int allCount = 0, okCount = 0, unCount = 0;
/// <summary>
/// 计算合计
/// </summary>
private void OutputSummaryData()
{
string rate = "0%";
unCount = allCount - okCount;
if (allCount > 0)
{
rate = Math.Round(okCount * 1.0 / allCount * 100, 1).ToString() + "%";
}
JObject summary = new JObject
{
{ "ProjectName", "合计" },
{ "Count1", allCount.ToString() },
{ "Count2", okCount.ToString() },
{ "Count3", unCount.ToString() },
{ "Count4", rate}
};
Grid1.SummaryData = summary;
}
#endregion
@@ -167,7 +194,7 @@ namespace FineUIPro.Web.DataShow
{
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
var getT = Funs.DB.Check_CheckControl.Where(x => x.ProjectId == projectId.ToString());
var getT = from x in Funs.DB.Check_CheckControl select x;
if (datetime1.HasValue)
{
getT = getT.Where(x => x.CheckDate >= datetime1);
@@ -177,7 +204,13 @@ namespace FineUIPro.Web.DataShow
getT = getT.Where(x => x.CheckDate <= datetime2);
}
cout1 = getT.Count();
allCount = getT.Count();
if (allCount > 0)
{
getT = getT.Where(x => x.ProjectId == projectId.ToString());
cout1 = getT.Count();
}
}
return cout1;
}
@@ -189,7 +222,7 @@ namespace FineUIPro.Web.DataShow
{
var datetime1 = Funs.GetNewDateTime(this.txtStartTime.Text);
var datetime2 = Funs.GetNewDateTime(this.txtStartTime.Text);
var getT = Funs.DB.Check_CheckControl.Where(x => x.ProjectId == projectId.ToString() && x.State == "7");
var getT = Funs.DB.Check_CheckControl.Where(x => x.State == "7");
if (datetime1.HasValue)
{
getT = getT.Where(x => x.CheckDate >= datetime1);
@@ -199,7 +232,13 @@ namespace FineUIPro.Web.DataShow
getT = getT.Where(x => x.CheckDate <= datetime2);
}
cout1 = getT.Count();
okCount = getT.Count();
if (allCount > 0)
{
getT = getT.Where(x => x.ProjectId == projectId.ToString());
cout1 = getT.Count();
}
}
return cout1;
}
File diff suppressed because it is too large Load Diff
+17 -1
View File
@@ -242,7 +242,9 @@
<Content Include="AttachFile\uploader.aspx" />
<Content Include="AttachFile\webuploader.aspx" />
<Content Include="BaseInfo\AccidentType.aspx" />
<Content Include="BaseInfo\CheckTemplate.aspx" />
<Content Include="BaseInfo\BaseFactory.aspx" />
<Content Include="BaseInfo\CheckTemplateEdit.aspx" />
<Content Include="BaseInfo\BaseFactoryEdit.aspx" />
<Content Include="BaseInfo\Certificate.aspx" />
<Content Include="BaseInfo\CNProfessional.aspx" />
@@ -5824,6 +5826,13 @@
<Compile Include="BaseInfo\AccidentType.aspx.designer.cs">
<DependentUpon>AccidentType.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\CheckTemplate.aspx.cs">
<DependentUpon>CheckTemplate.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BaseInfo\CheckTemplate.aspx.designer.cs">
<DependentUpon>CheckTemplate.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\BaseFactory.aspx.cs">
<DependentUpon>BaseFactory.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -5831,6 +5840,13 @@
<Compile Include="BaseInfo\BaseFactory.aspx.designer.cs">
<DependentUpon>BaseFactory.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\CheckTemplateEdit.aspx.cs">
<DependentUpon>CheckTemplateEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BaseInfo\CheckTemplateEdit.aspx.designer.cs">
<DependentUpon>CheckTemplateEdit.aspx</DependentUpon>
</Compile>
<Compile Include="BaseInfo\BaseFactoryEdit.aspx.cs">
<DependentUpon>BaseFactoryEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@@ -13927,7 +13943,7 @@
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:8392/</IISUrl>
<IISUrl>http://localhost:5423/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
@@ -48,6 +48,7 @@
<TreeNode id="38143A01-D17C-4234-A1A1-D90A3F887438" Text="工作阶段定义" NavigateUrl="BaseInfo/WorkStage.aspx"></TreeNode>
<TreeNode id="4BB6AC40-D4D5-439B-85CC-100E431CF3F1" Text="安全措施类型定义" NavigateUrl="BaseInfo/SafetyMeasures.aspx"></TreeNode>
<TreeNode id="3EC2676A-70EB-400E-BE17-EEBBA0B7E9D7" Text="安全巡检类型定义" NavigateUrl="BaseInfo/HazardRegisterTypes.aspx"></TreeNode>
<TreeNode id="F004D9B0-6E6A-41E0-88F1-2306BB6397C6" Text="本部检查项" NavigateUrl="BaseInfo/CheckTemplate.aspx"></TreeNode>
</TreeNode>
<TreeNode id="85DFE1D3-9E68-46B5-87E5-A525698F2F5F" Text="焊接设置" NavigateUrl=""><TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0013" Text="管道材质定义" NavigateUrl="HJGL/BaseInfo/Material.aspx"></TreeNode>
<TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0011" Text="管道规格定义" NavigateUrl="HJGL/BaseInfo/Control.aspx"></TreeNode>