using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using HySoft.Common; using System.Web.UI; public class BasePage : System.Web.UI.Page { public string PageTitle = "";//页面标题文本信息 protected override void OnLoad(EventArgs e) { try { LoginUser p_LoginUser = new LoginUser(this.Context); if (p_LoginUser.UserID == 0) { string url = Request.Url.AbsoluteUri.Replace(Request.Path, ""); ClientScript.RegisterClientScriptBlock(this.GetType(), "", ""); } else { base.OnLoad(e); } } catch (Exception ex) { SysLog.WriteLog(ex); } //设置基类 每个页面继承该类,该类判断是否存在该用户,如果不存在则返回重新登录 } /// /// 操作日志 /// /// 页面ID /// 按钮ID /// 内容 /// 操作类型,0正常,1失败,2异常 /// public bool InsertOptLogs(int F_FunctionId, int F_FunctionItemId, string F_Descript, int F_State) { try { LoginUser p_LoginUser = new LoginUser(this.Context); bool bl = false; DataTable dt = new DataTable(); HySoft.BaseCallCenter.Model.T_Sys_OperateLogs model = new HySoft.BaseCallCenter.Model.T_Sys_OperateLogs(); model.F_Descript = F_Descript; model.F_DeletionStateCode = 0; model.F_FunctionId = F_FunctionId; model.F_FunctionItemId = F_FunctionItemId; model.F_OptBy = p_LoginUser.UserID; model.F_OptName = p_LoginUser.UserName; model.F_OptOn = DateTime.Now; model.F_State = F_State; HySoft.BaseCallCenter.BLL.T_Sys_OperateLogs bll = new HySoft.BaseCallCenter.BLL.T_Sys_OperateLogs(); if (bll.Add(model) > 0) { bl = true; } return bl; } catch { return false; } } /// /// 话务日志 /// /// /// /// public void AddCallLog(string type, string F_Name, string F_Description) { LoginUser p_LoginUser = new LoginUser(this.Context); int userId = p_LoginUser.UserID; string userName = p_LoginUser.UserName; new HySoft.BaseCallCenter.BLL.T_Sys_CallOptLogs().AddCallLog(Convert.ToInt32(userId), userName, type, F_Name, F_Description); } }