20260817 积分、扣分
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergySettings.aspx.cs" Inherits="FineUIPro.Web.BaseInfo.EnergySettings" %>
|
||||
|
||||
<!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="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" Title="能源设置" Layout="HBox" ShowHeader="false">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Title="能源设置" ShowHeader="false" EnableCollapse="true" PageSize="10" EnableColumnLines="true"
|
||||
ShowBorder="true" AllowPaging="true" IsDatabasePaging="true" runat="server" Width="750px" ForceFit="true"
|
||||
DataKeyNames="EnergyId" DataIDField="EnergyId" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True">
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center"/>
|
||||
<f:RenderField Width="180px" ColumnID="EnergyName" DataField="EnergyName" FieldType="String"
|
||||
HeaderText="能源名称" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="EnergyUnit" DataField="EnergyUnit" FieldType="String"
|
||||
HeaderText="正常计量上报单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="400px" ColumnID="ReferenceCoefficient" DataField="ReferenceCoefficient" FieldType="String"
|
||||
HeaderText="参考折标准煤系数" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="rowselect" Handler="onGridRowSelect" />
|
||||
<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>
|
||||
<f:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="true" ShowHeader="false"
|
||||
LabelWidth="80px" BodyPadding="5px" Width="350px">
|
||||
<Items>
|
||||
<f:HiddenField ID="hfFormID" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:TextBox ID="txtEnergyName" Label="能源名称" ShowRedStar="true" Required="true" runat="server"
|
||||
LabelAlign="right" AutoPostBack="true" OnTextChanged="TextBox_TextChanged" LabelWidth="150px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtEnergyUnit" Label="正常计量上报单位" ShowRedStar="true" Required="true" runat="server"
|
||||
LabelAlign="right" LabelWidth="150px">
|
||||
</f:TextBox>
|
||||
<f:NumberBox ID="txtReferenceCoefficient" runat="server" Label="参考折标准煤系数" LabelAlign="right" NoNegative="true" DecimalPrecision="4" LabelWidth="150px">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" Icon="Add" ToolTip="新增" EnablePostBack="false" runat="server">
|
||||
<Listeners>
|
||||
<f:Listener Event="click" Handler="onNewButtonClick" />
|
||||
</Listeners>
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Enabled="false" ToolTip="删除" Icon="Delete" ConfirmText="确定删除当前数据?"
|
||||
OnClick="btnDelete_Click" runat="server">
|
||||
</f:Button>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:SimpleForm>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Icon="Pencil" runat="server" Text="编辑" >
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" 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 reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
|
||||
|
||||
var gridClientID = '<%= Grid1.ClientID %>';
|
||||
var btnDeleteClientID = '<%= btnDelete.ClientID %>';
|
||||
var btnSaveClientID = '<%= btnSave.ClientID %>';
|
||||
|
||||
var formClientID = '<%= SimpleForm1.ClientID %>';
|
||||
var hfFormIDClientID = '<%= hfFormID.ClientID %>';
|
||||
var txtEnergyNameClientID = '<%= txtEnergyName.ClientID %>';
|
||||
var txtEnergyUnitClientID = '<%= txtEnergyUnit.ClientID %>';
|
||||
var txtReferenceCoefficientClientID = '<%=txtReferenceCoefficient.ClientID %>';
|
||||
|
||||
function onGridRowSelect(event, rowId) {
|
||||
var grid = F(gridClientID);
|
||||
|
||||
// 启用删除按钮
|
||||
F(btnDeleteClientID).enable();
|
||||
|
||||
// 当前行数据
|
||||
var rowValue = grid.getRowValue(rowId);
|
||||
|
||||
// 使用当前行数据填充表单字段
|
||||
F(hfFormIDClientID).setValue(rowId);
|
||||
F(txtEnergyNameClientID).setValue(rowValue['EnergyName']);
|
||||
F(txtEnergyUnitClientID).setValue(rowValue['EnergyUnit']);
|
||||
F(txtReferenceCoefficientClientID).setValue(rowValue['ReferenceCoefficient']);
|
||||
|
||||
// 更新保存按钮文本
|
||||
// F(btnSaveClientID).setText('保存数据(编辑)');
|
||||
}
|
||||
|
||||
function onNewButtonClick() {
|
||||
// 重置表单字段
|
||||
F(formClientID).reset();
|
||||
F(hfFormIDClientID).reset();
|
||||
// 清空表格选中行
|
||||
F(gridClientID).clearSelections();
|
||||
// 禁用删除按钮
|
||||
F(btnDeleteClientID).disable();
|
||||
|
||||
// 更新保存按钮文本
|
||||
// F(btnSaveClientID).setText('保存数据(新增)');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,274 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
public partial class EnergySettings : PageBase
|
||||
{
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
var q = from x in Funs.DB.Base_Energy orderby x.EnergyName select x;
|
||||
Grid1.RecordCount = q.Count();
|
||||
// 2.获取当前分页数据
|
||||
var table = GetPagedDataTable(Grid1.PageIndex, Grid1.PageSize);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private List<Model.Base_Energy> GetPagedDataTable(int pageIndex, int pageSize)
|
||||
{
|
||||
List<Model.Base_Energy> source = (from x in Funs.DB.Base_Energy orderby x.EnergyName select x).ToList();
|
||||
List<Model.Base_Energy> paged = new List<Model.Base_Energy>();
|
||||
|
||||
int rowbegin = pageIndex * pageSize;
|
||||
int rowend = (pageIndex + 1) * pageSize;
|
||||
if (rowend > source.Count())
|
||||
{
|
||||
rowend = source.Count();
|
||||
}
|
||||
|
||||
for (int i = rowbegin; i < rowend; i++)
|
||||
{
|
||||
paged.Add(source[i]);
|
||||
}
|
||||
|
||||
return paged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 改变索引事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页下拉选择
|
||||
/// <summary>
|
||||
/// 分页下拉选择
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
var getV = BLL.EnergySettingsService.GetEnergyById(hfFormID.Text);
|
||||
if (getV != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getV.EnergyName, getV.EnergyId, BLL.Const.EnergyMenuId, BLL.Const.BtnDelete);
|
||||
BLL.EnergySettingsService.DeleteEnergyById(getV.EnergyId);
|
||||
// 重新绑定表格,并模拟点击[新增按钮]
|
||||
BindGrid();
|
||||
PageContext.RegisterStartupScript("onNewButtonClick();");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var getV = BLL.EnergySettingsService.GetEnergyById(hfFormID.Text);
|
||||
if (getV != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getV.EnergyName, getV.EnergyId, BLL.Const.EnergyMenuId, BLL.Const.BtnDelete);
|
||||
BLL.EnergySettingsService.DeleteEnergyById(rowID);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
PageContext.RegisterStartupScript("onNewButtonClick();");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑数据方法
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
var energy = BLL.EnergySettingsService.GetEnergyById(Id);
|
||||
if (energy != null)
|
||||
{
|
||||
this.txtEnergyName.Text = energy.EnergyName;
|
||||
this.txtEnergyUnit.Text = energy.EnergyUnit;
|
||||
this.txtReferenceCoefficient.Text = energy.ReferenceCoefficient.HasValue ? energy.ReferenceCoefficient.ToString() : "";
|
||||
hfFormID.Text = Id;
|
||||
this.btnDelete.Enabled = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strRowID = hfFormID.Text;
|
||||
Model.Base_Energy energy = new Model.Base_Energy
|
||||
{
|
||||
EnergyName = this.txtEnergyName.Text.Trim(),
|
||||
EnergyUnit = this.txtEnergyUnit.Text.Trim()
|
||||
};
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txtReferenceCoefficient.Text.Trim()))
|
||||
{
|
||||
energy.ReferenceCoefficient = Convert.ToDecimal(txtReferenceCoefficient.Text.Trim());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
ShowNotify("输入的格式错误!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(strRowID))
|
||||
{
|
||||
energy.EnergyId = SQLHelper.GetNewID(typeof(Model.Base_Energy));
|
||||
BLL.EnergySettingsService.AddEnergy(energy);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, energy.EnergyName, energy.EnergyId, BLL.Const.EmergencyMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
energy.EnergyId = strRowID;
|
||||
BLL.EnergySettingsService.UpdateEnergy(energy);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, energy.EnergyName, energy.EnergyId, BLL.Const.EmergencyMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
this.SimpleForm1.Reset();
|
||||
// 重新绑定表格,并点击当前编辑或者新增的行
|
||||
BindGrid();
|
||||
PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, energy.EnergyId));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 验证事故类型名称、编号是否存在
|
||||
/// <summary>
|
||||
/// 验证事故类型名称、编号是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var q = Funs.DB.Base_Energy.FirstOrDefault(x => x.EnergyName == this.txtEnergyName.Text.Trim() && (x.EnergyId != hfFormID.Text || (hfFormID.Text == null && x.EnergyId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
Alert.ShowInTop("输入的能源名称已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EnergyMenuId);
|
||||
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.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
|
||||
|
||||
public partial class EnergySettings
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// 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>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.SimpleForm SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// hfFormID 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hfFormID;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnergyName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEnergyName;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnergyUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEnergyUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtReferenceCoefficient 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtReferenceCoefficient;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
@@ -403,6 +404,34 @@ namespace FineUIPro.Web.Check.HSE
|
||||
Grid1.DataBind();
|
||||
BindGrid();
|
||||
Alert.ShowInTop("删除数据成功!", MessageBoxIcon.Success);
|
||||
|
||||
#region 删除对应的扣分流水
|
||||
var u = BLL.UserService.GetUserByUserId(model.RectificationUserId);
|
||||
if (u != null)
|
||||
{
|
||||
var scoreFlowLog = BLL.ScoreFlowLogService.GetScoreFlowLogByDataSourceId(u.IdentityCard, model.CheckDate.Year, model.CheckId);
|
||||
if (scoreFlowLog != null)
|
||||
{
|
||||
//删除人员记分流水
|
||||
var updateScoreFlowLogList = BLL.ScoreFlowLogService.GetScoreFlowLogByCompileDate(scoreFlowLog.IdentityCard, scoreFlowLog.Year, scoreFlowLog.CompileDate);
|
||||
foreach (var item in updateScoreFlowLogList)
|
||||
{
|
||||
item.CurrentScore = item.CurrentScore + (-scoreFlowLog.Score);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
BLL.ScoreFlowLogService.DeleteScoreFlowLogByDataSourceId(scoreFlowLog.IdentityCard, scoreFlowLog.Year, scoreFlowLog.DataSourceId);
|
||||
|
||||
//删除人员记分情况
|
||||
var updateScoreUserList = BLL.ScoreUserService.GetScoreUserByCompileDate(scoreFlowLog.IdentityCard, scoreFlowLog.Year, scoreFlowLog.CompileDate);
|
||||
foreach (var item in updateScoreUserList)
|
||||
{
|
||||
item.Score = item.Score + (-scoreFlowLog.Score);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
BLL.ScoreUserService.DeleteScoreUserByDataSourceId(scoreFlowLog.IdentityCard, scoreFlowLog.Year, scoreFlowLog.DataSourceId);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BLL;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.Check.HSE
|
||||
@@ -55,21 +56,34 @@ namespace FineUIPro.Web.Check.HSE
|
||||
if (model != null)
|
||||
{
|
||||
this.drpUnit.SelectedValue = model.UnitId;
|
||||
this.drpRectificationUser.Items.Clear();
|
||||
BLL.UserService.InitUserUnitIdDropDownList(this.drpRectificationUser, this.drpUnit.SelectedValue, true);
|
||||
this.drpPMUser.Items.Clear();
|
||||
BLL.UserService.InitUserUnitIdDropDownList(this.drpPMUser, this.drpUnit.SelectedValue, true);
|
||||
|
||||
BLL.ProjectService.InitProjectDropDownList(this.drpProject, model.UnitId, true);
|
||||
if (!string.IsNullOrWhiteSpace(model.ProjectId))
|
||||
{
|
||||
this.drpProject.SelectedValue = model.ProjectId;
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(model.ProjectName))
|
||||
if (!string.IsNullOrWhiteSpace(model.ProjectName))
|
||||
{
|
||||
this.drpProject.Text = model.ProjectName;
|
||||
}
|
||||
var pro = BLL.ProjectService.GetProjectByProjectId(model.ProjectId);
|
||||
if (pro != null)
|
||||
{
|
||||
this.txtAddress.Text = pro.ProjectAddress;
|
||||
this.drpPMUser.Items.Clear();
|
||||
BLL.UserService.InitUserDropDownList(this.drpPMUser, model.ProjectId, true);
|
||||
}
|
||||
|
||||
this.drpClassify.SelectedValue = model.ClassifyId;
|
||||
BLL.SafetyProblemClassifyItemService.InitClassifyItemDownList(this.drpClassifyItem, model.ClassifyId, true);
|
||||
if (!string.IsNullOrWhiteSpace(model.ClassifyItemId))
|
||||
{
|
||||
this.drpClassifyItem.SelectedValue = model.ClassifyItemId;
|
||||
}
|
||||
}
|
||||
this.drpNature.SelectedValue = model.NatureId;
|
||||
BLL.SafetyProblemNatureItemService.InitNatureItemDownList(this.drpNatureItem, model.NatureId, true);
|
||||
if (!string.IsNullOrWhiteSpace(model.NatureItemId))
|
||||
@@ -311,6 +325,7 @@ namespace FineUIPro.Web.Check.HSE
|
||||
/// </summary>
|
||||
protected void SaveData()
|
||||
{
|
||||
string saveType = string.Empty;//1-新增,2-修改
|
||||
CheckProblem_Safety model = new CheckProblem_Safety();
|
||||
model.UnitId = this.drpUnit.SelectedValue;
|
||||
model.UnitName = this.drpUnit.SelectedText;
|
||||
@@ -359,6 +374,7 @@ namespace FineUIPro.Web.Check.HSE
|
||||
model.Remark = this.txtRemark.Text.Trim();
|
||||
if (string.IsNullOrWhiteSpace(this.CheckId))
|
||||
{
|
||||
saveType = "1";//新增
|
||||
//新增
|
||||
model.CheckId = SQLHelper.GetNewID(typeof(CheckProblem_Safety));
|
||||
this.CheckId = model.CheckId;
|
||||
@@ -369,13 +385,134 @@ namespace FineUIPro.Web.Check.HSE
|
||||
|
||||
////增加一条编码记录
|
||||
//BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.SafetyCheckProblemMenuId, model.ProjectId, null, model.CheckId, model.CheckDate);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
saveType = "2";//修改
|
||||
//更新
|
||||
model.CheckId = this.CheckId;
|
||||
BLL.CheckProblemSafetyService.UpdateCheckProblem(model);
|
||||
}
|
||||
|
||||
#region 扣分记录
|
||||
var user = BLL.UserService.GetUserByUserId(model.RectificationUserId);
|
||||
if (user != null)
|
||||
{
|
||||
int oldS = 0;
|
||||
DateTime comdate = new DateTime();
|
||||
var scoreFlowLog = BLL.ScoreFlowLogService.GetScoreFlowLogByDataSourceId(user.IdentityCard, model.CheckDate.Year, model.CheckId);
|
||||
if (scoreFlowLog != null)
|
||||
{
|
||||
oldS = scoreFlowLog.CurrentScore;
|
||||
comdate = scoreFlowLog.CompileDate;
|
||||
BLL.ScoreFlowLogService.DeleteScoreFlowLogByDataSourceId(user.IdentityCard, model.CheckDate.Year, model.CheckId);
|
||||
}
|
||||
var scoreUser = BLL.ScoreUserService.GetScoreUserByDataSourceId(user.IdentityCard, model.CheckDate.Year, model.CheckId);
|
||||
if (scoreUser != null)
|
||||
{
|
||||
BLL.ScoreUserService.DeleteScoreUserByDataSourceId(user.IdentityCard, model.CheckDate.Year, model.CheckId);
|
||||
}
|
||||
#region 增加积分流水
|
||||
//增加人员记分流水
|
||||
ScoreFlowLog log = new ScoreFlowLog();
|
||||
log.Id = SQLHelper.GetNewID();
|
||||
if (!string.IsNullOrEmpty(txtCheckDate.Text.Trim()))
|
||||
{
|
||||
log.Year = Convert.ToDateTime(txtCheckDate.Text.Trim()).Year;
|
||||
}
|
||||
log.UserId = this.drpRectificationUser.SelectedValue;
|
||||
log.UserName = this.drpRectificationUser.SelectedText;
|
||||
log.IdentityCard = user.IdentityCard;
|
||||
log.UnitId = this.drpUnit.SelectedValue;
|
||||
log.ProjectId = this.drpProject.SelectedValue;
|
||||
log.UnitName = this.drpUnit.SelectedText;
|
||||
log.ProjectName = this.drpProject.SelectedText;
|
||||
log.Item = "安全不符合项";
|
||||
log.LogContent = "隐患问责扣分";
|
||||
log.CheckDate = Convert.ToDateTime(this.txtCheckDate.Text.Trim());
|
||||
if (saveType == "1")
|
||||
{
|
||||
log.CompileDate = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
log.CompileDate = comdate;
|
||||
}
|
||||
log.CompileMan = this.CurrUser.UserName;
|
||||
log.CompileManId = this.CurrUser.UserId;
|
||||
log.DataSourceId = this.CheckId;
|
||||
log.Type = 0;//扣分
|
||||
//特别严重(管控红线)扣成0分,严重(危险作业许可)扣除100分,较大扣除50分,一般扣除20分,轻微扣除2分
|
||||
if (drpNature.SelectedValue == BLL.Const.SafetyNatureIdN1)
|
||||
{
|
||||
var sfl = BLL.ScoreFlowLogService.GetScoreFlowLogByIdentityCard(log.IdentityCard, log.Year, log.CompileDate);
|
||||
if (sfl != null)
|
||||
{
|
||||
log.Score = -sfl.CurrentScore;//上一条记录多少分扣多少分
|
||||
}
|
||||
else
|
||||
{
|
||||
log.Score = -100;
|
||||
}
|
||||
}
|
||||
else if (drpNature.SelectedValue == BLL.Const.SafetyNatureIdN2)
|
||||
{
|
||||
log.Score = -100;
|
||||
}
|
||||
else if (drpNature.SelectedValue == BLL.Const.SafetyNatureIdN3)
|
||||
{
|
||||
log.Score = -50;
|
||||
}
|
||||
else if (drpNature.SelectedValue == BLL.Const.SafetyNatureIdN4)
|
||||
{
|
||||
log.Score = -20;
|
||||
}
|
||||
var cs = BLL.ScoreFlowLogService.GetScoreFlowLogByIdentityCard(log.IdentityCard, log.Year, log.CompileDate);
|
||||
if (cs != null)
|
||||
{
|
||||
log.CurrentScore = cs.CurrentScore + log.Score;//记分后人员得分值
|
||||
}
|
||||
else
|
||||
{
|
||||
log.CurrentScore = 100 + log.Score;
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(log);
|
||||
|
||||
//增加人员记分情况
|
||||
ScoreUser su = new ScoreUser();
|
||||
su.Id = SQLHelper.GetNewID();
|
||||
su.Year = log.Year;
|
||||
su.IdentityCard = log.IdentityCard;
|
||||
su.Score = log.CurrentScore;
|
||||
su.UserName = log.UserName;
|
||||
su.CompileDate = log.CompileDate;
|
||||
su.DataSourceId = this.CheckId;
|
||||
su.CheckDate = log.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(su);
|
||||
#endregion
|
||||
|
||||
var lastFlowLog = BLL.ScoreFlowLogService.GetScoreFlowLogByCompileDate(user.IdentityCard, log.Year, log.CompileDate);
|
||||
if (lastFlowLog.Count > 0)
|
||||
{
|
||||
foreach (var item in lastFlowLog)
|
||||
{
|
||||
item.CurrentScore = item.CurrentScore - (oldS - log.CurrentScore);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
var lastScoreUser = BLL.ScoreUserService.GetScoreUserByCompileDate(user.IdentityCard, su.Year, su.CompileDate);
|
||||
if (lastScoreUser.Count > 0)
|
||||
{
|
||||
foreach (var item in lastScoreUser)
|
||||
{
|
||||
item.Score = item.Score - (oldS - su.Score);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -698,6 +698,82 @@ namespace FineUIPro.Web.Check.HSE
|
||||
{
|
||||
Funs.DB.CheckProblem_Safety.InsertAllOnSubmit(toInsert);
|
||||
Funs.DB.SubmitChanges();
|
||||
|
||||
#region 扣分记录
|
||||
toInsert = toInsert.OrderBy(x => x.CheckDate).ToList();
|
||||
foreach (var item in toInsert)
|
||||
{
|
||||
ScoreFlowLog log = new ScoreFlowLog();
|
||||
log.Id = SQLHelper.GetNewID();
|
||||
log.Year = item.CheckDate.Year;
|
||||
log.UserId = item.RectificationUserId;
|
||||
log.UserName = item.RectificationUserName;
|
||||
var user = BLL.UserService.GetUserByUserId(item.RectificationUserId);
|
||||
if (user != null)
|
||||
{
|
||||
log.IdentityCard = user.IdentityCard;
|
||||
}
|
||||
log.UnitId = item.UnitId;
|
||||
log.ProjectId = item.ProjectId;
|
||||
log.UnitName = item.UnitName;
|
||||
log.ProjectName = item.ProjectName;
|
||||
log.Item = "安全不符合项";
|
||||
log.LogContent = "隐患问责扣分";
|
||||
log.CheckDate = item.CheckDate;
|
||||
log.CompileDate = DateTime.Now;
|
||||
log.CompileMan = this.CurrUser.UserName;
|
||||
log.CompileManId = this.CurrUser.UserId;
|
||||
log.DataSourceId = item.CheckId;
|
||||
log.Type = 0;//扣分
|
||||
//特别严重(管控红线)扣成0分,严重(危险作业许可)扣除100分,较大扣除50分,一般扣除20分,轻微扣除2分
|
||||
if (item.NatureId == BLL.Const.SafetyNatureIdN1)
|
||||
{
|
||||
var sfl = BLL.ScoreFlowLogService.GetScoreFlowLogByIdentityCard(log.IdentityCard, log.Year, log.CompileDate);
|
||||
if (sfl != null)
|
||||
{
|
||||
log.Score = -sfl.CurrentScore;//上一条记录多少分扣多少分
|
||||
}
|
||||
else
|
||||
{
|
||||
log.Score = -100;
|
||||
}
|
||||
}
|
||||
else if (item.NatureId == BLL.Const.SafetyNatureIdN2)
|
||||
{
|
||||
log.Score = -100;
|
||||
}
|
||||
else if (item.NatureId == BLL.Const.SafetyNatureIdN3)
|
||||
{
|
||||
log.Score = -50;
|
||||
}
|
||||
else if (item.NatureId == BLL.Const.SafetyNatureIdN4)
|
||||
{
|
||||
log.Score = -20;
|
||||
}
|
||||
var cs = BLL.ScoreFlowLogService.GetScoreFlowLogByIdentityCard(log.IdentityCard, log.Year, log.CompileDate);
|
||||
if (cs != null)
|
||||
{
|
||||
log.CurrentScore = cs.CurrentScore + log.Score;//记分后人员得分值
|
||||
}
|
||||
else
|
||||
{
|
||||
log.CurrentScore = 100 + log.Score;
|
||||
}
|
||||
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(log);
|
||||
|
||||
ScoreUser su = new ScoreUser();
|
||||
su.Id = SQLHelper.GetNewID();
|
||||
su.Year = log.Year;
|
||||
su.IdentityCard = log.IdentityCard;
|
||||
su.Score = log.CurrentScore;
|
||||
su.UserName = log.UserName;
|
||||
su.CompileDate = log.CompileDate;
|
||||
su.DataSourceId = log.DataSourceId;
|
||||
su.CheckDate = log.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(su);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
ShowNotify($"成功导入 {toInsert.Count} 条记录。", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergyStatistics.aspx.cs" Inherits="FineUIPro.Web.EnergyReport.EnergyStatistics" %>
|
||||
|
||||
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
|
||||
<!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>
|
||||
.f-grid-row-summary .f-grid-cell-text {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
|
||||
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
|
||||
BodyPadding="0px">
|
||||
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="能源统计" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="EnergyStatisticsId"
|
||||
AllowCellEditing="true" ClicksToEdit="2" DataIDField="EnergyStatisticsId" AllowSorting="true"
|
||||
SortField="ReportDate" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableSummary="true" SummaryPosition="Flow"
|
||||
EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpEnergyId" runat="server" Label="能源名称" LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="drpEnergyId_SelectedIndexChanged" Width="300px">
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="120px" ColumnID="EnergyName" DataField="EnergyName" SortField="EnergyName"
|
||||
FieldType="String" HeaderText="能源名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:GroupField ID="gfCurrentMonth" runat="server" HeaderText="本月用量" TextAlign="Center" HeaderTextAlign="Center">
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="EnergyUnit" DataField="EnergyUnit" SortField="EnergyUnit"
|
||||
FieldType="String" HeaderText="正常计量上报单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Consumption" DataField="Consumption" SortField="Consumption"
|
||||
FieldType="String" HeaderText="用量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="Amount" DataField="Amount" SortField="Amount"
|
||||
FieldType="String" HeaderText="消费金额(元)" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="UnitPrice" DataField="UnitPrice" SortField="UnitPrice"
|
||||
FieldType="String" HeaderText="单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:GroupField ID="GroupField1" runat="server" HeaderText="转换吨标计量" TextAlign="Center" HeaderTextAlign="Center">
|
||||
<Columns>
|
||||
<f:RenderField Width="150px" ColumnID="ConversionUnit" DataField="ConversionUnit" SortField="ConversionUnit"
|
||||
FieldType="String" HeaderText="转换单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="ConvertedQuantity" DataField="ConvertedQuantity" SortField="ConvertedQuantity"
|
||||
FieldType="String" HeaderText="用量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:GroupField>
|
||||
<f:RenderField Width="150px" ColumnID="TCE" DataField="TCE" SortField="TCE"
|
||||
FieldType="String" HeaderText="吨标煤" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:GroupField>
|
||||
<f:RenderField Width="100px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="填报日期" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</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="1000px" Height="560px">
|
||||
</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="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,326 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
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;
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
public partial class EnergyStatistics : PageBase
|
||||
{
|
||||
#region 项目id
|
||||
/// <summary>
|
||||
/// 项目id
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BLL.EnergySettingsService.InitEnergyDropDownList(this.drpEnergyId, true);
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
////权限按钮方法
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
this.btnMenuModify.Hidden = true;
|
||||
this.btnMenuDel.Hidden = true;
|
||||
this.Grid1.EnableRowDoubleClickEvent = false;
|
||||
}
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
btnNew.OnClientClick = Window1.GetShowReference("EnergyStatisticsEdit.aspx") + "return false;";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.BindGrid();
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"select s.EnergyStatisticsId,
|
||||
s.ProjectId,
|
||||
s.UnitId,
|
||||
s.ReportDate,
|
||||
s.EnergyId,
|
||||
s.Consumption,
|
||||
s.Amount,
|
||||
s.UnitPrice,
|
||||
s.ConversionUnit,
|
||||
s.ConvertedQuantity,
|
||||
s.TCE,
|
||||
s.CompileMan,
|
||||
s.CompileDate,
|
||||
y.EnergyName,
|
||||
y.EnergyUnit,
|
||||
y.ReferenceCoefficient,
|
||||
p.ProjectName,
|
||||
u.UnitName
|
||||
from EnergyReport_EnergyStatistics s
|
||||
left join Base_Energy y on y.EnergyId = s.EnergyId
|
||||
left join Base_Project p on p.ProjectId = s.ProjectId
|
||||
left join Base_Unit u on u.UnitId= s.UnitId WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
strSql += " AND s.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (!string.IsNullOrEmpty(this.drpEnergyId.SelectedValue) && this.drpEnergyId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND s.EnergyId = @energyId";
|
||||
listStr.Add(new SqlParameter("@energyId", this.drpEnergyId.SelectedValue));
|
||||
}
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
strSql += " AND s.UnitId =@unitId";
|
||||
listStr.Add(new SqlParameter("@unitId", this.CurrUser.UnitId));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
OutputSummaryData(tb);//求和
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算和
|
||||
/// </summary>
|
||||
/// <param name="tb"></param>
|
||||
private void OutputSummaryData(DataTable tb)
|
||||
{
|
||||
//decimal consumption = 0;//用量
|
||||
decimal amount = 0;//消费金额
|
||||
//decimal unitPrice = 0;//单价
|
||||
decimal convertedQuantity = 0; //转换吨标计量
|
||||
decimal tce = 0; //吨标煤
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
//consumption += Convert.ToDecimal(row["Consumption"]);
|
||||
amount += Convert.ToDecimal(row["Amount"]);
|
||||
//unitPrice += Convert.ToDecimal(row["UnitPrice"]);
|
||||
convertedQuantity += Convert.ToDecimal(row["ConvertedQuantity"]);
|
||||
tce += Convert.ToDecimal(row["TCE"]);
|
||||
}
|
||||
|
||||
JObject summary = new JObject();
|
||||
summary.Add("EnergyName", "能源合计");
|
||||
//summary.Add("Consumption", consumption.ToString("F2"));
|
||||
summary.Add("Amount", amount.ToString("F2"));
|
||||
//summary.Add("UnitPrice", unitPrice.ToString("F2"));
|
||||
summary.Add("ConvertedQuantity", convertedQuantity.ToString("G7"));
|
||||
summary.Add("TCE", tce.ToString("G5"));
|
||||
|
||||
Grid1.SummaryData = summary;
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
/// <summary>
|
||||
/// 改变索引事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpEnergyId_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#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()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Request.Params["value"] == "0") ///文件柜时 没有操作权限
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.EnergyStatisticsMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuModify.Hidden = false;
|
||||
this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDel.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuModify_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyStatisticsEdit.aspx?energyStatisticsId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid双击事件
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnMenuModify_Click(null, null);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (!string.IsNullOrEmpty(rowID))
|
||||
{
|
||||
BLL.EnergyStatisticsService.DeleteEnergyStatisticsById(rowID);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rowID, rowID, BLL.Const.EnergyStatisticsMenuId, BLL.Const.BtnDelete);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,215 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
|
||||
|
||||
public partial class EnergyStatistics
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ucTree 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// drpEnergyId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpEnergyId;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
/// <summary>
|
||||
/// gfCurrentMonth 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupField gfCurrentMonth;
|
||||
|
||||
/// <summary>
|
||||
/// GroupField1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.GroupField GroupField1;
|
||||
|
||||
/// <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,69 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergyStatisticsEdit.aspx.cs" Inherits="FineUIPro.Web.EnergyReport.EnergyStatisticsEdit" %>
|
||||
|
||||
<!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>
|
||||
</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:DropDownList ID="drpUnitId" runat="server" Label="单位" LabelAlign="Right" LabelWidth="150px" Required="true" ShowRedStar="true">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker ID="txtReportDate" runat="server" Label="填报日期" LabelAlign="Right" LabelWidth="150px" Required="true" ShowRedStar="true"></f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpEnergyId" runat="server" Label="能源名称" LabelAlign="Right" LabelWidth="150px" Required="true" ShowRedStar="true" AutoPostBack="true" OnSelectedIndexChanged="drpEnergyId_SelectedIndexChanged"></f:DropDownList>
|
||||
<f:TextBox ID="txtEnergyUnit" runat="server" Label="正常计量上报单位" LabelAlign="Right" LabelWidth="150px" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtConsumption" runat="server" Label="用量" LabelAlign="Right" NoNegative="true" DecimalPrecision="2" LabelWidth="150px" AutoPostBack="true" OnTextChanged="txtConsumption_TextChanged"></f:NumberBox>
|
||||
<f:NumberBox ID="txtAmount" runat="server" Label="消费金额(元)" LabelAlign="Right" NoNegative="true" DecimalPrecision="2" LabelWidth="150px" AutoPostBack="true" OnTextChanged="txtAmount_TextChanged"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtUnitPrice" runat="server" Label="单价" LabelAlign="Right" NoNegative="true" DecimalPrecision="2" LabelWidth="150px"></f:NumberBox>
|
||||
<f:Label ID="Label1" runat="server"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow ColumnWidths="30% 20% 50%">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpConversionUnit" runat="server" Label="转换吨标计量" LabelAlign="Right" LabelWidth="150px" Readonly="true">
|
||||
<f:ListItem Value="" Text=""/>
|
||||
<f:ListItem Value="吨" Text="吨" />
|
||||
<f:ListItem Value="立方米" Text="立方米" />
|
||||
<f:ListItem Value="万千瓦时" Text="万千瓦时" />
|
||||
<f:ListItem Value="百万千焦" Text="百万千焦" />
|
||||
</f:DropDownList>
|
||||
<f:NumberBox ID="txtConvertedQuantity" runat="server" NoNegative="true" DecimalPrecision="7" Readonly="true"></f:NumberBox>
|
||||
<f:NumberBox ID="txtTCE" runat="server" Label="吨标煤" LabelAlign="Right" NoNegative="true" DecimalPrecision="5" LabelWidth="150px" Readonly="true"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,313 @@
|
||||
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.EnergyReport
|
||||
{
|
||||
public partial class EnergyStatisticsEdit : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string EnergyStatisticsId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["EnergyStatisticsId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["EnergyStatisticsId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList1(this.drpUnitId, this.CurrUser.LoginProjectId, true);
|
||||
BLL.EnergySettingsService.InitEnergyDropDownList(this.drpEnergyId, true);
|
||||
this.EnergyStatisticsId = Request.Params["energyStatisticsId"];
|
||||
if (!string.IsNullOrEmpty(EnergyStatisticsId))
|
||||
{
|
||||
Model.EnergyReport_EnergyStatistics energyStatistics = BLL.EnergyStatisticsService.GetEnergyStatisticsById(this.EnergyStatisticsId);
|
||||
if (energyStatistics != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(energyStatistics.UnitId))
|
||||
{
|
||||
this.drpUnitId.SelectedValue = energyStatistics.UnitId;
|
||||
}
|
||||
if (energyStatistics.ReportDate != null)
|
||||
{
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", energyStatistics.ReportDate);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(energyStatistics.EnergyId))
|
||||
{
|
||||
this.drpEnergyId.SelectedValue = energyStatistics.EnergyId;
|
||||
var energy = BLL.EnergySettingsService.GetEnergyById(this.drpEnergyId.SelectedValue);
|
||||
if (energy != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(energy.EnergyUnit))
|
||||
{
|
||||
this.txtEnergyUnit.Text = energy.EnergyUnit;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.txtConsumption.Text = energyStatistics.Consumption.HasValue ? energyStatistics.Consumption.ToString() : ""; ;
|
||||
this.txtAmount.Text = energyStatistics.Amount.HasValue ? energyStatistics.Amount.ToString() : "";
|
||||
this.txtUnitPrice.Text = energyStatistics.UnitPrice.HasValue ? energyStatistics.UnitPrice.ToString() : "";
|
||||
if (!string.IsNullOrEmpty(energyStatistics.ConversionUnit))
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = energyStatistics.ConversionUnit;
|
||||
}
|
||||
this.txtConvertedQuantity.Text = energyStatistics.ConvertedQuantity.HasValue ? energyStatistics.ConvertedQuantity.ToString() : "";
|
||||
this.txtTCE.Text = energyStatistics.TCE.HasValue ? energyStatistics.TCE.ToString() : "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtReportDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存按钮
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpUnitId.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpUnitId.SelectedValue))
|
||||
{
|
||||
Alert.ShowInTop("请选择单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (this.drpEnergyId.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpEnergyId.SelectedValue))
|
||||
{
|
||||
Alert.ShowInTop("请选择能源名称!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
this.SaveData();
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存方法
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SaveData()
|
||||
{
|
||||
Model.EnergyReport_EnergyStatistics newData = new Model.EnergyReport_EnergyStatistics();
|
||||
newData.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newData.UnitId = this.drpUnitId.SelectedValue;
|
||||
if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim()))
|
||||
{
|
||||
try
|
||||
{
|
||||
newData.ReportDate = Convert.ToDateTime(this.txtReportDate.Text.Trim());
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
newData.EnergyId = this.drpEnergyId.SelectedValue;
|
||||
newData.Consumption = Funs.GetNewDecimalOrZero(this.txtConsumption.Text.Trim());
|
||||
newData.Amount = Funs.GetNewDecimalOrZero(this.txtAmount.Text.Trim());
|
||||
newData.UnitPrice = Funs.GetNewDecimalOrZero(this.txtUnitPrice.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(this.drpConversionUnit.SelectedValue))
|
||||
{
|
||||
newData.ConversionUnit = this.drpConversionUnit.SelectedValue.Trim();
|
||||
}
|
||||
newData.ConvertedQuantity = Funs.GetNewDecimalOrZero(this.txtConvertedQuantity.Text.Trim());
|
||||
newData.TCE = Funs.GetNewDecimalOrZero(this.txtTCE.Text.Trim());
|
||||
|
||||
if (!string.IsNullOrEmpty(this.EnergyStatisticsId))
|
||||
{
|
||||
newData.EnergyStatisticsId = this.EnergyStatisticsId;
|
||||
BLL.EnergyStatisticsService.UpdateEnergyStatistics(newData);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, this.drpEnergyId.SelectedText, this.EnergyStatisticsId, BLL.Const.EnergyStatisticsMenuId, Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
newData.CompileMan = this.CurrUser.UserId;
|
||||
newData.CompileDate = DateTime.Now;
|
||||
newData.EnergyStatisticsId = SQLHelper.GetNewID();
|
||||
this.EnergyStatisticsId = newData.EnergyStatisticsId;
|
||||
BLL.EnergyStatisticsService.AddEnergyStatistics(newData);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, this.drpEnergyId.SelectedText, this.EnergyStatisticsId, BLL.Const.EnergyStatisticsMenuId, Const.BtnAdd);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 联动事件
|
||||
/// <summary>
|
||||
/// 能源下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpEnergyId_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.txtEnergyUnit.Text = string.Empty;
|
||||
if (this.drpEnergyId.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpEnergyId.SelectedValue))
|
||||
{
|
||||
var energy = BLL.EnergySettingsService.GetEnergyById(this.drpEnergyId.SelectedValue);
|
||||
if (energy != null)
|
||||
{
|
||||
this.txtEnergyUnit.Text = energy.EnergyUnit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单价=消费金额/转换量
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtAmount_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtAmount.Text.Trim()))
|
||||
{
|
||||
decimal a = Funs.GetNewDecimalOrZero(this.txtAmount.Text.Trim());
|
||||
decimal b = Funs.GetNewDecimalOrZero(this.txtConvertedQuantity.Text.Trim());
|
||||
if (b > 0)
|
||||
{
|
||||
txtUnitPrice.Text = (a / b).ToString();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
txtUnitPrice.Text = "0.00";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 转换吨标计量=用量*不同能源不同值
|
||||
/// 吨标煤=转换量*参考折标准煤系数
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtConsumption_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtConsumption.Text.Trim()) && this.drpEnergyId.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpEnergyId.SelectedValue))
|
||||
{
|
||||
decimal c = Funs.GetNewDecimalOrZero(this.txtConsumption.Text.Trim());
|
||||
var energy = BLL.EnergySettingsService.GetEnergyById(this.drpEnergyId.SelectedValue);
|
||||
if (energy != null)
|
||||
{
|
||||
if (energy.EnergyName.Trim() == "电力")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "万千瓦时";
|
||||
this.txtConvertedQuantity.Text = (c / 10000).ToString();
|
||||
this.txtTCE.Text = ((c / 10000) * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "汽油")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = (c * Convert.ToDecimal(0.73) / 1000).ToString();
|
||||
this.txtTCE.Text = ((c * Convert.ToDecimal(0.73) / 1000) * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "柴油")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = (c * Convert.ToDecimal(0.86) / 1000).ToString();
|
||||
this.txtTCE.Text = ((c * Convert.ToDecimal(0.86) / 1000) * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "煤油")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = (c * Convert.ToDecimal(0.82) / 1000).ToString();
|
||||
this.txtTCE.Text = ((c * Convert.ToDecimal(0.82) / 1000) * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "燃料油")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = (c * Convert.ToDecimal(0.91) / 1000).ToString();
|
||||
this.txtTCE.Text = ((c * Convert.ToDecimal(0.91) / 1000) * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "润滑油")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = (c * Convert.ToDecimal(0.8) / 1000).ToString();
|
||||
this.txtTCE.Text = ((c * Convert.ToDecimal(0.8) / 1000) * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "外购热力")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "百万千焦";
|
||||
this.txtConvertedQuantity.Text = (c * Convert.ToDecimal(0.81)).ToString();
|
||||
this.txtTCE.Text = (c * Convert.ToDecimal(0.81) * energy.ReferenceCoefficient / 6).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "煤炭")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = c.ToString();
|
||||
this.txtTCE.Text = (c * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "焦炭")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = c.ToString();
|
||||
this.txtTCE.Text = (c * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "管道煤气")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "立方米";
|
||||
this.txtConvertedQuantity.Text = c.ToString();
|
||||
this.txtTCE.Text = (c * energy.ReferenceCoefficient / 1000).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "天然气(气态)")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "立方米";
|
||||
this.txtConvertedQuantity.Text = c.ToString();
|
||||
this.txtTCE.Text = (c * energy.ReferenceCoefficient / 1000).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "液化天然气(液态)")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = c.ToString();
|
||||
this.txtTCE.Text = (c * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
else if (energy.EnergyName.Trim() == "液化石油气")
|
||||
{
|
||||
this.drpConversionUnit.SelectedValue = "吨";
|
||||
this.txtConvertedQuantity.Text = c.ToString();
|
||||
this.txtTCE.Text = (c * energy.ReferenceCoefficient).ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
|
||||
|
||||
public partial class EnergyStatisticsEdit
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// drpUnitId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// txtReportDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtReportDate;
|
||||
|
||||
/// <summary>
|
||||
/// drpEnergyId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpEnergyId;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnergyUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEnergyUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtConsumption 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtConsumption;
|
||||
|
||||
/// <summary>
|
||||
/// txtAmount 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtAmount;
|
||||
|
||||
/// <summary>
|
||||
/// txtUnitPrice 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtUnitPrice;
|
||||
|
||||
/// <summary>
|
||||
/// Label1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label Label1;
|
||||
|
||||
/// <summary>
|
||||
/// drpConversionUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpConversionUnit;
|
||||
|
||||
/// <summary>
|
||||
/// txtConvertedQuantity 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtConvertedQuantity;
|
||||
|
||||
/// <summary>
|
||||
/// txtTCE 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtTCE;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergyWaterConservation.aspx.cs" Inherits="FineUIPro.Web.EnergyReport.EnergyWaterConservation" %>
|
||||
|
||||
<!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>
|
||||
<style>
|
||||
.f-grid-colheader .f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.f-grid-row-summary .f-grid-cell-text {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
</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"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="节能节水" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="EnergyWaterConservationId" DataIDField="EnergyWaterConservationId" AllowSorting="true" SortField="CompileDate"
|
||||
SortDirection="DESC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true" ForceFit="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True"
|
||||
OnRowCommand="Grid1_RowCommand" EnableSummary="true" SummaryPosition="Flow" >
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpProjectId" runat="server" Label="项目" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="drpProjectId_SelectedIndexChanged" Width="280px"
|
||||
EnableEdit="true" ShowLabel="true" LabelWidth="50px">
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="labNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="150px" ColumnID="ProjectName" DataField="ProjectName"
|
||||
SortField="ProjectName" FieldType="String" HeaderText="项目" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="EnergySavingIndex" DataField="EnergySavingIndex"
|
||||
SortField="EnergySavingIndex" FieldType="String" HeaderText="节能指标(吨标煤)" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="WaterSavingIndex" DataField="WaterSavingIndex"
|
||||
SortField="WaterSavingIndex" FieldType="String" HeaderText="节水指标(吨)" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="EnergySavingSchemes" DataField="EnergySavingSchemes"
|
||||
SortField="EnergySavingSchemes" FieldType="String" HeaderText="节能措施及方案" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="WaterSavingSchemes" DataField="WaterSavingSchemes"
|
||||
SortField="WaterSavingSchemes" FieldType="String" HeaderText="节水措施及方案" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="SelfEvaluation" DataField="SelfEvaluation"
|
||||
SortField="SelfEvaluation" FieldType="String" HeaderText="节能节水自评" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="Summary" DataField="Summary"
|
||||
SortField="Summary" FieldType="String" HeaderText="节能节水总结" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="ActualEnergySaving" DataField="ActualEnergySaving"
|
||||
SortField="ActualEnergySaving" FieldType="String" HeaderText="实际节能(吨标煤)" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="ActualWaterSaving" DataField="ActualWaterSaving"
|
||||
SortField="ActualWaterSaving" FieldType="String" HeaderText="实际节水(吨)" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="EnergySavingCompletionRate" DataField="EnergySavingCompletionRate"
|
||||
SortField="EnergySavingCompletionRate" FieldType="String" HeaderText="节能完成率" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="WaterSavingCompletionRate" DataField="WaterSavingCompletionRate"
|
||||
SortField="WaterSavingCompletionRate" FieldType="String" HeaderText="节水完成率" TextAlign="Left"
|
||||
HeaderTextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="AttachFile" Width="300px" HeaderText="节能节水相关证明资料" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="labAttachFile" runat="server" Text='<%# ConvertAttachUrl(Eval("EnergyWaterConservationId")) %>' ToolTip="下载节能节水相关证明资料"></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</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: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="1000px" Height="560px">
|
||||
</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="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,332 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
public partial class EnergyWaterConservation : PageBase
|
||||
{
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.drpProjectId.Hidden = true;
|
||||
this.Grid1.Columns[1].Hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.ProjectService.InitAllProjectDropDownList(this.drpProjectId, true);
|
||||
this.btnNew.Hidden = true;
|
||||
this.btnImport.Hidden = true;
|
||||
}
|
||||
|
||||
btnNew.OnClientClick = Window1.GetShowReference("EnergyWaterConservationEdit.aspx") + "return false;";
|
||||
btnImport.OnClientClick = Window1.GetShowReference("EnergyWaterConservationIn.aspx") + "return false;";
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
private DataTable tb = null;
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT W.EnergyWaterConservationId,
|
||||
W.ProjectId,
|
||||
W.EnergySavingIndex,
|
||||
W.WaterSavingIndex,
|
||||
W.EnergySavingSchemes,
|
||||
W.WaterSavingSchemes,
|
||||
W.SelfEvaluation,
|
||||
W.Summary,
|
||||
W.SupportingDocuments,
|
||||
W.ActualEnergySaving,
|
||||
W.ActualWaterSaving,
|
||||
ISNULL(CAST(W.EnergySavingCompletionRate AS VARCHAR(50)),'0') + '%' AS EnergySavingCompletionRate,
|
||||
ISNULL(CAST(W.WaterSavingCompletionRate AS VARCHAR(50)),'0') + '%' AS WaterSavingCompletionRate,
|
||||
W.CompileMan,
|
||||
W.CompileDate,
|
||||
W.Remarks,
|
||||
P.ProjectName
|
||||
FROM EnergyReport_EnergyWaterConservation W
|
||||
LEFT JOIN Base_Project P on P.ProjectId = W.ProjectId WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
strSql += " AND W.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.drpProjectId.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpProjectId.SelectedValue))
|
||||
{
|
||||
strSql += " AND W.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.drpProjectId.SelectedValue));
|
||||
}
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
OutputSummaryData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
private void OutputSummaryData()
|
||||
{
|
||||
int EnergySavingIndex = 0;
|
||||
int WaterSavingIndex = 0;
|
||||
int ActualEnergySaving = 0;
|
||||
int ActualWaterSaving = 0;
|
||||
foreach (DataRow row in tb.Rows)
|
||||
{
|
||||
EnergySavingIndex += Convert.ToInt32(row["EnergySavingIndex"]);
|
||||
WaterSavingIndex += Convert.ToInt32(row["WaterSavingIndex"]);
|
||||
ActualEnergySaving += Convert.ToInt32(row["ActualEnergySaving"]);
|
||||
ActualWaterSaving += Convert.ToInt32(row["ActualWaterSaving"]);
|
||||
}
|
||||
JObject summary = new JObject();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
summary.Add("tfNumber", "合计");
|
||||
}
|
||||
else
|
||||
{
|
||||
summary.Add("ProjectName", "合计");
|
||||
}
|
||||
summary.Add("EnergySavingIndex", EnergySavingIndex.ToString());
|
||||
summary.Add("WaterSavingIndex", WaterSavingIndex.ToString());
|
||||
summary.Add("ActualEnergySaving", ActualEnergySaving.ToString());
|
||||
summary.Add("ActualWaterSaving", ActualWaterSaving.ToString());
|
||||
|
||||
if (EnergySavingIndex > 0)
|
||||
{
|
||||
double rate = (double)ActualEnergySaving / EnergySavingIndex * 100;
|
||||
int roundRate = (int)Math.Round(rate);
|
||||
summary.Add("EnergySavingCompletionRate", roundRate + "%");
|
||||
}
|
||||
else
|
||||
{
|
||||
summary.Add("EnergySavingCompletionRate", "0%");
|
||||
}
|
||||
if (WaterSavingIndex > 0)
|
||||
{
|
||||
double rate = (double)ActualWaterSaving / WaterSavingIndex * 100;
|
||||
int roundRate = (int)Math.Round(rate);
|
||||
summary.Add("WaterSavingCompletionRate", roundRate + "%");
|
||||
}
|
||||
else
|
||||
{
|
||||
summary.Add("WaterSavingCompletionRate", "0%");
|
||||
}
|
||||
Grid1.SummaryData = summary;
|
||||
}
|
||||
|
||||
#region 表排序、分页、关闭窗口
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭弹出窗
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid双击事件
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
btnMenuModify_Click(null, null);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
/// <summary>
|
||||
/// 编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuModify_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EnergyWaterConservationEdit.aspx?energyWaterConservationId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 批量删除
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDel_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (!string.IsNullOrEmpty(rowID))
|
||||
{
|
||||
BLL.EnergyWaterConservationService.DeleteEnergyWaterConservationById(rowID);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rowID, rowID, BLL.Const.EnergyWaterConservationMenuId, BLL.Const.BtnDelete);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.EnergyWaterConservationMenuId);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid行点击事件
|
||||
/// <summary>
|
||||
/// Grid行点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 附件显示
|
||||
/// <summary>
|
||||
/// 附件显示
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertAttachUrl(object id)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (id != null)
|
||||
{
|
||||
var report = BLL.EnergyWaterConservationService.GetEnergyWaterConservationById(id.ToString());
|
||||
if (report != null)
|
||||
{
|
||||
Model.AttachFile file = Funs.DB.AttachFile.FirstOrDefault(e => e.ToKeyId == id.ToString());
|
||||
if (file != null && !string.IsNullOrEmpty(file.AttachUrl))
|
||||
{
|
||||
url = BLL.UploadAttachmentService.ShowAttachment("../", file.AttachUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
|
||||
|
||||
public partial class EnergyWaterConservation
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// drpProjectId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpProjectId;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// labNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label labNumber;
|
||||
|
||||
/// <summary>
|
||||
/// labAttachFile 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label labAttachFile;
|
||||
|
||||
/// <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,86 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EnergyWaterConservationEdit.aspx.cs" Inherits="FineUIPro.Web.EnergyReport.EnergyWaterConservationEdit" %>
|
||||
|
||||
<!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>
|
||||
</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:DropDownList ID="drpProjectId" runat="server" Label="项目" LabelAlign="Right" LabelWidth="150px">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtEnergySavingIndex" runat="server" Label="节能指标(吨标煤)" LabelAlign="Right" NoNegative="true" NoDecimal="true" LabelWidth="150px" AutoPostBack="true" OnTextChanged="txtEnergySavingIndex_TextChanged"></f:NumberBox>
|
||||
<f:NumberBox ID="txtWaterSavingIndex" runat="server" Label="节水指标(吨)" LabelAlign="Right" NoNegative="true" NoDecimal="true" LabelWidth="150px" AutoPostBack="true" OnTextChanged="txtWaterSavingIndex_TextChanged"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtEnergySavingSchemes" runat="server" Label="节能措施及方案" LabelAlign="Right" LabelWidth="150px" MaxLength="200" Height="80">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtWaterSavingSchemes" runat="server" Label="节水措施及方案" LabelAlign="Right" LabelWidth="150px" MaxLength="200" Height="80">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtSelfEvaluation" runat="server" Label="节能节水自评" LabelAlign="Right" LabelWidth="150px" MaxLength="200" Height="80">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtSummary" runat="server" Label="节能节水总结" LabelAlign="Right" LabelWidth="150px" MaxLength="200" Height="80">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtActualEnergySaving" runat="server" Label="实际节能(吨标煤)" LabelAlign="Right" NoNegative="true" LabelWidth="150px" AutoPostBack="true" OnTextChanged="txtEnergySavingIndex_TextChanged"></f:NumberBox>
|
||||
<f:NumberBox ID="txtActualWaterSaving" runat="server" Label="实际节水(吨)" LabelAlign="Right" NoNegative="true" LabelWidth="150px" AutoPostBack="true" OnTextChanged="txtWaterSavingIndex_TextChanged"></f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtEnergySavingCompletionRate" runat="server" Label="节能完成率" LabelAlign="Right" LabelWidth="150px" Readonly="true"></f:TextBox>
|
||||
<f:TextBox ID="txtWaterSavingCompletionRate" runat="server" Label="节水完成率" LabelAlign="Right" LabelWidth="150px" Readonly="true"></f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnAttachUrl" Text="相关证明资料" ToolTip="附件上传及查看" Icon="TableCell" runat="server"
|
||||
OnClick="btnAttachUrl_Click" ValidateForms="SimpleForm1">
|
||||
</f:Button>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" 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,227 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
public partial class EnergyWaterConservationEdit : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string EnergyWaterConservationId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["EnergyWaterConservationId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["EnergyWaterConservationId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.drpProjectId.Hidden = true;
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
}
|
||||
else
|
||||
{
|
||||
BLL.ProjectService.InitAllProjectDropDownList(this.drpProjectId, true);
|
||||
}
|
||||
this.EnergyWaterConservationId = Request.Params["energyWaterConservationId"];
|
||||
if (!string.IsNullOrEmpty(EnergyWaterConservationId))
|
||||
{
|
||||
Model.EnergyReport_EnergyWaterConservation energyWaterConservation = BLL.EnergyWaterConservationService.GetEnergyWaterConservationById(this.EnergyWaterConservationId);
|
||||
if (energyWaterConservation != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(energyWaterConservation.ProjectId))
|
||||
{
|
||||
this.drpProjectId.SelectedValue = energyWaterConservation.ProjectId;
|
||||
}
|
||||
txtEnergySavingIndex.Text = energyWaterConservation.EnergySavingIndex.HasValue ? energyWaterConservation.EnergySavingIndex.ToString() : "";
|
||||
txtWaterSavingIndex.Text = energyWaterConservation.WaterSavingIndex.HasValue ? energyWaterConservation.WaterSavingIndex.ToString() : "";
|
||||
txtEnergySavingSchemes.Text = energyWaterConservation.EnergySavingSchemes;
|
||||
txtWaterSavingSchemes.Text = energyWaterConservation.WaterSavingSchemes;
|
||||
txtSelfEvaluation.Text = energyWaterConservation.SelfEvaluation;
|
||||
txtSummary.Text = energyWaterConservation.Summary;
|
||||
txtActualEnergySaving.Text = energyWaterConservation.ActualEnergySaving.HasValue ? energyWaterConservation.ActualEnergySaving.ToString() : "";
|
||||
txtActualWaterSaving.Text = energyWaterConservation.ActualWaterSaving.HasValue ? energyWaterConservation.ActualWaterSaving.ToString() : "";
|
||||
txtEnergySavingCompletionRate.Text = energyWaterConservation.EnergySavingCompletionRate.HasValue ? energyWaterConservation.EnergySavingCompletionRate.ToString() + "%" : "";
|
||||
txtWaterSavingCompletionRate.Text = energyWaterConservation.WaterSavingCompletionRate.HasValue ? energyWaterConservation.WaterSavingCompletionRate.ToString() + "%" : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存按钮
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveData();
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存方法
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SaveData()
|
||||
{
|
||||
Model.EnergyReport_EnergyWaterConservation newData = new Model.EnergyReport_EnergyWaterConservation();
|
||||
newData.ProjectId = this.CurrUser.LoginProjectId;
|
||||
newData.EnergySavingIndex = Funs.GetNewIntOrZero(this.txtEnergySavingIndex.Text.Trim());
|
||||
newData.WaterSavingIndex = Funs.GetNewIntOrZero(this.txtWaterSavingIndex.Text.Trim());
|
||||
newData.EnergySavingSchemes = this.txtEnergySavingSchemes.Text;
|
||||
newData.WaterSavingSchemes = this.txtWaterSavingSchemes.Text;
|
||||
newData.SelfEvaluation = this.txtSelfEvaluation.Text;
|
||||
newData.Summary = this.txtSummary.Text;
|
||||
newData.ActualEnergySaving = Funs.GetNewIntOrZero(this.txtActualEnergySaving.Text.Trim());
|
||||
newData.ActualWaterSaving = Funs.GetNewIntOrZero(this.txtActualWaterSaving.Text.Trim());
|
||||
if (!string.IsNullOrEmpty(this.txtEnergySavingCompletionRate.Text.Trim()))
|
||||
{
|
||||
string ERate = this.txtEnergySavingCompletionRate.Text.TrimEnd('%').Trim();
|
||||
newData.EnergySavingCompletionRate = Funs.GetNewIntOrZero(ERate);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtWaterSavingCompletionRate.Text.Trim()))
|
||||
{
|
||||
string WRate = this.txtWaterSavingCompletionRate.Text.TrimEnd('%').Trim();
|
||||
newData.WaterSavingCompletionRate = Funs.GetNewIntOrZero(WRate);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.EnergyWaterConservationId))
|
||||
{
|
||||
newData.EnergyWaterConservationId = this.EnergyWaterConservationId;
|
||||
BLL.EnergyWaterConservationService.UpdateEnergyWaterConservation(newData);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, this.EnergyWaterConservationId, this.EnergyWaterConservationId, BLL.Const.EnergyWaterConservationMenuId, Const.BtnModify);
|
||||
}
|
||||
else
|
||||
{
|
||||
newData.CompileMan = this.CurrUser.UserId;
|
||||
newData.CompileDate = DateTime.Now;
|
||||
newData.EnergyWaterConservationId = SQLHelper.GetNewID();
|
||||
this.EnergyWaterConservationId = newData.EnergyWaterConservationId;
|
||||
BLL.EnergyWaterConservationService.AddEnergyWaterConservation(newData);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, this.EnergyWaterConservationId, this.EnergyWaterConservationId, BLL.Const.EnergyWaterConservationMenuId, Const.BtnAdd);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 计算比例
|
||||
/// <summary>
|
||||
/// 计算实际节能(吨标煤)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtEnergySavingIndex_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtEnergySavingIndex.Text.Trim()) && !string.IsNullOrEmpty(this.txtActualEnergySaving.Text.Trim()))
|
||||
{
|
||||
int a = Funs.GetNewIntOrZero(this.txtActualEnergySaving.Text.Trim());
|
||||
int b = Funs.GetNewIntOrZero(this.txtEnergySavingIndex.Text.Trim());
|
||||
if (b > 0)
|
||||
{
|
||||
double rate = (double)a / b * 100;
|
||||
int roundRate = (int)Math.Round(rate);
|
||||
this.txtEnergySavingCompletionRate.Text = roundRate + "%";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtEnergySavingCompletionRate.Text = "0%";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtEnergySavingCompletionRate.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算实际节水(吨)
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void txtWaterSavingIndex_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtWaterSavingIndex.Text.Trim()) && !string.IsNullOrEmpty(this.txtActualWaterSaving.Text.Trim()))
|
||||
{
|
||||
int a = Funs.GetNewIntOrZero(this.txtActualWaterSaving.Text.Trim());
|
||||
int b = Funs.GetNewIntOrZero(this.txtWaterSavingIndex.Text.Trim());
|
||||
if (b > 0)
|
||||
{
|
||||
double rate = (double)a / b * 100;
|
||||
int roundRate = (int)Math.Round(rate);
|
||||
this.txtWaterSavingCompletionRate.Text = roundRate + "%";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtWaterSavingCompletionRate.Text = "0%";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtWaterSavingCompletionRate.Text = string.Empty;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 附件上传
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.EnergyWaterConservationId))
|
||||
{
|
||||
SaveData();
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/EnergyWaterConservationAttachUrl&menuId={1}", this.EnergyWaterConservationId, BLL.Const.EnergyWaterConservationMenuId)));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.EnergyReport
|
||||
{
|
||||
|
||||
|
||||
public partial class EnergyWaterConservationEdit
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// drpProjectId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpProjectId;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnergySavingIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtEnergySavingIndex;
|
||||
|
||||
/// <summary>
|
||||
/// txtWaterSavingIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtWaterSavingIndex;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnergySavingSchemes 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtEnergySavingSchemes;
|
||||
|
||||
/// <summary>
|
||||
/// txtWaterSavingSchemes 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtWaterSavingSchemes;
|
||||
|
||||
/// <summary>
|
||||
/// txtSelfEvaluation 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtSelfEvaluation;
|
||||
|
||||
/// <summary>
|
||||
/// txtSummary 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtSummary;
|
||||
|
||||
/// <summary>
|
||||
/// txtActualEnergySaving 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtActualEnergySaving;
|
||||
|
||||
/// <summary>
|
||||
/// txtActualWaterSaving 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtActualWaterSaving;
|
||||
|
||||
/// <summary>
|
||||
/// txtEnergySavingCompletionRate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEnergySavingCompletionRate;
|
||||
|
||||
/// <summary>
|
||||
/// txtWaterSavingCompletionRate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWaterSavingCompletionRate;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
@@ -244,6 +244,7 @@
|
||||
<Content Include="BaseInfo\CNProfessional.aspx" />
|
||||
<Content Include="BaseInfo\CNProfessionalEdit.aspx" />
|
||||
<Content Include="BaseInfo\CNProfessionalView.aspx" />
|
||||
<Content Include="BaseInfo\EnergySettings.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemNature.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemNatureItemSave.aspx" />
|
||||
<Content Include="BaseInfo\QualityProblemNatureSave.aspx" />
|
||||
@@ -338,8 +339,14 @@
|
||||
<Content Include="common\mainMenu_SYHSE.aspx" />
|
||||
<Content Include="common\mainMenu_SYHSEN.aspx" />
|
||||
<Content Include="common\Menu_FiveStarts.xml" />
|
||||
<Content Include="common\Menu_HSSH.xml" />
|
||||
<Content Include="common\Menu_Report.xml" />
|
||||
<Content Include="common\Menu_Staff.xml" />
|
||||
<Content Include="common\Menu_SubPackManage.xml" />
|
||||
<Content Include="common\Menu_SYHSE.xml" />
|
||||
<Content Include="common\Menu_S_CQMS.xml" />
|
||||
<Content Include="common\Menu_S_HSSE.xml" />
|
||||
<Content Include="common\Menu_S_Report.xml" />
|
||||
<Content Include="common\todolist.aspx" />
|
||||
<Content Include="common\Menu_ToDo.xml" />
|
||||
<Content Include="common\todo.aspx" />
|
||||
@@ -659,6 +666,10 @@
|
||||
<Content Include="Door\InOutManHours.aspx" />
|
||||
<Content Include="Door\InOutList.aspx" />
|
||||
<Content Include="Door\InOutRecord.aspx" />
|
||||
<Content Include="EnergyReport\EnergyStatistics.aspx" />
|
||||
<Content Include="EnergyReport\EnergyStatisticsEdit.aspx" />
|
||||
<Content Include="EnergyReport\EnergyWaterConservation.aspx" />
|
||||
<Content Include="EnergyReport\EnergyWaterConservationEdit.aspx" />
|
||||
<Content Include="File\Image\label.png" />
|
||||
<Content Include="File\Image\loc.png" />
|
||||
<Content Include="File\Image\SEDIN_Code.jpg" />
|
||||
@@ -3246,6 +3257,7 @@
|
||||
<Content Include="File\Excel\HJGL_DataOut\设备焊口检测委托单.xlsx" />
|
||||
<Content Include="File\Excel\HJGL_DataOut\设备焊口返修委托单.xlsx" />
|
||||
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
|
||||
<Content Include="Score\ScoreFlowLog.aspx" />
|
||||
<Content Include="Scripts\jquery-2.1.1.js" />
|
||||
<Content Include="Scripts\jquery-2.1.1.min.js" />
|
||||
<Content Include="Scripts\nugetexample.js" />
|
||||
@@ -7781,6 +7793,13 @@
|
||||
<Compile Include="BaseInfo\CNProfessionalView.aspx.designer.cs">
|
||||
<DependentUpon>CNProfessionalView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\EnergySettings.aspx.cs">
|
||||
<DependentUpon>EnergySettings.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\EnergySettings.aspx.designer.cs">
|
||||
<DependentUpon>EnergySettings.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="BaseInfo\QualityProblemNature.aspx.cs">
|
||||
<DependentUpon>QualityProblemNature.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -10380,6 +10399,34 @@
|
||||
<Compile Include="Door\InOutRecord.aspx.designer.cs">
|
||||
<DependentUpon>InOutRecord.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyStatistics.aspx.cs">
|
||||
<DependentUpon>EnergyStatistics.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyStatistics.aspx.designer.cs">
|
||||
<DependentUpon>EnergyStatistics.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyStatisticsEdit.aspx.cs">
|
||||
<DependentUpon>EnergyStatisticsEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyStatisticsEdit.aspx.designer.cs">
|
||||
<DependentUpon>EnergyStatisticsEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyWaterConservation.aspx.cs">
|
||||
<DependentUpon>EnergyWaterConservation.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyWaterConservation.aspx.designer.cs">
|
||||
<DependentUpon>EnergyWaterConservation.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyWaterConservationEdit.aspx.cs">
|
||||
<DependentUpon>EnergyWaterConservationEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="EnergyReport\EnergyWaterConservationEdit.aspx.designer.cs">
|
||||
<DependentUpon>EnergyWaterConservationEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\Components.aspx.cs">
|
||||
<DependentUpon>Components.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -17759,6 +17806,13 @@
|
||||
<DependentUpon>imageUp.ashx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="res\umeditor\net\Uploader.cs" />
|
||||
<Compile Include="Score\ScoreFlowLog.aspx.cs">
|
||||
<DependentUpon>ScoreFlowLog.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Score\ScoreFlowLog.aspx.designer.cs">
|
||||
<DependentUpon>ScoreFlowLog.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ServiceProxy.cs" />
|
||||
<Compile Include="SHIYE\InformationProject\SafetyBriefing.aspx.cs">
|
||||
<DependentUpon>SafetyBriefing.aspx</DependentUpon>
|
||||
@@ -20305,7 +20359,7 @@
|
||||
<WCFMetadata Include="Service References\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v18.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v17.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
namespace FineUIPro.Web
|
||||
{
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using BLL;
|
||||
using FineUIPro.Web.Score;
|
||||
using Model;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data.SqlClient;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
public class Global : System.Web.HttpApplication
|
||||
{
|
||||
@@ -33,11 +39,10 @@
|
||||
ErrLogInfo.WriteLog(string.Empty, ex);
|
||||
//AppDomain.Unload(AppDomain.CurrentDomain);
|
||||
}
|
||||
|
||||
////通用定时器
|
||||
//通用定时器
|
||||
try
|
||||
{
|
||||
ErrLogInfo.WriteLog("通用定时器开启!" );
|
||||
ErrLogInfo.WriteLog("通用定时器开启!");
|
||||
QuartzServices.Init();
|
||||
ErrLogInfo.WriteLog("通用定时器结束!");
|
||||
}
|
||||
@@ -45,6 +50,485 @@
|
||||
{
|
||||
ErrLogInfo.WriteLog("通用定时器!", ex);
|
||||
}
|
||||
// 开启线程
|
||||
System.Threading.Thread LoadServiceData = new System.Threading.Thread(new System.Threading.ThreadStart(EduTrainAddScore));
|
||||
LoadServiceData.Start();
|
||||
}
|
||||
|
||||
private void EduTrainAddScore()
|
||||
{
|
||||
//定义一个定时器,并开启和配置相关属性
|
||||
System.Timers.Timer Wtimer = new System.Timers.Timer();
|
||||
//执行任务的周期 ,60分钟
|
||||
Wtimer.Interval =1000 * 60 * 60; //120000;
|
||||
Wtimer.Enabled = true;
|
||||
Wtimer.Start();
|
||||
Wtimer.Elapsed += new System.Timers.ElapsedEventHandler(Wtimer_Elapsed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 培训考试加分
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
void Wtimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
//考试大于等于80分通过,且没有加过分的记录,加分
|
||||
var testRecordList = (from x in Funs.DB.View_Training_TestRecord where x.TestScores >= 80
|
||||
&& !Funs.DB.ScoreFlowLog.Any(log => log.DataSourceId == x.TestRecordId)
|
||||
orderby x.TestStartTime select x).ToList();
|
||||
foreach (var item in testRecordList)
|
||||
{
|
||||
//查找最新一条积分记录
|
||||
var flowLog = BLL.ScoreFlowLogService.GetScoreFlowLogByIdentityCard(item.IdentityCard, item.TestStartTime.Value.Year, DateTime.Now);
|
||||
|
||||
//作业人员考试加分
|
||||
if (item.WorkPostType == "一般作业岗位" || item.WorkPostType == "特种作业人员")
|
||||
{
|
||||
//必修-岗位基本操作技能:一门专业课20分,最高20分;超过1门课程,多出的学习课程每门2分
|
||||
if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId3)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【岗位基本操作技能】") orderby x.CompileDate descending select x).ToList();
|
||||
//一个课程加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("岗位基本操作技能【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【岗位基本操作技能】";
|
||||
newlog.LogContent = "岗位基本操作技能【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
|
||||
if (scoreFlowLog.Count == 0)
|
||||
{
|
||||
newlog.Score = 20;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 20;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 120;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//必修-通用安全知识:60分,每门10分,最高60分;超过6门课程,多出的学习课程每门2分
|
||||
else if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId1)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【通用安全知识】") orderby x.CompileDate descending select x).ToList();
|
||||
//一个课程加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("通用安全知识【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【通用安全知识】";
|
||||
newlog.LogContent = "通用安全知识【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 6)
|
||||
{
|
||||
newlog.Score = 10;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 110;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//选修加分 每节课2分,加分上线不限制,以年度为节点
|
||||
else
|
||||
{
|
||||
var isExist = (from x in Funs.DB.ScoreFlowLog
|
||||
where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year
|
||||
&& x.Item.Contains(item.CompanyTrainingName)
|
||||
&& x.LogContent.Contains(item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】")
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (isExist == null)
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【" + item.CompanyTrainingName + "】";
|
||||
newlog.LogContent = item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
//管理人员考试加分
|
||||
else if (item.WorkPostType == "一般管理岗位" || item.WorkPostType == "特种管理人员")
|
||||
{
|
||||
//必修-知识方法工具,最少学习5门课程,一门5分;超过5门课程,多出的学习课程每门2分
|
||||
if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId2)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【知识方法工具】") orderby x.CompileDate descending select x).ToList();
|
||||
//一次考试加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("知识方法工具【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【知识方法工具】";
|
||||
newlog.LogContent = "知识方法工具【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 5)
|
||||
{
|
||||
newlog.Score = 5;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 105;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//必修-生产受控管理,最少学习5门课程,一门5分;超过5门课程,多出的学习课程每门2分
|
||||
else if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId4)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【生产受控管理】") orderby x.CompileDate descending select x).ToList();
|
||||
//一次考试加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("生产受控管理【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【生产受控管理】";
|
||||
newlog.LogContent = "生产受控管理【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 5)
|
||||
{
|
||||
newlog.Score = 5;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 105;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
//必修-通用课程:通用安全知识:30分,每门10分,最高30分;超过3门课程,多出的学习课程每门2分
|
||||
else if (item.CompanyTrainingId == BLL.Const.CompanyTrainingId1)
|
||||
{
|
||||
var scoreFlowLog = (from x in Funs.DB.ScoreFlowLog where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year && x.Item.Contains("考试【通用安全知识】") orderby x.CompileDate descending select x).ToList();
|
||||
//一次考试加分一次
|
||||
var isExist = scoreFlowLog.Where(x => x.LogContent.Contains("通用安全知识【" + item.CompanyTrainingItemName + "】")).FirstOrDefault();
|
||||
if (isExist == null)//第一次加分
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【通用安全知识】";
|
||||
newlog.LogContent = "通用安全知识【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
if (scoreFlowLog.Count < 3)
|
||||
{
|
||||
newlog.Score = 10;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 110;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
else //选修加分 每节课2分,加分上线不限制,以年度为节点
|
||||
{
|
||||
var isExist = (from x in Funs.DB.ScoreFlowLog
|
||||
where x.Type == 1 && x.IdentityCard == item.IdentityCard && x.Year == item.TestStartTime.Value.Year
|
||||
&& x.Item.Contains(item.CompanyTrainingName)
|
||||
&& x.LogContent.Contains(item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】")
|
||||
orderby x.CompileDate descending
|
||||
select x).FirstOrDefault();
|
||||
if (isExist == null)
|
||||
{
|
||||
//人员记分流水日志表
|
||||
Model.ScoreFlowLog newlog = new Model.ScoreFlowLog();
|
||||
newlog.Id = SQLHelper.GetNewID();
|
||||
newlog.Year = item.TestStartTime.Value.Year;
|
||||
newlog.IdentityCard = item.IdentityCard;
|
||||
newlog.UserName = item.PersonName;
|
||||
newlog.PersonId = item.TestManId;
|
||||
newlog.UnitId = item.UnitId;
|
||||
newlog.ProjectId = item.ProjectId;
|
||||
newlog.UnitName = item.UnitName;
|
||||
newlog.ProjectName = item.ProjectName;
|
||||
newlog.Type = 1;
|
||||
newlog.Item = "考试【" + item.CompanyTrainingName + "】";
|
||||
newlog.LogContent = item.CompanyTrainingName + "【" + item.CompanyTrainingItemName + "】考试得分" + item.TestScores + "分后,加分";
|
||||
newlog.CompileDate = DateTime.Now;
|
||||
newlog.CompileManId = "";
|
||||
newlog.CompileMan = "";
|
||||
newlog.DataSourceId = item.TestRecordId;
|
||||
newlog.CheckDate = item.TestStartTime;
|
||||
newlog.Score = 2;
|
||||
if (flowLog != null)
|
||||
{
|
||||
newlog.CurrentScore = flowLog.CurrentScore + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
newlog.CurrentScore = 102;
|
||||
}
|
||||
BLL.ScoreFlowLogService.AddScoreFlowLog(newlog);
|
||||
|
||||
//人员记分情况
|
||||
Model.ScoreUser newScoreUser = new ScoreUser();
|
||||
newScoreUser.Id = SQLHelper.GetNewID();
|
||||
newScoreUser.Year = newlog.Year;
|
||||
newScoreUser.IdentityCard = item.IdentityCard;
|
||||
newScoreUser.Score = newlog.CurrentScore;
|
||||
newScoreUser.UserName = newlog.UserName;
|
||||
newScoreUser.CompileDate = newlog.CompileDate;
|
||||
newScoreUser.DataSourceId = newlog.DataSourceId;
|
||||
newScoreUser.CheckDate = newlog.CheckDate;
|
||||
BLL.ScoreUserService.AddScoreUser(newScoreUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void Session_Start(object sender, EventArgs e)
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScoreFlowLog.aspx.cs" Inherits="FineUIPro.Web.Score.ScoreFlowLog" %>
|
||||
|
||||
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
|
||||
<!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="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
|
||||
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
|
||||
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
|
||||
BodyPadding="0px">
|
||||
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
|
||||
</f:ContentPanel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="得分扣分记录流水日志" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="ID"
|
||||
AllowCellEditing="true" ClicksToEdit="2" DataIDField="ID" AllowSorting="true"
|
||||
SortField="CompileDate" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="姓名" ID="txtName" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpType" runat="server" Label="加分/扣分" LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged" Width="200px">
|
||||
<f:ListItem Value="" Text="-请选择-" />
|
||||
<f:ListItem Value="0" Text="扣分" />
|
||||
<f:ListItem Value="1" Text="加分" />
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="100px" ColumnID="CompileDate" DataField="CompileDate" SortField="CompileDate"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="记分时间" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="UserName" DataField="UserName" SortField="UserName"
|
||||
FieldType="String" HeaderText="姓名" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="tfI" HeaderText="身份证号" Width="170px" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbI" runat="server" Text=' <%# Bind("IdentityCard") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="100px" ColumnID="TypeName" DataField="TypeName" SortField="TypeName"
|
||||
FieldType="String" HeaderText="加分/扣分" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="Score" DataField="Score" SortField="Score"
|
||||
FieldType="String" HeaderText="分值" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="CurrentScore" DataField="CurrentScore" SortField="CurrentScore"
|
||||
FieldType="String" HeaderText="最终分值" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="Item" DataField="Item" SortField="Item"
|
||||
FieldType="String" HeaderText="类目" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="LogContent" DataField="LogContent" SortField="LogContent"
|
||||
FieldType="String" HeaderText="记录内容" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="CompileMan" DataField="CompileMan" SortField="CompileMan"
|
||||
FieldType="String" HeaderText="记分人" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%--<f:RenderField Width="150px" ColumnID="Remark" DataField="Remark" SortField="Remark"
|
||||
FieldType="String" HeaderText="备注" ExpandUnusedSpace="true" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>--%>
|
||||
</Columns>
|
||||
<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>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,256 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.Score
|
||||
{
|
||||
public partial class ScoreFlowLog : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
////权限按钮方法
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.BindGrid();
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = "select flowLog.Id, flowLog.Year, flowLog.IdentityCard, flowLog.UserName, flowLog.Type, (case when flowLog.Type=0 then '扣分' else '加分' end) as TypeName,flowLog.Score, flowLog.CurrentScore, flowLog.Item, flowLog.LogContent, flowLog.UserId, flowLog.PersonId, flowLog.UnitId, flowLog.ProjectId, flowLog.UnitName, flowLog.ProjectName, flowLog.Remark, flowLog.CompileDate, flowLog.CompileMan, flowLog.CompileManId from ScoreFlowLog flowLog WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
|
||||
strSql += " AND flowLog.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND flowLog.UserName like @name";
|
||||
listStr.Add(new SqlParameter("@name", "%" + this.txtName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.drpType.SelectedValue))
|
||||
{
|
||||
strSql += " AND flowLog.Type = @type";
|
||||
listStr.Add(new SqlParameter("@type", this.drpType.SelectedValue));
|
||||
}
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
strSql += " AND flowLog.UnitId =@unitId";
|
||||
listStr.Add(new SqlParameter("@unitId", this.CurrUser.UnitId));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 改变索引事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
//if (string.IsNullOrEmpty(this.ProjectId))
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
//if (Request.Params["value"] == "0") ///文件柜时 没有操作权限
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
//var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.TeamGroupMenuId);
|
||||
//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 = 500;
|
||||
this.BindGrid();
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
string html = row.Values[column.ColumnIndex].ToString();
|
||||
if (column.ColumnID == "tfNumber")
|
||||
{
|
||||
html = (row.FindControl("lblNumber") as AspNet.Label).Text;
|
||||
}
|
||||
if (column.ColumnID == "tfI")
|
||||
{
|
||||
html = (row.FindControl("lbI") as AspNet.Label).Text;
|
||||
}
|
||||
//sb.AppendFormat("<td>{0}</td>", html);
|
||||
sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@;width:140px;'>{0}</td>", html);
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.Score
|
||||
{
|
||||
|
||||
|
||||
public partial class ScoreFlowLog
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// panelLeftRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ucTree 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtName;
|
||||
|
||||
/// <summary>
|
||||
/// drpType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpType;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
/// <summary>
|
||||
/// lbI 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbI;
|
||||
|
||||
/// <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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user