/// <summary> /// 获得最大页面数 /// </summary> /// <returns>返回最大页面数</returns> public int GetMaxUserPages() { int MaxAdminPages; if (SiteManagement.GetLogLogin(userAdmin.Hospital.ID) == null) { return(0); } TotalNums = SiteManagement.GetLogLogin(userAdmin.Hospital.ID).Count; if (TotalNums % PageSize == 0) { MaxAdminPages = TotalNums / PageSize; } else { MaxAdminPages = TotalNums / PageSize + 1; } return(MaxAdminPages); }
/// <summary> /// 页面加载 /// </summary> protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { userAdmin = (SiteUser)Session["admin"]; if (this.Request.QueryString["action"] != null) { string DelItem; int resultID = 0; DelItem = this.Request.QueryString["ID"]; if (!string.IsNullOrEmpty(DelItem)) { bool isSucess = int.TryParse(DelItem, out resultID); } if (SiteManagement.DeleteUser(resultID)) { this.Response.Redirect("ViewLogs.aspx"); } else { this.Response.Write(BaseSystem.ShowWindow("出现异常,对不起,删除用户操作失败!!")); } } else { AdminPagePageID = Convert.ToInt32(Request.QueryString["PageID"]); if (Request.QueryString["PageID"] == null) { AdminPagePageID = 1; PageStartIndex = 0; } PageStartIndex = Convert.ToInt32(AdminPagePageID - 1); MaxAdminPages = this.GetMaxUserPages(); List <Log_Login> userLogList = SiteManagement.GetLogLogin(userAdmin.Hospital.ID); BaseSystem.BindProduceData(this.DataListUserLog, userLogList, PageStartIndex, PageStartIndex, PageSize); this.ShowBottomUrl(); } } }