QueryOrgLog.aspx.cs
资源名称:H3_OA.rar [点击查看]
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:4k
源码类别:
OA系统
开发平台:
C#
- using System;
- using System.Collections;
- using System.Configuration;
- using System.Data;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.HtmlControls;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- namespace OThinker.H3.Portal
- {
- public partial class QueryOrgLog : PortalPage
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!this.IsPostBack)
- {
- if (!this.UserValidator.ValidateAdministrator())
- {
- this.NotifyMessage(LackOfAuth);
- }
- this.txtStart.Text = System.DateTime.Now.AddDays(-7).ToShortDateString();
- this.txtEnd.Text = System.DateTime.Now.AddDays(1).ToShortDateString();
- }
- }
- private DataTable Table
- {
- get
- {
- return (DataTable)this.Session[OThinker.H3.WorkSheet.Sessions.GetOrgLogTable()];
- }
- set
- {
- this.Session[OThinker.H3.WorkSheet.Sessions.GetOrgLogTable()] = value;
- }
- }
- protected void btnQuery_Click(object sender, EventArgs e)
- {
- System.DateTime start = System.DateTime.Now;
- System.DateTime end = System.DateTime.Now;
- try
- {
- start = System.DateTime.Parse(this.txtStart.Text);
- end = System.DateTime.Parse(this.txtEnd.Text);
- }
- catch
- {
- this.NotifyMessage("输入的开始日期或者结束日期有错误");
- }
- this.Table = OThinker.H3.Server.Engine.Organization.QueryLog(start, end);
- this.gridLog.DataSource = this.Table;
- this.gridLog.DataBind();
- }
- protected void gridLog_RowDataBound(object sender, GridViewRowEventArgs e)
- {
- if (e.Row.RowType != DataControlRowType.Header && e.Row.RowType != DataControlRowType.Footer && e.Row.RowType != DataControlRowType.Pager)
- {
- // 修改人的名称
- string userId = e.Row.Cells[0].Text;
- string userName = null;
- if (userId == null || userId.Trim() == "" || userId == " ")
- {
- userName = "系统";
- }
- else
- {
- userId = userId.Trim().ToLower();
- userName = OThinker.H3.Server.Engine.Organization.GetFullName(userId);
- }
- e.Row.Cells[0].Text = userName;
- // 操作
- string operationStr = e.Row.Cells[2].Text.Trim();
- int operationInt = int.Parse(operationStr);
- OThinker.Organization.OrganizationLog.OperationType operation = (OThinker.Organization.OrganizationLog.OperationType)operationInt;
- e.Row.Cells[2].Text = OThinker.Organization.OrganizationLog.GetOperationName(operation);
- // 对象
- object name = this.Table.Rows[this.gridLog.PageIndex * this.gridLog.PageSize + e.Row.RowIndex]["Name"];
- string unitId = e.Row.Cells[3].Text.Trim();
- string fullName = OThinker.H3.Server.Engine.Organization.GetFullName(unitId);
- e.Row.Cells[3].Text = fullName != null ? fullName : (name == null ? null : name.ToString());
- }
- }
- protected void gridLog_PageIndexChanged(object sender, EventArgs e)
- {
- // this.gridLog.CurrentPageIndex = e.NewPageIndex;
- // this.gridLog.DataBind();
- }
- protected void gridLog_PageIndexChanging(object sender, GridViewPageEventArgs e)
- {
- this.gridLog.PageIndex = e.NewPageIndex;
- this.gridLog.DataSource = this.Table;
- this.gridLog.DataBind();
- }
- }
- }