index.aspx.cs
上传用户:simon2hong
上传日期:2021-11-18
资源大小:16746k
文件大小:3k
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using System.Xml;
- //源码下载 www.51aspx.com
- //本源码由51aspx独家发布,转载请注明来源51aspx
- public partial class index : System.Web.UI.Page, ICallbackEventHandler
- {
- private string area;
- public string AdminQuanXian = "";
- public string UserNameStr = "";
- public string LeftMenuStr = "";
- public string CountMsg
- {
- get {
- BLL.Sms BS = new BLL.Sms();
- return BS.GetCount("ToId='" + SessionInclude.SessionId + "'and RemindFlag=1 and type=0").ToString();
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- LoginLogic.MatchLoad("", "index");
- UserNameStr = SessionInclude.SessionId;
- if (!IsPostBack)
- {
- Model.Users MU = new BLL.Users().GetModel(int.Parse(SessionInclude.Id));
- Model.User_Priv MUP = new BLL.User_Priv().GetModel(MU.PrivId);
- AdminQuanXian = MUP.PrivName;
- LeftMenuStr = MUP.LeftMenu;
- }
- LoadInAddScript();
- }
- /// <summary>
- /// ICallbackEventHandler的继承返回方法
- /// </summary>
- /// <returns></returns>
- public string GetCallbackResult()
- {
- return area;
- }
-
- /// <summary>
- /// ICallbackEventHandler的继承接收方法
- /// </summary>
- /// <param name="eventArgument"></param>
- public void RaiseCallbackEvent(string eventArgument)
- {
- BLL.Sms BS=new BLL.Sms();
- if (BS.GetCount("ToId='" + SessionInclude.SessionId + "' and RemindFlag=1 and type=0") > 0)
- {
- Model.Sms MS = BS.GetPageList(1, 1, "ID", false, "ToId='" + SessionInclude.SessionId + "' and RemindFlag=1 and type=0")[0];
- // area = "您有新的工作$SMSToUrl.aspx?id=" + MS.ID;
- area = "您有新的工作$SMS/SMSManager.aspx$"+CountMsg;
-
- }
- else
- {
- area = CountMsg;
- }
- }
- public void LoadInAddScript()
- {
- string ReceiveScript = @"
- function Show(area)
- {
- LoopGetMessage(area);
- }";
- ClientScript.RegisterClientScriptBlock(this.GetType(), "Show", ReceiveScript, true);
- string CallbackScript = @"
- function GetArea(){
- " + ClientScript.GetCallbackEventReference(this, "", "Show", null) + @";
- }
- ";
- ClientScript.RegisterClientScriptBlock(this.GetType(), "GetArea", CallbackScript, true);
- }
- }