修改施工方案和关键事项
This commit is contained in:
@@ -0,0 +1,159 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ActionWorkLedger.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Information.ActionWorkLedger" %>
|
||||
|
||||
<!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-inner {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1" />
|
||||
<f:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server" Margin="5px">
|
||||
<Regions>
|
||||
<f:Region ID="Region2" ShowBorder="false" ShowHeader="false" Position="Center" Layout="VBox"
|
||||
BoxConfigAlign="Stretch" BoxConfigPosition="Left" runat="server" Title="">
|
||||
<Items>
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="true" AutoScroll="true" BodyPadding="10px"
|
||||
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="350px"
|
||||
LabelWidth="70px" Label="单位" EnableEdit="true" ForceSelection="false" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpYear" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="150px"
|
||||
LabelWidth="50px" Label="年度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpQuarter" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="150px"
|
||||
LabelWidth="50px" Label="季度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:Button ID="BtnBulletLeft" ToolTip="前一季度" Icon="BulletLeft" runat="server" EnablePostBack="true"
|
||||
OnClick="BtnBulletLeft_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="BtnBulletRight" ToolTip="后一季度" Icon="BulletRight" runat="server" EnablePostBack="true"
|
||||
OnClick="BulletRight_Click">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSee" ToolTip="查看审批流程" Icon="Find" runat="server" OnClick="btnSee_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Hidden="true" Icon="Add" runat="server" OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnGet" ToolTip="获取" Icon="Add" Hidden="true" runat="server"
|
||||
OnClick="btnGet_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" ToolTip="编辑" Hidden="true" Icon="Pencil" runat="server" OnClick="btnEdit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" ToolTip="删除" Hidden="true" Icon="Delete" ConfirmText="确定删除当前数据?"
|
||||
OnClick="btnDelete_Click" runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="btnAudit1" ToolTip="审核" Icon="Pencil" Hidden="true" runat="server" OnClick="btnAudit1_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnAudit2" ToolTip="审批" Icon="Pencil" Hidden="true" runat="server" OnClick="btnAudit2_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdata" ToolTip="上报" Icon="PageSave" Hidden="true" runat="server" OnClick="btnUpdata_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
<%--<f:Button ID="btnPrint" ToolTip="打印" Icon="Printer" Hidden="true" runat="server"
|
||||
OnClick="btnPrint_Click">
|
||||
</f:Button>--%>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="txtUnitName" runat="server" Hidden="true">
|
||||
</f:Label>
|
||||
<f:Label ID="txtQuarter" runat="server">
|
||||
</f:Label>
|
||||
<f:Label ID="txtCompileDate" runat="server">
|
||||
</f:Label>
|
||||
<f:Label ID="lbHandleMan" runat="server">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="ActionWorkLedgerItemId"
|
||||
AllowCellEditing="true" ClicksToEdit="2" DataIDField="ActionWorkLedgerItemId"
|
||||
AllowSorting="true" SortField="SortIndex" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="false" PageSize="1000" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
AllowFilters="true" OnFilterChange="Grid1_FilterChange" EnableColumnLines="true">
|
||||
<Columns>
|
||||
<f:RenderField Width="55px" ColumnID="SortIndex" DataField="SortIndex" FieldType="String"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Focus" DataField="Focus" FieldType="String"
|
||||
HeaderText="重点工作" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="SpecialTask" DataField="SpecialTask"
|
||||
FieldType="String" HeaderText="专项任务" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="WorkPoints" DataField="WorkPoints"
|
||||
FieldType="String" HeaderText="工作要点" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="350px" ColumnID="FillingRequirements" DataField="FillingRequirements"
|
||||
FieldType="String" HeaderText="填报要求" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="CompletionDeadline" DataField="CompletionDeadline"
|
||||
FieldType="String" HeaderText="完成期限" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="ImplementationStatus" DataField="ImplementationStatus" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderText="落实情况" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Region>
|
||||
</Regions>
|
||||
</f:RegionPanel>
|
||||
<f:Window ID="Window1" Title="编辑安全生产治本攻坚三年行动工作台账" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="1300px" Height="540px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" IconUrl="~/res/images/16/11.png" runat="server" Hidden="true"
|
||||
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window2_Close"
|
||||
Title="导入安全生产治本攻坚三年行动工作台账" CloseAction="HidePostBack" EnableIFrame="true" Height="600px"
|
||||
Width="900px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window3" IconUrl="~/res/images/16/11.png" runat="server" Hidden="true"
|
||||
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true"
|
||||
Title="打印安全生产治本攻坚三年行动工作台账" CloseAction="HidePostBack" EnableIFrame="true" Height="768px"
|
||||
Width="1024px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window4" Title="查看审核信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" IsModal="true" OnClose="Window4_Close"
|
||||
Width="1024px" Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['Focus','SpecialTask'], {
|
||||
depends: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,619 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
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.ZHGL.Information
|
||||
{
|
||||
public partial class ActionWorkLedger : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string ActionWorkLedgerId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ActionWorkLedgerId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ActionWorkLedgerId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
private static List<Model.Information_ActionWorkLedgerItem> ActionWorkLedgerItems = new List<Model.Information_ActionWorkLedgerItem>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarter, ConstValue.Group_0011, false);
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
drpUnit.DataValueField = "UnitId";
|
||||
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
|
||||
drpUnit.DataBind();
|
||||
this.drpUnit.Readonly = true;
|
||||
DateTime showDate = System.DateTime.Now.AddMonths(-3);
|
||||
this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
this.drpYear.SelectedValue = showDate.Year.ToString();
|
||||
GetValue();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 清空文本框
|
||||
private void SetEmpty()
|
||||
{
|
||||
this.SimpleForm1.Title = string.Empty;
|
||||
txtUnitName.Text = string.Empty;
|
||||
txtQuarter.Text = string.Empty;
|
||||
txtCompileDate.Text = string.Empty;
|
||||
this.lbHandleMan.Text = string.Empty;
|
||||
Grid1.DataSource = null;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取记录值
|
||||
private void GetValue()
|
||||
{
|
||||
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
|
||||
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
|
||||
this.ActionWorkLedgerId = string.Empty;
|
||||
Model.View_Information_ActionWorkLedger report = Funs.DB.View_Information_ActionWorkLedger.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarter == quarter && e.YearId == year);
|
||||
if (report != null)
|
||||
{
|
||||
string state = string.Empty;
|
||||
if (report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
state = "(已上报)";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (report.HandleState == BLL.Const.HandleState_1)
|
||||
{
|
||||
state = "(待提交)";
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_2)
|
||||
{
|
||||
state = "(待审核)";
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_3)
|
||||
{
|
||||
state = "(待审批)";
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_4)
|
||||
{
|
||||
state = "(待上报)";
|
||||
}
|
||||
}
|
||||
this.SimpleForm1.Title = "安全生产治本攻坚三年行动工作台账" + state;
|
||||
this.ActionWorkLedgerId = report.ActionWorkLedgerId;
|
||||
txtUnitName.Text = "单位:" + report.UnitName;
|
||||
txtQuarter.Text = "季度:" + report.Quarters;
|
||||
if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
this.lbHandleMan.Hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbHandleMan.Hidden = false;
|
||||
this.lbHandleMan.Text = "下一步办理人:" + report.UserName;
|
||||
}
|
||||
if (report.ReportDate != null)
|
||||
{
|
||||
txtCompileDate.Text = "制表时间:" + string.Format("{0:yyyy-MM-dd}", report.ReportDate);
|
||||
}
|
||||
BindGrid1();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetEmpty();
|
||||
}
|
||||
this.GetButtonPower();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载Grid
|
||||
private void BindGrid1()
|
||||
{
|
||||
string strSql = "select * from dbo.Information_ActionWorkLedgerItem where ActionWorkLedgerId = @ActionWorkLedgerId order by SortIndex";
|
||||
SqlParameter[] parameter = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@ActionWorkLedgerId",this.ActionWorkLedgerId),
|
||||
};
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除、审核、审批、上报按钮事件
|
||||
/// <summary>
|
||||
/// Tree增加按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ActionWorkLedgerAdd.aspx?UnitId={0}&&Year={1}&&Quarter={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarter.SelectedValue, "编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示编辑页面
|
||||
/// </summary>
|
||||
private void ShowEdit()
|
||||
{
|
||||
Model.Information_ActionWorkLedger report = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report == null)
|
||||
{
|
||||
Alert.ShowInTop("所选时间无报表记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ActionWorkLedgerAdd.aspx?ActionWorkLedgerId={0}", report.ActionWorkLedgerId, "编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tree编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审批
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上报
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tree删除按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Information_ActionWorkLedger report = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString() + "-" + report.Quarter.ToString(),
|
||||
report.ActionWorkLedgerId, BLL.Const.ActionWorkLedgerMenuId, BLL.Const.BtnDelete);
|
||||
BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.ActionWorkLedgerId);
|
||||
BLL.ActionWorkLedgerItemService.DeleteActionWorkLedgerItemList(report.ActionWorkLedgerId);
|
||||
BLL.ActionWorkLedgerService.DeleteActionWorkLedgerById(report.ActionWorkLedgerId);
|
||||
|
||||
SetEmpty();
|
||||
//this.btnNew.Hidden = false;
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 过滤、分页、排序、关闭窗口
|
||||
/// <summary>
|
||||
/// 表头过滤
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_FilterChange(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid1();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid1();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid1排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid1();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页列表显示条数下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭Grid1弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
GetValue();
|
||||
}
|
||||
#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.ActionWorkLedgerMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
//this.btnNew.Hidden = false;
|
||||
this.btnGet.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
//if (buttonList.Contains(BLL.Const.BtnPrint))
|
||||
//{
|
||||
// this.btnPrint.Hidden = false;
|
||||
//}
|
||||
int year = Funs.GetNewIntOrZero(this.drpYear.SelectedValue);
|
||||
int quarter = Funs.GetNewIntOrZero(this.drpQuarter.SelectedValue);
|
||||
var report = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(this.drpUnit.SelectedValue, year, quarter);
|
||||
this.btnAudit1.Hidden = true;
|
||||
this.btnAudit2.Hidden = true;
|
||||
this.btnUpdata.Hidden = true;
|
||||
if (report != null)
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
if (report.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入
|
||||
{
|
||||
if (report.HandleState == BLL.Const.HandleState_2)
|
||||
{
|
||||
this.btnAudit1.Hidden = false;
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_3)
|
||||
{
|
||||
this.btnAudit2.Hidden = false;
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_4)
|
||||
{
|
||||
this.btnDelete.Hidden = true;
|
||||
this.btnUpdata.Hidden = false;
|
||||
}
|
||||
}
|
||||
if (report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
this.btnUpdata.Hidden = true;
|
||||
this.btnEdit.Hidden = true;
|
||||
this.btnDelete.Hidden = true;
|
||||
}
|
||||
if (report.HandleMan == this.CurrUser.UserId || report.CompileMan == this.CurrUser.UserName)
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnEdit.Hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.CurrUser.UserId == BLL.Const.sysglyId)
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 单位下拉框联动事件
|
||||
/// <summary>
|
||||
/// 单位下拉框联动事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
GetValue();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取
|
||||
/// <summary>
|
||||
/// 获取按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnGet_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Information_ActionWorkLedger report = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report == null)
|
||||
{
|
||||
var returnValue = getActionWorkLedgerToSUB();
|
||||
if (returnValue.code == 1)
|
||||
{
|
||||
ShowNotify(returnValue.message, MessageBoxIcon.Success);
|
||||
GetValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop(returnValue.message, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("该季度记录已存在,无需获取!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getActionWorkLedgerToSUB()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
string unitId = CommonService.GetThisUnitId();
|
||||
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/getActionWorkLedger?year=" + this.drpYear.SelectedValue + "&quarter=" + this.drpQuarter.SelectedValue;
|
||||
string contenttype = "application/json;charset=unicode";
|
||||
Hashtable newToken = new Hashtable
|
||||
{
|
||||
{ "token", ServerService.GetToken().Token }
|
||||
};
|
||||
|
||||
var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
|
||||
if (!string.IsNullOrEmpty(strJosn))
|
||||
{
|
||||
JObject obj = JObject.Parse(strJosn);
|
||||
responeData.code = Funs.GetNewIntOrZero(obj["code"].ToString());
|
||||
responeData.message = obj["message"].ToString();
|
||||
if (responeData.code == 1)
|
||||
{
|
||||
JArray getData = JArray.Parse(obj["data"].ToString());
|
||||
if (getData.Count() > 0)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
int i = 0;
|
||||
string actionWorkLedgerId = SQLHelper.GetNewID();
|
||||
foreach (var item in getData)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
Model.Information_ActionWorkLedger actionWorkLedger = new Model.Information_ActionWorkLedger();
|
||||
actionWorkLedger.ActionWorkLedgerId = actionWorkLedgerId;
|
||||
actionWorkLedger.UnitId = BLL.CommonService.GetThisUnitId();
|
||||
actionWorkLedger.ReportDate = DateTime.Now;
|
||||
actionWorkLedger.Quarter = Funs.GetNewInt(this.drpQuarter.SelectedValue);
|
||||
actionWorkLedger.YearId = Funs.GetNewInt(this.drpYear.SelectedValue);
|
||||
actionWorkLedger.CompileMan = this.CurrUser.UserName;
|
||||
actionWorkLedger.UpState = BLL.Const.UpState_2;
|
||||
actionWorkLedger.HandleState = BLL.Const.HandleState_1;
|
||||
actionWorkLedger.HandleMan = this.CurrUser.UserId;
|
||||
BLL.ActionWorkLedgerService.AddActionWorkLedger(actionWorkLedger);
|
||||
}
|
||||
Model.Information_ActionWorkLedgerItem newItem = new Model.Information_ActionWorkLedgerItem();
|
||||
newItem.ActionWorkLedgerItemId = SQLHelper.GetNewID();
|
||||
newItem.ActionWorkLedgerId = actionWorkLedgerId;
|
||||
newItem.SortIndex = Funs.GetNewInt(item["SortIndex"].ToString());
|
||||
newItem.Focus = item["Focus"].ToString();
|
||||
newItem.SpecialTask = item["SpecialTask"].ToString();
|
||||
newItem.WorkPoints = item["WorkPoints"].ToString();
|
||||
newItem.FillingRequirements = item["FillingRequirements"].ToString();
|
||||
newItem.CompletionDeadline = item["CompletionDeadline"].ToString();
|
||||
BLL.ActionWorkLedgerItemService.AddActionWorkLedgerItem(newItem);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
responeData.message = "获取成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "集团记录尚未生成!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "获取失败:" + ex.Message;
|
||||
ErrLogInfo.WriteLog("安全生产治本攻坚三年行动工作台账获取!", ex);
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭导入弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
GetValue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭查看审批信息弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window4_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 打印
|
||||
/// <summary>
|
||||
/// 打印
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Model.Information_ActionWorkLedger report = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
//if (report != null)
|
||||
//{
|
||||
// PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.Information_ActionWorkLedgerId, report.ActionWorkLedgerId, "", "打印 - ")));
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 季度向前/向后
|
||||
/// <summary>
|
||||
/// 前一季度
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void BtnBulletLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMonthChange("-");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 后一季度
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void BulletRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMonthChange("+");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 季度加减变化
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SetMonthChange(string type)
|
||||
{
|
||||
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarter.SelectedValue) * 3).ToString());
|
||||
if (nowDate.HasValue)
|
||||
{
|
||||
DateTime showDate = new DateTime();
|
||||
if (type == "+")
|
||||
{
|
||||
showDate = nowDate.Value.AddMonths(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
showDate = nowDate.Value.AddMonths(-3);
|
||||
}
|
||||
|
||||
this.drpYear.SelectedValue = showDate.Year.ToString();
|
||||
this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
///值变化
|
||||
GetValue();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看审批信息
|
||||
/// <summary>
|
||||
/// 查看审批信息
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSee_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Information_ActionWorkLedger report = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.ActionWorkLedgerId, "查看 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("所选月份无记录!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#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;
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,276 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Information {
|
||||
|
||||
|
||||
public partial class ActionWorkLedger {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// RegionPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RegionPanel RegionPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// Region2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Region Region2;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// drpYear 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpYear;
|
||||
|
||||
/// <summary>
|
||||
/// drpQuarter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// BtnBulletLeft 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnBulletLeft;
|
||||
|
||||
/// <summary>
|
||||
/// BtnBulletRight 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnBulletRight;
|
||||
|
||||
/// <summary>
|
||||
/// btnSee 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSee;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnGet 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnGet;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit2;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdata 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnUpdata;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// txtUnitName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtUnitName;
|
||||
|
||||
/// <summary>
|
||||
/// txtQuarter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// lbHandleMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbHandleMan;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// Window3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window3;
|
||||
|
||||
/// <summary>
|
||||
/// Window4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ActionWorkLedgerAdd.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Information.ActionWorkLedgerAdd" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>编辑安全生产治本攻坚三年行动工作台账</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="ddlUnitId" runat="server" Label="单位" Required="True" ShowRedStar="True">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlYearId" runat="server" Label="年度" Required="True" ShowRedStar="True">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlQuarter" runat="server" Label="季度" Required="True" ShowRedStar="True">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="制表时间" ID="dpkCompileDate"
|
||||
Required="True" ShowRedStar="True">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="ActionWorkLedgerItemId" AllowCellEditing="true"
|
||||
ClicksToEdit="1" DataIDField="ActionWorkLedgerItemId" EnableColumnLines="true"
|
||||
OnRowCommand="Grid1_RowCommand" EnableHeaderMenu="false" Width="1200px" Height="360px">
|
||||
<Columns>
|
||||
<f:RenderField Width="55px" ColumnID="SortIndex" DataField="SortIndex" FieldType="String"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Focus" DataField="Focus" FieldType="String"
|
||||
HeaderText="重点工作" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="SpecialTask" DataField="SpecialTask"
|
||||
FieldType="String" HeaderText="专项任务" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="WorkPoints" DataField="WorkPoints"
|
||||
FieldType="String" HeaderText="工作要点" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="350px" ColumnID="FillingRequirements" DataField="FillingRequirements"
|
||||
FieldType="String" HeaderText="填报要求" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="CompletionDeadline" DataField="CompletionDeadline"
|
||||
FieldType="String" HeaderText="完成期限" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="ImplementationStatus" DataField="ImplementationStatus" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderText="落实情况" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:TextArea ID="txtImplementationStatus" Text='<%# Eval("ImplementationStatus")%>' runat="server" AutoGrowHeight="true">
|
||||
</f:TextArea>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="55px" ColumnID="ActionWorkLedgerItemId" DataField="ActionWorkLedgerItemId" FieldType="String"
|
||||
HeaderText="主键" HeaderTextAlign="Center" TextAlign="Center" Hidden="true">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnCopy" Icon="Database" runat="server" ToolTip="复制上季度数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnCopy_Click" Hidden="true" MarginLeft="10px">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Hidden="true"
|
||||
ValidateForms="SimpleForm1" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" Hidden="true" ToolTip="提交"
|
||||
ValidateForms="SimpleForm1" OnClick="btnSubmit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdata" Icon="PageSave" runat="server" Hidden="true" ConfirmText="确定上报?"
|
||||
ToolTip="上报" ValidateForms="SimpleForm1" OnClick="btnUpdata_Click" MarginRight="10px">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" IconUrl="~/res/images/16/11.png" runat="server" Hidden="true"
|
||||
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
|
||||
Title="办理流程" CloseAction="HidePostBack" EnableIFrame="true" Height="520px" Width="800px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['Focus','SpecialTask'], {
|
||||
depends: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,534 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Information
|
||||
{
|
||||
public partial class ActionWorkLedgerAdd : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
public string ActionWorkLedgerId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ActionWorkLedgerId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ActionWorkLedgerId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
private static List<Model.Information_ActionWorkLedgerItem> items = new List<Model.Information_ActionWorkLedgerItem>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
items.Clear();
|
||||
this.ddlUnitId.DataTextField = "UnitName";
|
||||
this.ddlUnitId.DataValueField = "UnitId";
|
||||
this.ddlUnitId.DataSource = BLL.UnitService.GetThisUnitDropDownList();
|
||||
this.ddlUnitId.DataBind();
|
||||
|
||||
this.ddlYearId.DataTextField = "ConstText";
|
||||
ddlYearId.DataValueField = "ConstValue";
|
||||
ddlYearId.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008);
|
||||
ddlYearId.DataBind();
|
||||
|
||||
this.ddlQuarter.DataTextField = "ConstText";
|
||||
ddlQuarter.DataValueField = "ConstValue";
|
||||
ddlQuarter.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0011);
|
||||
ddlQuarter.DataBind();
|
||||
this.ddlUnitId.Readonly = true;
|
||||
string unitId = Request.Params["UnitId"];
|
||||
string year = Request.QueryString["Year"];
|
||||
string quarter = Request.QueryString["Quarter"];
|
||||
this.ActionWorkLedgerId = Request.Params["ActionWorkLedgerId"];
|
||||
if (!string.IsNullOrEmpty(this.ActionWorkLedgerId))
|
||||
{
|
||||
items = BLL.ActionWorkLedgerItemService.GetActionWorkLedgerItemList(this.ActionWorkLedgerId);
|
||||
this.Grid1.DataSource = items;
|
||||
this.Grid1.DataBind();
|
||||
|
||||
var ActionWorkLedger = BLL.ActionWorkLedgerService.GetActionWorkLedgerById(this.ActionWorkLedgerId);
|
||||
if (ActionWorkLedger != null)
|
||||
{
|
||||
this.btnCopy.Hidden = true;
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnSubmit.Hidden = true;
|
||||
if (ActionWorkLedger.HandleState == BLL.Const.HandleState_4)
|
||||
{
|
||||
this.btnUpdata.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ActionWorkLedger.HandleMan == this.CurrUser.UserId)
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
}
|
||||
if (ActionWorkLedger.UpState == BLL.Const.UpState_3) //已上报
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnUpdata.Hidden = true;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ActionWorkLedger.UnitId))
|
||||
{
|
||||
this.ddlUnitId.SelectedValue = ActionWorkLedger.UnitId;
|
||||
}
|
||||
if (ActionWorkLedger.YearId.HasValue)
|
||||
{
|
||||
this.ddlYearId.SelectedValue = ActionWorkLedger.YearId.ToString();
|
||||
}
|
||||
if (ActionWorkLedger.Quarter.HasValue)
|
||||
{
|
||||
this.ddlQuarter.SelectedValue = ActionWorkLedger.Quarter.ToString();
|
||||
}
|
||||
if (ActionWorkLedger.ReportDate != null)
|
||||
{
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ActionWorkLedger.ReportDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//this.btnCopy.Hidden = false;
|
||||
this.ddlUnitId.SelectedValue = unitId;
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.ddlYearId.SelectedValue = year;
|
||||
this.ddlQuarter.SelectedValue = quarter;
|
||||
////获取项目报告集合
|
||||
//List<Model.InformationProject_ActionWorkLedgerItem> projectItems = (from x in Funs.DB.InformationProject_ActionWorkLedger
|
||||
// join y in Funs.DB.InformationProject_ActionWorkLedgerItem
|
||||
// on x.ActionWorkLedgerId equals y.ActionWorkLedgerId
|
||||
// where x.YearId.ToString() == year && x.Quarter.ToString() == quarter && x.States == BLL.Const.State_2
|
||||
// select y).Distinct().ToList();
|
||||
//if (projectItems.Count > 0)
|
||||
//{
|
||||
// int i = 0;
|
||||
// foreach (var projectItem in projectItems)
|
||||
// {
|
||||
// i += 10;
|
||||
// Model.Information_ActionWorkLedgerItem item = new Model.Information_ActionWorkLedgerItem
|
||||
// {
|
||||
// ActionWorkLedgerItemId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedgerItem)),
|
||||
// SortIndex = i
|
||||
// };
|
||||
// Model.Base_Project project = (from x in Funs.DB.Base_Project
|
||||
// join y in Funs.DB.InformationProject_ActionWorkLedger
|
||||
// on x.ProjectId equals y.ProjectId
|
||||
// join z in Funs.DB.InformationProject_ActionWorkLedgerItem
|
||||
// on y.ActionWorkLedgerId equals z.ActionWorkLedgerId
|
||||
// where z.ActionWorkLedgerItemId == projectItem.ActionWorkLedgerItemId
|
||||
// select x).FirstOrDefault();
|
||||
// if (project != null)
|
||||
// {
|
||||
// item.IndustryType = project.ProjectName;
|
||||
// }
|
||||
// item.TotalConductCount = projectItem.TotalConductCount;
|
||||
// item.TotalPeopleCount = projectItem.TotalPeopleCount;
|
||||
// item.TotalInvestment = projectItem.TotalInvestment;
|
||||
// item.HQConductCount = projectItem.HQConductCount;
|
||||
// item.HQPeopleCount = projectItem.HQPeopleCount;
|
||||
// item.HQInvestment = projectItem.HQInvestment;
|
||||
// item.BasicConductCount = projectItem.BasicConductCount;
|
||||
// item.BasicPeopleCount = projectItem.BasicPeopleCount;
|
||||
// item.BasicInvestment = projectItem.BasicInvestment;
|
||||
// item.ComprehensivePractice = projectItem.ComprehensivePractice;
|
||||
// item.CPScene = projectItem.CPScene;
|
||||
// item.CPDesktop = projectItem.CPDesktop;
|
||||
// item.SpecialDrill = projectItem.SpecialDrill;
|
||||
// item.SDScene = projectItem.SDScene;
|
||||
// item.SDDesktop = projectItem.SDDesktop;
|
||||
// items.Add(item);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// for (int i = 0; i < 100; i++)
|
||||
// {
|
||||
// i += 10;
|
||||
// Model.Information_ActionWorkLedgerItem newItem = new Model.Information_ActionWorkLedgerItem
|
||||
// {
|
||||
// ActionWorkLedgerItemId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedgerItem)),
|
||||
// SortIndex = i
|
||||
// };
|
||||
// items.Add(newItem);
|
||||
// }
|
||||
//}
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存、提交、上报
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("add");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上报按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("updata");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("submit");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void Save(string type)
|
||||
{
|
||||
if (this.ddlUnitId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var drill = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdDate(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue), Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue), this.ActionWorkLedgerId);
|
||||
if (drill != null)
|
||||
{
|
||||
ShowNotify("本单位本季度报表已存在,不能重复编制", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var ActionWorkLedger = new Model.Information_ActionWorkLedger();
|
||||
if (this.ddlUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
ActionWorkLedger.UnitId = this.ddlUnitId.SelectedValue;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpkCompileDate.Text.Trim()))
|
||||
{
|
||||
ActionWorkLedger.ReportDate = Convert.ToDateTime(this.dpkCompileDate.Text.Trim());
|
||||
}
|
||||
ActionWorkLedger.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
|
||||
ActionWorkLedger.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
|
||||
if (string.IsNullOrEmpty(this.ActionWorkLedgerId))
|
||||
{
|
||||
this.ActionWorkLedgerId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedger)); ActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId;
|
||||
ActionWorkLedger.CompileMan = this.CurrUser.UserName;
|
||||
ActionWorkLedger.UpState = BLL.Const.UpState_2;
|
||||
ActionWorkLedger.HandleMan = this.CurrUser.UserId;
|
||||
ActionWorkLedger.HandleState = BLL.Const.HandleState_1;
|
||||
BLL.ActionWorkLedgerService.AddActionWorkLedger(ActionWorkLedger);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, ActionWorkLedger.YearId.ToString() + "-" + ActionWorkLedger.Quarter.ToString(),
|
||||
ActionWorkLedger.ActionWorkLedgerId, BLL.Const.ActionWorkLedgerMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Information_ActionWorkLedger oldReport = BLL.ActionWorkLedgerService.GetActionWorkLedgerById(this.ActionWorkLedgerId);
|
||||
if (oldReport != null)
|
||||
{
|
||||
ActionWorkLedger.HandleMan = oldReport.HandleMan;
|
||||
ActionWorkLedger.HandleState = oldReport.HandleState;
|
||||
}
|
||||
ActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId;
|
||||
ActionWorkLedger.UpState = BLL.Const.UpState_2;
|
||||
BLL.ActionWorkLedgerService.UpdateActionWorkLedger(ActionWorkLedger);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, ActionWorkLedger.YearId.ToString() + "-" + ActionWorkLedger.Quarter.ToString(),
|
||||
ActionWorkLedger.ActionWorkLedgerId, BLL.Const.ActionWorkLedgerMenuId, BLL.Const.BtnModify);
|
||||
BLL.ActionWorkLedgerItemService.DeleteActionWorkLedgerItemList(ActionWorkLedger.ActionWorkLedgerId);
|
||||
}
|
||||
GetItems(ActionWorkLedger.ActionWorkLedgerId);
|
||||
foreach (var item in items)
|
||||
{
|
||||
BLL.ActionWorkLedgerItemService.AddActionWorkLedgerItem(item);
|
||||
}
|
||||
if (type == "updata") //保存并上报
|
||||
{
|
||||
if (ActionWorkLedger.UpState == BLL.Const.UpState_2)
|
||||
{
|
||||
string code = CNCECHSSEWebService.UpActionWorkLedger(ActionWorkLedger.ActionWorkLedgerId, this.CurrUser);
|
||||
if (code == "1")
|
||||
{
|
||||
ShowNotify("同步成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (type == "submit")
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=ActionWorkLedger&Id={0}", ActionWorkLedger.ActionWorkLedgerId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取明细值
|
||||
/// </summary>
|
||||
/// <param name="ActionWorkLedgerId"></param>
|
||||
private void GetItems(string ActionWorkLedgerId)
|
||||
{
|
||||
items.Clear();
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
Model.Information_ActionWorkLedgerItem item = new Model.Information_ActionWorkLedgerItem();
|
||||
if (values["ActionWorkLedgerItemId"].ToString() != "")
|
||||
{
|
||||
item.ActionWorkLedgerItemId = values.Value<string>("ActionWorkLedgerItemId");
|
||||
}
|
||||
item.ActionWorkLedgerId = ActionWorkLedgerId;
|
||||
item.SortIndex = Funs.GetNewInt(values.Value<string>("SortIndex"));
|
||||
if (values["Focus"].ToString() != "")
|
||||
{
|
||||
item.Focus = values.Value<string>("Focus");
|
||||
}
|
||||
if (values["SpecialTask"].ToString() != "")
|
||||
{
|
||||
item.SpecialTask = values.Value<string>("SpecialTask");
|
||||
}
|
||||
if (values["WorkPoints"].ToString() != "")
|
||||
{
|
||||
item.WorkPoints = values.Value<string>("WorkPoints");
|
||||
}
|
||||
if (values["FillingRequirements"].ToString() != "")
|
||||
{
|
||||
item.FillingRequirements = values.Value<string>("FillingRequirements");
|
||||
}
|
||||
if (values["CompletionDeadline"].ToString() != "")
|
||||
{
|
||||
item.CompletionDeadline = values.Value<string>("CompletionDeadline");
|
||||
}
|
||||
if (values["ImplementationStatus"].ToString() != "")
|
||||
{
|
||||
item.ImplementationStatus = values.Value<string>("ImplementationStatus");
|
||||
}
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭办理流程窗口
|
||||
/// <summary>
|
||||
/// 关闭办理流程窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
Model.Information_ActionWorkLedger report = BLL.ActionWorkLedgerService.GetActionWorkLedgerById(this.ActionWorkLedgerId);
|
||||
if (report.HandleMan == this.CurrUser.UserId)
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnSubmit.Hidden = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid行事件
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
GetItems(string.Empty);
|
||||
if (e.CommandName == "Add")
|
||||
{
|
||||
Model.Information_ActionWorkLedgerItem oldItem = items.FirstOrDefault(x => x.ActionWorkLedgerItemId == rowID);
|
||||
Model.Information_ActionWorkLedgerItem newItem = new Model.Information_ActionWorkLedgerItem
|
||||
{
|
||||
ActionWorkLedgerItemId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedgerItem))
|
||||
};
|
||||
if (oldItem != null)
|
||||
{
|
||||
newItem.SortIndex = oldItem.SortIndex + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
newItem.SortIndex = 0;
|
||||
}
|
||||
items.Add(newItem);
|
||||
items = items.OrderBy(x => x.SortIndex).ToList();
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
if (e.CommandName == "Delete")
|
||||
{
|
||||
if (Grid1.Rows.Count == 1)
|
||||
{
|
||||
ShowNotify("只有一条数据,无法删除", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.ActionWorkLedgerItemId == rowID)
|
||||
{
|
||||
items.Remove(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#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.ActionWorkLedgerMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnCopy.Hidden = false;
|
||||
}
|
||||
//if (buttonList.Contains(BLL.Const.BtnSaveUp))
|
||||
//{
|
||||
// this.btnUpdata.Hidden = false;
|
||||
|
||||
//}
|
||||
if (buttonList.Contains(BLL.Const.BtnSubmit))
|
||||
{
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 复制上个季度数据
|
||||
/// <summary>
|
||||
/// 复制上个季度的数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
int lastYear = 0, lastQuarter = 0;
|
||||
int year = Convert.ToInt32(this.ddlYearId.SelectedValue);
|
||||
int quarter = Convert.ToInt32(this.ddlQuarter.SelectedValue);
|
||||
if (quarter == 1)
|
||||
{
|
||||
lastYear = year - 1;
|
||||
lastQuarter = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastYear = year;
|
||||
lastQuarter = quarter - 1;
|
||||
}
|
||||
Model.Information_ActionWorkLedger ActionWorkLedger = BLL.ActionWorkLedgerService.GetActionWorkLedgerByUnitIdAndYearAndQuarters(this.ddlUnitId.SelectedValue, lastYear, lastQuarter);
|
||||
if (ActionWorkLedger != null)
|
||||
{
|
||||
Model.Information_ActionWorkLedger newActionWorkLedger = new Model.Information_ActionWorkLedger();
|
||||
this.ActionWorkLedgerId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedger));
|
||||
newActionWorkLedger.ActionWorkLedgerId = this.ActionWorkLedgerId;
|
||||
newActionWorkLedger.UnitId = this.ddlUnitId.SelectedValue;
|
||||
newActionWorkLedger.ReportDate = DateTime.Now;
|
||||
newActionWorkLedger.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
|
||||
newActionWorkLedger.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
|
||||
newActionWorkLedger.CompileMan = this.CurrUser.UserName;
|
||||
newActionWorkLedger.UpState = BLL.Const.UpState_2;
|
||||
newActionWorkLedger.HandleState = BLL.Const.HandleState_1;
|
||||
newActionWorkLedger.HandleMan = this.CurrUser.UserId;
|
||||
BLL.ActionWorkLedgerService.AddActionWorkLedger(newActionWorkLedger);
|
||||
|
||||
items = BLL.ActionWorkLedgerItemService.GetActionWorkLedgerItemList(ActionWorkLedger.ActionWorkLedgerId);
|
||||
if (items.Count > 0)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
Model.Information_ActionWorkLedgerItem newItem = new Model.Information_ActionWorkLedgerItem
|
||||
{
|
||||
ActionWorkLedgerItemId = SQLHelper.GetNewID(typeof(Model.Information_ActionWorkLedgerItem)),
|
||||
ActionWorkLedgerId = this.ActionWorkLedgerId,
|
||||
SortIndex = item.SortIndex
|
||||
};
|
||||
BLL.ActionWorkLedgerItemService.AddActionWorkLedgerItem(newItem);
|
||||
}
|
||||
}
|
||||
GetValues(newActionWorkLedger.ActionWorkLedgerId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
private void GetValues(string ActionWorkLedgerId)
|
||||
{
|
||||
var report = BLL.ActionWorkLedgerService.GetActionWorkLedgerById(ActionWorkLedgerId);
|
||||
if (report != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(report.UnitId))
|
||||
{
|
||||
this.ddlUnitId.SelectedValue = report.UnitId;
|
||||
}
|
||||
if (report.YearId.HasValue)
|
||||
{
|
||||
this.ddlYearId.SelectedValue = report.YearId.ToString();
|
||||
}
|
||||
if (report.Quarter.HasValue)
|
||||
{
|
||||
this.ddlQuarter.SelectedValue = report.Quarter.ToString();
|
||||
}
|
||||
if (report.ReportDate != null)
|
||||
{
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", report.ReportDate);
|
||||
}
|
||||
items = BLL.ActionWorkLedgerItemService.GetActionWorkLedgerItemList(ActionWorkLedgerId);
|
||||
this.Grid1.DataSource = items;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Information {
|
||||
|
||||
|
||||
public partial class ActionWorkLedgerAdd {
|
||||
|
||||
/// <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>
|
||||
/// ddlUnitId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// ddlYearId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlYearId;
|
||||
|
||||
/// <summary>
|
||||
/// ddlQuarter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// dpkCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker dpkCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// txtImplementationStatus 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtImplementationStatus;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnCopy 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCopy;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdata 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnUpdata;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string unitId = BLL.Const.UnitId_CWCEC;
|
||||
string unitId = Const.UnitId_CWCEC;
|
||||
|
||||
string strSql = @"SELECT UserId,UserName,UserCode,role.RoleName"
|
||||
+ @" FROM Sys_User AS users"
|
||||
@@ -205,6 +205,34 @@ namespace FineUIPro.Web.ZHGL.Information
|
||||
//}
|
||||
#endregion
|
||||
|
||||
#region 中央企业安全生产治本攻坚三年行动工作台账
|
||||
if (Type == "ActionWorkLedger")//中央企业安全生产治本攻坚三年行动工作台账
|
||||
{
|
||||
var report = BLL.ActionWorkLedgerService.GetActionWorkLedgerById(Id);
|
||||
if (report != null)
|
||||
{
|
||||
SetFlowData(Const.ActionWorkLedgerMenuId, this.Id, handleMan);
|
||||
report.HandleState = handleStates;
|
||||
report.HandleMan = handleMan;
|
||||
BLL.ActionWorkLedgerService.UpdateActionWorkLedger(report);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 中央企业安全生产管理评价工作调度台账
|
||||
if (Type == "SafetyProductionEvaluation")//中央企业安全生产管理评价工作调度台账
|
||||
{
|
||||
var report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationById(Id);
|
||||
if (report != null)
|
||||
{
|
||||
SetFlowData(Const.SafetyProductionEvaluationMenuId, this.Id, handleMan);
|
||||
report.HandleState = handleStates;
|
||||
report.HandleMan = handleMan;
|
||||
BLL.SafetyProductionEvaluationService.UpdateSafetyProductionEvaluation(report);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProductionEvaluation.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Information.SafetyProductionEvaluation" %>
|
||||
|
||||
<!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-inner {
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1" />
|
||||
<f:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server" Margin="5px">
|
||||
<Regions>
|
||||
<f:Region ID="Region2" ShowBorder="false" ShowHeader="false" Position="Center" Layout="VBox"
|
||||
BoxConfigAlign="Stretch" BoxConfigPosition="Left" runat="server" Title="">
|
||||
<Items>
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="true" AutoScroll="true" BodyPadding="10px"
|
||||
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="350px"
|
||||
LabelWidth="70px" Label="单位" EnableEdit="true" ForceSelection="false" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpYear" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="150px"
|
||||
LabelWidth="50px" Label="年度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpQuarter" AutoPostBack="true" EnableSimulateTree="true" runat="server" Width="150px"
|
||||
LabelWidth="50px" Label="季度" OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:Button ID="BtnBulletLeft" ToolTip="前一季度" Icon="BulletLeft" runat="server" EnablePostBack="true"
|
||||
OnClick="BtnBulletLeft_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="BtnBulletRight" ToolTip="后一季度" Icon="BulletRight" runat="server" EnablePostBack="true"
|
||||
OnClick="BulletRight_Click">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSee" ToolTip="查看审批流程" Icon="Find" runat="server" OnClick="btnSee_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Hidden="true" Icon="Add" runat="server" OnClick="btnNew_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnGet" ToolTip="获取" Icon="Add" Hidden="true" runat="server"
|
||||
OnClick="btnGet_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" ToolTip="编辑" Hidden="true" Icon="Pencil" runat="server" OnClick="btnEdit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" ToolTip="删除" Hidden="true" Icon="Delete" ConfirmText="确定删除当前数据?"
|
||||
OnClick="btnDelete_Click" runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="btnAudit1" ToolTip="审核" Icon="Pencil" Hidden="true" runat="server" OnClick="btnAudit1_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnAudit2" ToolTip="审批" Icon="Pencil" Hidden="true" runat="server" OnClick="btnAudit2_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdata" ToolTip="上报" Icon="PageSave" Hidden="true" runat="server" OnClick="btnUpdata_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
<%--<f:Button ID="btnPrint" ToolTip="打印" Icon="Printer" Hidden="true" runat="server"
|
||||
OnClick="btnPrint_Click">
|
||||
</f:Button>--%>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="txtUnitName" runat="server" Hidden="true">
|
||||
</f:Label>
|
||||
<f:Label ID="txtQuarter" runat="server">
|
||||
</f:Label>
|
||||
<f:Label ID="txtCompileDate" runat="server">
|
||||
</f:Label>
|
||||
<f:Label ID="lbHandleMan" runat="server">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="SafetyProductionEvaluationItemId"
|
||||
AllowCellEditing="true" ClicksToEdit="2" DataIDField="SafetyProductionEvaluationItemId"
|
||||
AllowSorting="true" SortField="SortIndex" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="false" PageSize="1000" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
AllowFilters="true" OnFilterChange="Grid1_FilterChange" EnableColumnLines="true">
|
||||
<Columns>
|
||||
<f:RenderField Width="55px" ColumnID="SortIndex" DataField="SortIndex" FieldType="String"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Type" DataField="Type" FieldType="String"
|
||||
HeaderText="类型" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="EvaluateWork" DataField="EvaluateWork"
|
||||
FieldType="String" HeaderText="评价工作" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="EvaluationContent" DataField="EvaluationContent"
|
||||
FieldType="String" HeaderText="评价内容" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="350px" ColumnID="FillingRequirements" DataField="FillingRequirements"
|
||||
FieldType="String" HeaderText="填报要求" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="CompletionDeadline" DataField="CompletionDeadline"
|
||||
FieldType="String" HeaderText="完成期限" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="ImplementationStatus" DataField="ImplementationStatus" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderText="落实情况" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Region>
|
||||
</Regions>
|
||||
</f:RegionPanel>
|
||||
<f:Window ID="Window1" Title="编辑安全生产管理评价工作调度台账" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="1300px" Height="540px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" IconUrl="~/res/images/16/11.png" runat="server" Hidden="true"
|
||||
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window2_Close"
|
||||
Title="导入安全生产管理评价工作调度台账" CloseAction="HidePostBack" EnableIFrame="true" Height="600px"
|
||||
Width="900px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window3" IconUrl="~/res/images/16/11.png" runat="server" Hidden="true"
|
||||
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true"
|
||||
Title="打印安全生产管理评价工作调度台账" CloseAction="HidePostBack" EnableIFrame="true" Height="768px"
|
||||
Width="1024px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window4" Title="查看审核信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="true" runat="server" IsModal="true" OnClose="Window4_Close"
|
||||
Width="1024px" Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['Type','EvaluateWork','EvaluationContent','FillingRequirements'], {
|
||||
depends: true
|
||||
});
|
||||
|
||||
this.mergeColumns(['FillingRequirements'], {
|
||||
depends: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,619 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
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.ZHGL.Information
|
||||
{
|
||||
public partial class SafetyProductionEvaluation : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string SafetyProductionEvaluationId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["SafetyProductionEvaluationId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["SafetyProductionEvaluationId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
private static List<Model.Information_SafetyProductionEvaluationItem> SafetyProductionEvaluationItems = new List<Model.Information_SafetyProductionEvaluationItem>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpQuarter, ConstValue.Group_0011, false);
|
||||
BLL.ConstValue.InitConstValueDropDownList(this.drpYear, ConstValue.Group_0008, false);
|
||||
this.drpUnit.DataTextField = "UnitName";
|
||||
drpUnit.DataValueField = "UnitId";
|
||||
drpUnit.DataSource = BLL.UnitService.GetThisUnitDropDownList();
|
||||
drpUnit.DataBind();
|
||||
this.drpUnit.Readonly = true;
|
||||
DateTime showDate = System.DateTime.Now.AddMonths(-3);
|
||||
this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
this.drpYear.SelectedValue = showDate.Year.ToString();
|
||||
GetValue();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 清空文本框
|
||||
private void SetEmpty()
|
||||
{
|
||||
this.SimpleForm1.Title = string.Empty;
|
||||
txtUnitName.Text = string.Empty;
|
||||
txtQuarter.Text = string.Empty;
|
||||
txtCompileDate.Text = string.Empty;
|
||||
this.lbHandleMan.Text = string.Empty;
|
||||
Grid1.DataSource = null;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取记录值
|
||||
private void GetValue()
|
||||
{
|
||||
int year = Funs.GetNewIntOrZero(drpYear.SelectedValue);
|
||||
int quarter = Funs.GetNewIntOrZero(drpQuarter.SelectedValue);
|
||||
this.SafetyProductionEvaluationId = string.Empty;
|
||||
Model.View_Information_SafetyProductionEvaluation report = Funs.DB.View_Information_SafetyProductionEvaluation.FirstOrDefault(e => e.UnitId == drpUnit.SelectedValue && e.Quarter == quarter && e.YearId == year);
|
||||
if (report != null)
|
||||
{
|
||||
string state = string.Empty;
|
||||
if (report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
state = "(已上报)";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (report.HandleState == BLL.Const.HandleState_1)
|
||||
{
|
||||
state = "(待提交)";
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_2)
|
||||
{
|
||||
state = "(待审核)";
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_3)
|
||||
{
|
||||
state = "(待审批)";
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_4)
|
||||
{
|
||||
state = "(待上报)";
|
||||
}
|
||||
}
|
||||
this.SimpleForm1.Title = "中央企业安全生产管理评价工作调度台账" + state;
|
||||
this.SafetyProductionEvaluationId = report.SafetyProductionEvaluationId;
|
||||
txtUnitName.Text = "单位:" + report.UnitName;
|
||||
txtQuarter.Text = "季度:" + report.Quarters;
|
||||
if (report.HandleState == BLL.Const.HandleState_1 || report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
this.lbHandleMan.Hidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.lbHandleMan.Hidden = false;
|
||||
this.lbHandleMan.Text = "下一步办理人:" + report.UserName;
|
||||
}
|
||||
if (report.ReportDate != null)
|
||||
{
|
||||
txtCompileDate.Text = "制表时间:" + string.Format("{0:yyyy-MM-dd}", report.ReportDate);
|
||||
}
|
||||
BindGrid1();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetEmpty();
|
||||
}
|
||||
this.GetButtonPower();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载Grid
|
||||
private void BindGrid1()
|
||||
{
|
||||
string strSql = "select * from dbo.Information_SafetyProductionEvaluationItem where SafetyProductionEvaluationId = @SafetyProductionEvaluationId order by SortIndex";
|
||||
SqlParameter[] parameter = new SqlParameter[]
|
||||
{
|
||||
new SqlParameter("@SafetyProductionEvaluationId",this.SafetyProductionEvaluationId),
|
||||
};
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加、修改、删除、审核、审批、上报按钮事件
|
||||
/// <summary>
|
||||
/// Tree增加按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProductionEvaluationAdd.aspx?UnitId={0}&&Year={1}&&Quarter={2}", this.CurrUser.UnitId, this.drpYear.SelectedValue, this.drpQuarter.SelectedValue, "编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示编辑页面
|
||||
/// </summary>
|
||||
private void ShowEdit()
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report == null)
|
||||
{
|
||||
Alert.ShowInTop("所选时间无报表记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyProductionEvaluationAdd.aspx?SafetyProductionEvaluationId={0}", report.SafetyProductionEvaluationId, "编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tree编辑按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审核
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit1_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 审批
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit2_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上报
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
ShowEdit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tree删除按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, report.YearId.ToString() + "-" + report.Quarter.ToString(),
|
||||
report.SafetyProductionEvaluationId, BLL.Const.SafetyProductionEvaluationMenuId, BLL.Const.BtnDelete);
|
||||
BLL.ProjectDataFlowSetService.DeleteFlowSetByDataId(report.SafetyProductionEvaluationId);
|
||||
BLL.SafetyProductionEvaluationItemService.DeleteSafetyProductionEvaluationItemList(report.SafetyProductionEvaluationId);
|
||||
BLL.SafetyProductionEvaluationService.DeleteSafetyProductionEvaluationById(report.SafetyProductionEvaluationId);
|
||||
|
||||
SetEmpty();
|
||||
//this.btnNew.Hidden = false;
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("所选时间无报表记录!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 过滤、分页、排序、关闭窗口
|
||||
/// <summary>
|
||||
/// 表头过滤
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_FilterChange(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid1();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = e.NewPageIndex;
|
||||
BindGrid1();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid1排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
Grid1.SortField = e.SortField;
|
||||
BindGrid1();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页列表显示条数下拉选择事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭Grid1弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
GetValue();
|
||||
}
|
||||
#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.SafetyProductionEvaluationMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
//this.btnNew.Hidden = false;
|
||||
this.btnGet.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
//if (buttonList.Contains(BLL.Const.BtnPrint))
|
||||
//{
|
||||
// this.btnPrint.Hidden = false;
|
||||
//}
|
||||
int year = Funs.GetNewIntOrZero(this.drpYear.SelectedValue);
|
||||
int quarter = Funs.GetNewIntOrZero(this.drpQuarter.SelectedValue);
|
||||
var report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(this.drpUnit.SelectedValue, year, quarter);
|
||||
this.btnAudit1.Hidden = true;
|
||||
this.btnAudit2.Hidden = true;
|
||||
this.btnUpdata.Hidden = true;
|
||||
if (report != null)
|
||||
{
|
||||
this.btnNew.Hidden = true;
|
||||
if (report.HandleMan == this.CurrUser.UserId) //当前人是下一步办理入
|
||||
{
|
||||
if (report.HandleState == BLL.Const.HandleState_2)
|
||||
{
|
||||
this.btnAudit1.Hidden = false;
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_3)
|
||||
{
|
||||
this.btnAudit2.Hidden = false;
|
||||
}
|
||||
else if (report.HandleState == BLL.Const.HandleState_4)
|
||||
{
|
||||
this.btnDelete.Hidden = true;
|
||||
this.btnUpdata.Hidden = false;
|
||||
}
|
||||
}
|
||||
if (report.UpState == BLL.Const.UpState_3)
|
||||
{
|
||||
this.btnUpdata.Hidden = true;
|
||||
this.btnEdit.Hidden = true;
|
||||
this.btnDelete.Hidden = true;
|
||||
}
|
||||
if (report.HandleMan == this.CurrUser.UserId || report.CompileMan == this.CurrUser.UserName)
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnEdit.Hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.CurrUser.UserId == BLL.Const.sysglyId)
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 单位下拉框联动事件
|
||||
/// <summary>
|
||||
/// 单位下拉框联动事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
GetValue();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取
|
||||
/// <summary>
|
||||
/// 获取按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnGet_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report == null)
|
||||
{
|
||||
var returnValue = getSafetyProductionEvaluationToSUB();
|
||||
if (returnValue.code == 1)
|
||||
{
|
||||
ShowNotify(returnValue.message, MessageBoxIcon.Success);
|
||||
GetValue();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop(returnValue.message, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("该季度记录已存在,无需获取!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getSafetyProductionEvaluationToSUB()
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
string unitId = CommonService.GetThisUnitId();
|
||||
string baseurl = SysConstSetService.CNCECPath + "/api/HSSEData/getSafetyProductionEvaluation?year=" + this.drpYear.SelectedValue + "&quarter=" + this.drpQuarter.SelectedValue;
|
||||
string contenttype = "application/json;charset=unicode";
|
||||
Hashtable newToken = new Hashtable
|
||||
{
|
||||
{ "token", ServerService.GetToken().Token }
|
||||
};
|
||||
|
||||
var strJosn = APIGetHttpService.Http(baseurl, "GET", contenttype, newToken, null);
|
||||
if (!string.IsNullOrEmpty(strJosn))
|
||||
{
|
||||
JObject obj = JObject.Parse(strJosn);
|
||||
responeData.code = Funs.GetNewIntOrZero(obj["code"].ToString());
|
||||
responeData.message = obj["message"].ToString();
|
||||
if (responeData.code == 1)
|
||||
{
|
||||
JArray getData = JArray.Parse(obj["data"].ToString());
|
||||
if (getData.Count() > 0)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
int i = 0;
|
||||
string SafetyProductionEvaluationId = SQLHelper.GetNewID();
|
||||
foreach (var item in getData)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation SafetyProductionEvaluation = new Model.Information_SafetyProductionEvaluation();
|
||||
SafetyProductionEvaluation.SafetyProductionEvaluationId = SafetyProductionEvaluationId;
|
||||
SafetyProductionEvaluation.UnitId = BLL.CommonService.GetThisUnitId();
|
||||
SafetyProductionEvaluation.ReportDate = DateTime.Now;
|
||||
SafetyProductionEvaluation.Quarter = Funs.GetNewInt(this.drpQuarter.SelectedValue);
|
||||
SafetyProductionEvaluation.YearId = Funs.GetNewInt(this.drpYear.SelectedValue);
|
||||
SafetyProductionEvaluation.CompileMan = this.CurrUser.UserName;
|
||||
SafetyProductionEvaluation.UpState = BLL.Const.UpState_2;
|
||||
SafetyProductionEvaluation.HandleState = BLL.Const.HandleState_1;
|
||||
SafetyProductionEvaluation.HandleMan = this.CurrUser.UserId;
|
||||
BLL.SafetyProductionEvaluationService.AddSafetyProductionEvaluation(SafetyProductionEvaluation);
|
||||
}
|
||||
Model.Information_SafetyProductionEvaluationItem newItem = new Model.Information_SafetyProductionEvaluationItem();
|
||||
newItem.SafetyProductionEvaluationItemId = SQLHelper.GetNewID();
|
||||
newItem.SafetyProductionEvaluationId = SafetyProductionEvaluationId;
|
||||
newItem.SortIndex = Funs.GetNewInt(item["SortIndex"].ToString());
|
||||
newItem.Type = item["Type"].ToString();
|
||||
newItem.EvaluateWork = item["EvaluateWork"].ToString();
|
||||
newItem.EvaluationContent = item["EvaluationContent"].ToString();
|
||||
newItem.FillingRequirements = item["FillingRequirements"].ToString();
|
||||
newItem.CompletionDeadline = item["CompletionDeadline"].ToString();
|
||||
BLL.SafetyProductionEvaluationItemService.AddSafetyProductionEvaluationItem(newItem);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
responeData.message = "获取成功!";
|
||||
}
|
||||
else
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "集团记录尚未生成!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = "获取失败:" + ex.Message;
|
||||
ErrLogInfo.WriteLog("中央企业安全生产管理评价工作调度台账获取!", ex);
|
||||
}
|
||||
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭导入弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
GetValue();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭查看审批信息弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window4_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 打印
|
||||
/// <summary>
|
||||
/// 打印
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnPrint_Click(object sender, EventArgs e)
|
||||
{
|
||||
//Model.Information_SafetyProductionEvaluation report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
//if (report != null)
|
||||
//{
|
||||
// PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("../../ReportPrint/ExReportPrint.aspx?reportId={0}&&replaceParameter={1}&&varValue={2}", Const.Information_SafetyProductionEvaluationId, report.SafetyProductionEvaluationId, "", "打印 - ")));
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 季度向前/向后
|
||||
/// <summary>
|
||||
/// 前一季度
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void BtnBulletLeft_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMonthChange("-");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 后一季度
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void BulletRight_Click(object sender, EventArgs e)
|
||||
{
|
||||
SetMonthChange("+");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 季度加减变化
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SetMonthChange(string type)
|
||||
{
|
||||
DateTime? nowDate = Funs.GetNewDateTime(this.drpYear.SelectedValue + "-" + (Funs.GetNewIntOrZero(this.drpQuarter.SelectedValue) * 3).ToString());
|
||||
if (nowDate.HasValue)
|
||||
{
|
||||
DateTime showDate = new DateTime();
|
||||
if (type == "+")
|
||||
{
|
||||
showDate = nowDate.Value.AddMonths(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
showDate = nowDate.Value.AddMonths(-3);
|
||||
}
|
||||
|
||||
this.drpYear.SelectedValue = showDate.Year.ToString();
|
||||
this.drpQuarter.SelectedValue = Funs.GetNowQuarterlyByTime(showDate).ToString();
|
||||
///值变化
|
||||
GetValue();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看审批信息
|
||||
/// <summary>
|
||||
/// 查看审批信息
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSee_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(drpUnit.SelectedValue, Funs.GetNewIntOrZero(drpYear.SelectedValue), Funs.GetNewIntOrZero(drpQuarter.SelectedValue));
|
||||
if (report != null)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ReportAuditSee.aspx?Id={0}", report.SafetyProductionEvaluationId, "查看 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("所选月份无记录!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#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;
|
||||
Response.Write(GetGridTableHtml(Grid1));
|
||||
Response.End();
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+276
@@ -0,0 +1,276 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Information {
|
||||
|
||||
|
||||
public partial class SafetyProductionEvaluation {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// RegionPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RegionPanel RegionPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// Region2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Region Region2;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnit;
|
||||
|
||||
/// <summary>
|
||||
/// drpYear 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpYear;
|
||||
|
||||
/// <summary>
|
||||
/// drpQuarter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// BtnBulletLeft 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnBulletLeft;
|
||||
|
||||
/// <summary>
|
||||
/// BtnBulletRight 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button BtnBulletRight;
|
||||
|
||||
/// <summary>
|
||||
/// btnSee 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSee;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnGet 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnGet;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit2;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdata 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnUpdata;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// txtUnitName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtUnitName;
|
||||
|
||||
/// <summary>
|
||||
/// txtQuarter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// lbHandleMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbHandleMan;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// Window3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window3;
|
||||
|
||||
/// <summary>
|
||||
/// Window4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window4;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyProductionEvaluationAdd.aspx.cs" Inherits="FineUIPro.Web.ZHGL.Information.SafetyProductionEvaluationAdd" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>编辑安全生产管理评价工作调度台账</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="ddlUnitId" runat="server" Label="单位" Required="True" ShowRedStar="True">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlYearId" runat="server" Label="年度" Required="True" ShowRedStar="True">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="ddlQuarter" runat="server" Label="季度" Required="True" ShowRedStar="True">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="制表时间" ID="dpkCompileDate"
|
||||
Required="True" ShowRedStar="True">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
BoxFlex="1" DataKeyNames="SafetyProductionEvaluationItemId" AllowCellEditing="true"
|
||||
ClicksToEdit="1" DataIDField="SafetyProductionEvaluationItemId" EnableColumnLines="true"
|
||||
OnRowCommand="Grid1_RowCommand" EnableHeaderMenu="false" Width="1200px" Height="360px">
|
||||
<Columns>
|
||||
<f:RenderField Width="55px" ColumnID="SortIndex" DataField="SortIndex" FieldType="String"
|
||||
HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Type" DataField="Type" FieldType="String"
|
||||
HeaderText="类型" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="EvaluateWork" DataField="EvaluateWork"
|
||||
FieldType="String" HeaderText="评价工作" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="EvaluationContent" DataField="EvaluationContent"
|
||||
FieldType="String" HeaderText="评价内容" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="350px" ColumnID="FillingRequirements" DataField="FillingRequirements"
|
||||
FieldType="String" HeaderText="填报要求" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="CompletionDeadline" DataField="CompletionDeadline"
|
||||
FieldType="String" HeaderText="完成期限" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="ImplementationStatus" DataField="ImplementationStatus" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderText="落实情况" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:TextArea ID="txtImplementationStatus" Text='<%# Eval("ImplementationStatus")%>' runat="server" AutoGrowHeight="true">
|
||||
</f:TextArea>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="55px" ColumnID="SafetyProductionEvaluationItemId" DataField="SafetyProductionEvaluationItemId" FieldType="String"
|
||||
HeaderText="主键" HeaderTextAlign="Center" TextAlign="Center" Hidden="true">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||
</Listeners>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnCopy" Icon="Database" runat="server" ToolTip="复制上季度数据" ValidateForms="SimpleForm1"
|
||||
OnClick="btnCopy_Click" Hidden="true" MarginLeft="10px">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Hidden="true"
|
||||
ValidateForms="SimpleForm1" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" Hidden="true" ToolTip="提交"
|
||||
ValidateForms="SimpleForm1" OnClick="btnSubmit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnUpdata" Icon="PageSave" runat="server" Hidden="true" ConfirmText="确定上报?"
|
||||
ToolTip="上报" ValidateForms="SimpleForm1" OnClick="btnUpdata_Click" MarginRight="10px">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" IconUrl="~/res/images/16/11.png" runat="server" Hidden="true"
|
||||
IsModal="false" Target="Parent" EnableMaximize="true" EnableResize="true" OnClose="Window1_Close"
|
||||
Title="办理流程" CloseAction="HidePostBack" EnableIFrame="true" Height="520px" Width="800px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['Type','EvaluateWork','EvaluationContent','FillingRequirements'], {
|
||||
depends: true
|
||||
});
|
||||
|
||||
this.mergeColumns(['FillingRequirements'], {
|
||||
depends: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,534 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Information
|
||||
{
|
||||
public partial class SafetyProductionEvaluationAdd : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
public string SafetyProductionEvaluationId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["SafetyProductionEvaluationId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["SafetyProductionEvaluationId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义集合
|
||||
/// </summary>
|
||||
private static List<Model.Information_SafetyProductionEvaluationItem> items = new List<Model.Information_SafetyProductionEvaluationItem>();
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.GetButtonPower();
|
||||
items.Clear();
|
||||
this.ddlUnitId.DataTextField = "UnitName";
|
||||
this.ddlUnitId.DataValueField = "UnitId";
|
||||
this.ddlUnitId.DataSource = BLL.UnitService.GetThisUnitDropDownList();
|
||||
this.ddlUnitId.DataBind();
|
||||
|
||||
this.ddlYearId.DataTextField = "ConstText";
|
||||
ddlYearId.DataValueField = "ConstValue";
|
||||
ddlYearId.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0008);
|
||||
ddlYearId.DataBind();
|
||||
|
||||
this.ddlQuarter.DataTextField = "ConstText";
|
||||
ddlQuarter.DataValueField = "ConstValue";
|
||||
ddlQuarter.DataSource = BLL.ConstValue.drpConstItemList(ConstValue.Group_0011);
|
||||
ddlQuarter.DataBind();
|
||||
this.ddlUnitId.Readonly = true;
|
||||
string unitId = Request.Params["UnitId"];
|
||||
string year = Request.QueryString["Year"];
|
||||
string quarter = Request.QueryString["Quarter"];
|
||||
this.SafetyProductionEvaluationId = Request.Params["SafetyProductionEvaluationId"];
|
||||
if (!string.IsNullOrEmpty(this.SafetyProductionEvaluationId))
|
||||
{
|
||||
items = BLL.SafetyProductionEvaluationItemService.GetSafetyProductionEvaluationItemList(this.SafetyProductionEvaluationId);
|
||||
this.Grid1.DataSource = items;
|
||||
this.Grid1.DataBind();
|
||||
|
||||
var SafetyProductionEvaluation = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationById(this.SafetyProductionEvaluationId);
|
||||
if (SafetyProductionEvaluation != null)
|
||||
{
|
||||
this.btnCopy.Hidden = true;
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnSubmit.Hidden = true;
|
||||
if (SafetyProductionEvaluation.HandleState == BLL.Const.HandleState_4)
|
||||
{
|
||||
this.btnUpdata.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SafetyProductionEvaluation.HandleMan == this.CurrUser.UserId)
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
}
|
||||
if (SafetyProductionEvaluation.UpState == BLL.Const.UpState_3) //已上报
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnUpdata.Hidden = true;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(SafetyProductionEvaluation.UnitId))
|
||||
{
|
||||
this.ddlUnitId.SelectedValue = SafetyProductionEvaluation.UnitId;
|
||||
}
|
||||
if (SafetyProductionEvaluation.YearId.HasValue)
|
||||
{
|
||||
this.ddlYearId.SelectedValue = SafetyProductionEvaluation.YearId.ToString();
|
||||
}
|
||||
if (SafetyProductionEvaluation.Quarter.HasValue)
|
||||
{
|
||||
this.ddlQuarter.SelectedValue = SafetyProductionEvaluation.Quarter.ToString();
|
||||
}
|
||||
if (SafetyProductionEvaluation.ReportDate != null)
|
||||
{
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", SafetyProductionEvaluation.ReportDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//this.btnCopy.Hidden = false;
|
||||
this.ddlUnitId.SelectedValue = unitId;
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.ddlYearId.SelectedValue = year;
|
||||
this.ddlQuarter.SelectedValue = quarter;
|
||||
////获取项目报告集合
|
||||
//List<Model.InformationProject_SafetyProductionEvaluationItem> projectItems = (from x in Funs.DB.InformationProject_SafetyProductionEvaluation
|
||||
// join y in Funs.DB.InformationProject_SafetyProductionEvaluationItem
|
||||
// on x.SafetyProductionEvaluationId equals y.SafetyProductionEvaluationId
|
||||
// where x.YearId.ToString() == year && x.Quarter.ToString() == quarter && x.States == BLL.Const.State_2
|
||||
// select y).Distinct().ToList();
|
||||
//if (projectItems.Count > 0)
|
||||
//{
|
||||
// int i = 0;
|
||||
// foreach (var projectItem in projectItems)
|
||||
// {
|
||||
// i += 10;
|
||||
// Model.Information_SafetyProductionEvaluationItem item = new Model.Information_SafetyProductionEvaluationItem
|
||||
// {
|
||||
// SafetyProductionEvaluationItemId = SQLHelper.GetNewID(typeof(Model.Information_SafetyProductionEvaluationItem)),
|
||||
// SortIndex = i
|
||||
// };
|
||||
// Model.Base_Project project = (from x in Funs.DB.Base_Project
|
||||
// join y in Funs.DB.InformationProject_SafetyProductionEvaluation
|
||||
// on x.ProjectId equals y.ProjectId
|
||||
// join z in Funs.DB.InformationProject_SafetyProductionEvaluationItem
|
||||
// on y.SafetyProductionEvaluationId equals z.SafetyProductionEvaluationId
|
||||
// where z.SafetyProductionEvaluationItemId == projectItem.SafetyProductionEvaluationItemId
|
||||
// select x).FirstOrDefault();
|
||||
// if (project != null)
|
||||
// {
|
||||
// item.IndustryType = project.ProjectName;
|
||||
// }
|
||||
// item.TotalConductCount = projectItem.TotalConductCount;
|
||||
// item.TotalPeopleCount = projectItem.TotalPeopleCount;
|
||||
// item.TotalInvestment = projectItem.TotalInvestment;
|
||||
// item.HQConductCount = projectItem.HQConductCount;
|
||||
// item.HQPeopleCount = projectItem.HQPeopleCount;
|
||||
// item.HQInvestment = projectItem.HQInvestment;
|
||||
// item.BasicConductCount = projectItem.BasicConductCount;
|
||||
// item.BasicPeopleCount = projectItem.BasicPeopleCount;
|
||||
// item.BasicInvestment = projectItem.BasicInvestment;
|
||||
// item.ComprehensivePractice = projectItem.ComprehensivePractice;
|
||||
// item.CPScene = projectItem.CPScene;
|
||||
// item.CPDesktop = projectItem.CPDesktop;
|
||||
// item.SpecialDrill = projectItem.SpecialDrill;
|
||||
// item.SDScene = projectItem.SDScene;
|
||||
// item.SDDesktop = projectItem.SDDesktop;
|
||||
// items.Add(item);
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// for (int i = 0; i < 100; i++)
|
||||
// {
|
||||
// i += 10;
|
||||
// Model.Information_SafetyProductionEvaluationItem newItem = new Model.Information_SafetyProductionEvaluationItem
|
||||
// {
|
||||
// SafetyProductionEvaluationItemId = SQLHelper.GetNewID(typeof(Model.Information_SafetyProductionEvaluationItem)),
|
||||
// SortIndex = i
|
||||
// };
|
||||
// items.Add(newItem);
|
||||
// }
|
||||
//}
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 保存、提交、上报
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("add");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上报按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnUpdata_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("updata");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 提交按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save("submit");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void Save(string type)
|
||||
{
|
||||
if (this.ddlUnitId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
var drill = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdDate(this.ddlUnitId.SelectedValue, Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue), Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue), this.SafetyProductionEvaluationId);
|
||||
if (drill != null)
|
||||
{
|
||||
ShowNotify("本单位本季度报表已存在,不能重复编制", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var SafetyProductionEvaluation = new Model.Information_SafetyProductionEvaluation();
|
||||
if (this.ddlUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
SafetyProductionEvaluation.UnitId = this.ddlUnitId.SelectedValue;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpkCompileDate.Text.Trim()))
|
||||
{
|
||||
SafetyProductionEvaluation.ReportDate = Convert.ToDateTime(this.dpkCompileDate.Text.Trim());
|
||||
}
|
||||
SafetyProductionEvaluation.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
|
||||
SafetyProductionEvaluation.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
|
||||
if (string.IsNullOrEmpty(this.SafetyProductionEvaluationId))
|
||||
{
|
||||
this.SafetyProductionEvaluationId = SQLHelper.GetNewID(typeof(Model.Information_SafetyProductionEvaluation)); SafetyProductionEvaluation.SafetyProductionEvaluationId = this.SafetyProductionEvaluationId;
|
||||
SafetyProductionEvaluation.CompileMan = this.CurrUser.UserName;
|
||||
SafetyProductionEvaluation.UpState = BLL.Const.UpState_2;
|
||||
SafetyProductionEvaluation.HandleMan = this.CurrUser.UserId;
|
||||
SafetyProductionEvaluation.HandleState = BLL.Const.HandleState_1;
|
||||
BLL.SafetyProductionEvaluationService.AddSafetyProductionEvaluation(SafetyProductionEvaluation);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, SafetyProductionEvaluation.YearId.ToString() + "-" + SafetyProductionEvaluation.Quarter.ToString(),
|
||||
SafetyProductionEvaluation.SafetyProductionEvaluationId, BLL.Const.SafetyProductionEvaluationMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation oldReport = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationById(this.SafetyProductionEvaluationId);
|
||||
if (oldReport != null)
|
||||
{
|
||||
SafetyProductionEvaluation.HandleMan = oldReport.HandleMan;
|
||||
SafetyProductionEvaluation.HandleState = oldReport.HandleState;
|
||||
}
|
||||
SafetyProductionEvaluation.SafetyProductionEvaluationId = this.SafetyProductionEvaluationId;
|
||||
SafetyProductionEvaluation.UpState = BLL.Const.UpState_2;
|
||||
BLL.SafetyProductionEvaluationService.UpdateSafetyProductionEvaluation(SafetyProductionEvaluation);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, SafetyProductionEvaluation.YearId.ToString() + "-" + SafetyProductionEvaluation.Quarter.ToString(),
|
||||
SafetyProductionEvaluation.SafetyProductionEvaluationId, BLL.Const.SafetyProductionEvaluationMenuId, BLL.Const.BtnModify);
|
||||
BLL.SafetyProductionEvaluationItemService.DeleteSafetyProductionEvaluationItemList(SafetyProductionEvaluation.SafetyProductionEvaluationId);
|
||||
}
|
||||
GetItems(SafetyProductionEvaluation.SafetyProductionEvaluationId);
|
||||
foreach (var item in items)
|
||||
{
|
||||
BLL.SafetyProductionEvaluationItemService.AddSafetyProductionEvaluationItem(item);
|
||||
}
|
||||
if (type == "updata") //保存并上报
|
||||
{
|
||||
if (SafetyProductionEvaluation.UpState == BLL.Const.UpState_2)
|
||||
{
|
||||
string code = CNCECHSSEWebService.UpSafetyProductionEvaluation(SafetyProductionEvaluation.SafetyProductionEvaluationId, this.CurrUser);
|
||||
if (code == "1")
|
||||
{
|
||||
ShowNotify("同步成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInParent("同步异常,请退出后重试!", MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("当前单据状态不能同步!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (type == "submit")
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReportSubmit.aspx?Type=SafetyProductionEvaluation&Id={0}", SafetyProductionEvaluation.SafetyProductionEvaluationId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取明细值
|
||||
/// </summary>
|
||||
/// <param name="SafetyProductionEvaluationId"></param>
|
||||
private void GetItems(string SafetyProductionEvaluationId)
|
||||
{
|
||||
items.Clear();
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
Model.Information_SafetyProductionEvaluationItem item = new Model.Information_SafetyProductionEvaluationItem();
|
||||
if (values["SafetyProductionEvaluationItemId"].ToString() != "")
|
||||
{
|
||||
item.SafetyProductionEvaluationItemId = values.Value<string>("SafetyProductionEvaluationItemId");
|
||||
}
|
||||
item.SafetyProductionEvaluationId = SafetyProductionEvaluationId;
|
||||
item.SortIndex = Funs.GetNewInt(values.Value<string>("SortIndex"));
|
||||
if (values["Type"].ToString() != "")
|
||||
{
|
||||
item.Type = values.Value<string>("Type");
|
||||
}
|
||||
if (values["EvaluateWork"].ToString() != "")
|
||||
{
|
||||
item.EvaluateWork = values.Value<string>("EvaluateWork");
|
||||
}
|
||||
if (values["EvaluationContent"].ToString() != "")
|
||||
{
|
||||
item.EvaluationContent = values.Value<string>("EvaluationContent");
|
||||
}
|
||||
if (values["FillingRequirements"].ToString() != "")
|
||||
{
|
||||
item.FillingRequirements = values.Value<string>("FillingRequirements");
|
||||
}
|
||||
if (values["CompletionDeadline"].ToString() != "")
|
||||
{
|
||||
item.CompletionDeadline = values.Value<string>("CompletionDeadline");
|
||||
}
|
||||
if (values["ImplementationStatus"].ToString() != "")
|
||||
{
|
||||
item.ImplementationStatus = values.Value<string>("ImplementationStatus");
|
||||
}
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭办理流程窗口
|
||||
/// <summary>
|
||||
/// 关闭办理流程窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationById(this.SafetyProductionEvaluationId);
|
||||
if (report.HandleMan == this.CurrUser.UserId)
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
this.btnSubmit.Hidden = true;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Grid行事件
|
||||
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
GetItems(string.Empty);
|
||||
if (e.CommandName == "Add")
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluationItem oldItem = items.FirstOrDefault(x => x.SafetyProductionEvaluationItemId == rowID);
|
||||
Model.Information_SafetyProductionEvaluationItem newItem = new Model.Information_SafetyProductionEvaluationItem
|
||||
{
|
||||
SafetyProductionEvaluationItemId = SQLHelper.GetNewID(typeof(Model.Information_SafetyProductionEvaluationItem))
|
||||
};
|
||||
if (oldItem != null)
|
||||
{
|
||||
newItem.SortIndex = oldItem.SortIndex + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
newItem.SortIndex = 0;
|
||||
}
|
||||
items.Add(newItem);
|
||||
items = items.OrderBy(x => x.SortIndex).ToList();
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
if (e.CommandName == "Delete")
|
||||
{
|
||||
if (Grid1.Rows.Count == 1)
|
||||
{
|
||||
ShowNotify("只有一条数据,无法删除", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
foreach (var item in items)
|
||||
{
|
||||
if (item.SafetyProductionEvaluationItemId == rowID)
|
||||
{
|
||||
items.Remove(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Grid1.DataSource = items;
|
||||
Grid1.DataBind();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#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.SafetyProductionEvaluationMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnCopy.Hidden = false;
|
||||
}
|
||||
//if (buttonList.Contains(BLL.Const.BtnSaveUp))
|
||||
//{
|
||||
// this.btnUpdata.Hidden = false;
|
||||
|
||||
//}
|
||||
if (buttonList.Contains(BLL.Const.BtnSubmit))
|
||||
{
|
||||
this.btnSubmit.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 复制上个季度数据
|
||||
/// <summary>
|
||||
/// 复制上个季度的数据
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnCopy_Click(object sender, EventArgs e)
|
||||
{
|
||||
int lastYear = 0, lastQuarter = 0;
|
||||
int year = Convert.ToInt32(this.ddlYearId.SelectedValue);
|
||||
int quarter = Convert.ToInt32(this.ddlQuarter.SelectedValue);
|
||||
if (quarter == 1)
|
||||
{
|
||||
lastYear = year - 1;
|
||||
lastQuarter = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastYear = year;
|
||||
lastQuarter = quarter - 1;
|
||||
}
|
||||
Model.Information_SafetyProductionEvaluation SafetyProductionEvaluation = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationByUnitIdAndYearAndQuarters(this.ddlUnitId.SelectedValue, lastYear, lastQuarter);
|
||||
if (SafetyProductionEvaluation != null)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluation newSafetyProductionEvaluation = new Model.Information_SafetyProductionEvaluation();
|
||||
this.SafetyProductionEvaluationId = SQLHelper.GetNewID(typeof(Model.Information_SafetyProductionEvaluation));
|
||||
newSafetyProductionEvaluation.SafetyProductionEvaluationId = this.SafetyProductionEvaluationId;
|
||||
newSafetyProductionEvaluation.UnitId = this.ddlUnitId.SelectedValue;
|
||||
newSafetyProductionEvaluation.ReportDate = DateTime.Now;
|
||||
newSafetyProductionEvaluation.Quarter = Funs.GetNewIntOrZero(this.ddlQuarter.SelectedValue);
|
||||
newSafetyProductionEvaluation.YearId = Funs.GetNewIntOrZero(this.ddlYearId.SelectedValue);
|
||||
newSafetyProductionEvaluation.CompileMan = this.CurrUser.UserName;
|
||||
newSafetyProductionEvaluation.UpState = BLL.Const.UpState_2;
|
||||
newSafetyProductionEvaluation.HandleState = BLL.Const.HandleState_1;
|
||||
newSafetyProductionEvaluation.HandleMan = this.CurrUser.UserId;
|
||||
BLL.SafetyProductionEvaluationService.AddSafetyProductionEvaluation(newSafetyProductionEvaluation);
|
||||
|
||||
items = BLL.SafetyProductionEvaluationItemService.GetSafetyProductionEvaluationItemList(SafetyProductionEvaluation.SafetyProductionEvaluationId);
|
||||
if (items.Count > 0)
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
Model.Information_SafetyProductionEvaluationItem newItem = new Model.Information_SafetyProductionEvaluationItem
|
||||
{
|
||||
SafetyProductionEvaluationItemId = SQLHelper.GetNewID(typeof(Model.Information_SafetyProductionEvaluationItem)),
|
||||
SafetyProductionEvaluationId = this.SafetyProductionEvaluationId,
|
||||
SortIndex = item.SortIndex
|
||||
};
|
||||
BLL.SafetyProductionEvaluationItemService.AddSafetyProductionEvaluationItem(newItem);
|
||||
}
|
||||
}
|
||||
GetValues(newSafetyProductionEvaluation.SafetyProductionEvaluationId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数据
|
||||
/// </summary>
|
||||
private void GetValues(string SafetyProductionEvaluationId)
|
||||
{
|
||||
var report = BLL.SafetyProductionEvaluationService.GetSafetyProductionEvaluationById(SafetyProductionEvaluationId);
|
||||
if (report != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(report.UnitId))
|
||||
{
|
||||
this.ddlUnitId.SelectedValue = report.UnitId;
|
||||
}
|
||||
if (report.YearId.HasValue)
|
||||
{
|
||||
this.ddlYearId.SelectedValue = report.YearId.ToString();
|
||||
}
|
||||
if (report.Quarter.HasValue)
|
||||
{
|
||||
this.ddlQuarter.SelectedValue = report.Quarter.ToString();
|
||||
}
|
||||
if (report.ReportDate != null)
|
||||
{
|
||||
this.dpkCompileDate.Text = string.Format("{0:yyyy-MM-dd}", report.ReportDate);
|
||||
}
|
||||
items = BLL.SafetyProductionEvaluationItemService.GetSafetyProductionEvaluationItemList(SafetyProductionEvaluationId);
|
||||
this.Grid1.DataSource = items;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.ZHGL.Information {
|
||||
|
||||
|
||||
public partial class SafetyProductionEvaluationAdd {
|
||||
|
||||
/// <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>
|
||||
/// ddlUnitId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// ddlYearId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlYearId;
|
||||
|
||||
/// <summary>
|
||||
/// ddlQuarter 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlQuarter;
|
||||
|
||||
/// <summary>
|
||||
/// dpkCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker dpkCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// txtImplementationStatus 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtImplementationStatus;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnCopy 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnCopy;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// btnUpdata 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnUpdata;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user