protected void Page_Load(object sender, EventArgs e) { NowDate = DateTime.Now.ToString(); BLL.UserBLL ubll = new BLL.UserBLL(); BLL.MerchantBLL mbll = new BLL.MerchantBLL(); Model.CurrentMerModel cm = BLL.MerchantBLL.CurrentModel(); CurrentUserId = cm.CurrentUserId; IsAdmin = ubll.IsAdministrator(); if (CurrentUserId.Trim() == "" || CurrentUserId == null) { IsLogin = false; Response.Write("<script src=\"/Script/jquery-1.8.2.js\"></script><script src = \"/Script/ZYUiPub.js\" ></script> "); Response.Write("<script>window.parent.LoginCookie(); setTimeout(function(){ shuaxin(); },1000) </script>"); Response.End(); // throw new Exception("您还没有登录!"); } else { IsLogin = true; } StringBuilder s = new StringBuilder(); s.Append(" var CurrentUserId='" + CurrentUserId + "'; "); s.Append(" var IsAdmin=" + IsAdmin.ToString().ToLower() + "; "); s.Append(" var IsLogin="******"; "); try { decimal MerId = Convert.ToDecimal(Request.QueryString["MerId"]); if (MerId == 0) { MerId = BLL.MerchantBLL.CurrentModel().CurrentMerId; } if (MerId == 0) { } else { mbll.CheckChangeMerPower(MerId); } MerJson = Common.JsonHelper.ToJsonNo1(mbll.GetMerInfoFaseById(MerId)); s.Append(" var MerJson=" + MerJson + "; "); } catch { } ScriptStr = s.ToString(); }
protected void Page_Load(object sender, EventArgs e) { Model.CurrentMerModel cm = BLL.MerchantBLL.CurrentModel(); BLL.MerchantBLL mBll = new BLL.MerchantBLL(); StringBuilder s = new StringBuilder(); s.Append(" select * from dbo.MerRole with(nolock) where MerId='" + cm.CurrentMerId + "' "); //0 s.Append(" select * from CORE.dbo.MenuVsMerRole with(nolock) "); //1 s.Append(" select * from CORE.dbo.MenuInfo with(nolock) where AdminPower!=100 "); //2 s.Append(" select * from CORE.dbo.AppMenuVsMerRole with(nolock) "); //3 s.Append(" select * from CORE.dbo.AppMenuInfo with(nolock) "); //4 s.Append(" SELECT * FROM DBMSG.dbo.MsgType with(nolock) WHERE TargetLv BETWEEN 10 AND 20 "); DataSet ds = DAL.DalComm.BackData(s.ToString()); DataTable dtMerRole = ds.Tables[0]; DataTable dtMerMenuVsMerRole = ds.Tables[1]; DataTable dtMernu = ds.Tables[2]; DataTable dtAppMenu = ds.Tables[4]; DataTable dtAppMerMenuVsMerRole = ds.Tables[3]; DataTable dtMsgType = ds.Tables[5]; StringBuilder w = new StringBuilder(); foreach (DataRow dr in dtMerRole.Rows) { w.Append(" <li MerRoleId='" + dr["MerRoleId"] + "'>" + dr["MerRoleName"] + "</li>"); } MerRoleListHtml = w.ToString(); w.Clear(); #region PC菜单开始 DataTable dtParentMenu = Common.DataSetting.TableSelect(" ParentMenuId='' ", dtMernu); foreach (DataRow dr in dtParentMenu.Rows) { string MenuId = dr["MenuId"].ToString(); string MenuName = dr["MenuName"].ToString(); w.Append("<dl>"); w.Append("<dt MenuId='" + MenuId + "' >"); w.Append("<input class='cb_sel' type='checkbox' />"); w.Append(MenuName); w.Append("</dt>"); DataTable dtCldMenu = Common.DataSetting.TableSelect(" ParentMenuId='" + MenuId + "' ", dtMernu); if (dtCldMenu.Rows.Count > 0) { foreach (DataRow drCld in dtCldMenu.Rows) { string CldMenuId = drCld["MenuId"].ToString(); string CldMenuName = drCld["MenuName"].ToString(); w.Append("<dd MenuId='" + CldMenuId + "'>"); w.Append("<input class='cb_sel' type='checkbox' />"); w.Append(CldMenuName); w.Append("</dd>"); } } w.Append("</dl>"); } MenuListHtml = w.ToString(); w.Clear(); #endregion #region 手机菜单开始 //手机菜单开始 DataTable dtParentAppMenu = Common.DataSetting.TableSelect(" ParentAppMenuId='' ", dtAppMenu); foreach (DataRow dr in dtParentAppMenu.Rows) { string AppMenuId = dr["AppMenuId"].ToString(); string AppMenuName = dr["AppMenuName"].ToString(); w.Append("<dl>"); w.Append("<dt AppMenuId='" + AppMenuId + "' >"); w.Append("<input class='cb_sel' type='checkbox' />"); w.Append(AppMenuName); w.Append("</dt>"); DataTable dtCldAppMenu = Common.DataSetting.TableSelect(" ParentAppMenuId='" + AppMenuId + "' ", dtAppMenu); if (dtCldAppMenu.Rows.Count > 0) { foreach (DataRow drCld in dtCldAppMenu.Rows) { string CldAppMenuId = drCld["AppMenuId"].ToString(); string CldAppMenuName = drCld["AppMenuName"].ToString(); w.Append("<dd AppMenuId='" + CldAppMenuId + "'>"); w.Append("<input class='cb_sel' type='checkbox' />"); w.Append(CldAppMenuName); w.Append("</dd>"); } } w.Append("</dl>"); } AppMenuListHtml = w.ToString(); #endregion #region 消息侦听开始 w.Clear(); if (dtMsgType.Rows.Count > 0) { foreach (DataRow drMsgType in dtMsgType.Rows) { w.Append("<a class='a_MsgType' id='a_" + drMsgType["MsgTypeId"] + "' MsgTypeId='" + drMsgType["MsgTypeId"] + "' >"); w.Append(drMsgType["MsgTypeName"].ToString()); w.Append("</a>"); } MsgTypeHtml = w.ToString(); } #endregion }
protected void Page_Load(object sender, EventArgs e) { Model.CurrentMerModel cm = new Model.CurrentMerModel(); StringBuilder s = new StringBuilder(); StringBuilder sc = new StringBuilder(); try { cm = BLL.MerchantBLL.CurrentModel(); if (cm.CurrentUserId == "") { BLL.UserBLL.MastLogin(""); } CurrentMerId = cm.CurrentMerId; sc.Append(" var CMerId=" + cm.CurrentMerId + "; "); sc.Append(" localStorage['MerId'] = CMerId; "); sc.Append(" localStorage['UserId'] = '" + cm.CurrentUserId + "'; "); sc.Append(" var CurrentUserId='" + cm.CurrentUserId + "'; "); sc.Append(" var CMerName='" + cm.CurrentMerName + "'; "); sc.Append(" var domain= '" + Request.Url.Host + "'; "); } catch { Response.Redirect("~/Login.aspx"); } BLL.UserBLL ubll = new BLL.UserBLL(); s.Append(" select * from CORE.dbo.MenuInfo with(nolock) "); s.Append(" where 1=1 and ( "); s.Append(" MenuId in (select MenuId from CORE.dbo.MenuVsMerRole where MerRoleId in (SELECT mvu.MerRoleId FROM dbo.MerRoleVsUser mvu WHERE UserId='" + cm.CurrentUserId + "') ) "); if (ubll.IsAdministrator()) { //如果是超级管理员 s.Append(" or (AdminPower = 100) "); } else { } if (cm.CurrentMerRoleName == "系统管理员") { //商家的系统管理员 s.Append(" or (AdminPower = 90 ) "); } else { //不是商家的系统管理员 } s.Append(" ) order by OrderNo "); s.Append(" select * from dbo.UserView with(nolock) where UserId='" + cm.CurrentUserId + "' "); s.Append(" DECLARE @QyWxPtId as DECIMAL =(SELECT top 1 QyWxPtId FROM dbo.QyWxPt with(nolock) WHERE MerId='" + cm.CurrentMerId + "' order by OrderNo desc)"); //微信企业号 s.Append(" SELECT * FROM dbo.QyWxPt WHERE QyWxPtId=@QyWxPtId "); DataSet dsMenu = DAL.DalComm.BackData(s.ToString()); DataTable dtMenu = Common.DataSetting.TableSelect(" ParentMenuId='' ", dsMenu.Tables[0]); DataTable dtUser = dsMenu.Tables[1]; DataTable dtQyWxPt = dsMenu.Tables[2]; if (dtQyWxPt.Rows.Count > 0) { QyWxPtJson = Common.JsonHelper.ToJsonNo1(dtQyWxPt); QyWxPtId = decimal.Parse(dtQyWxPt.Rows[0]["QyWxPtId"].ToString()); sc.Append(" var QyWxPtId=" + QyWxPtId + "; "); sc.Append(" var QyWxPtJson=" + QyWxPtJson + "; "); } foreach (DataRow drUser in dtUser.Rows) { sc.Append(" localStorage.CurrentUserPicImgUrl='" + drUser["中头像"] + "'; "); } StringBuilder w = new StringBuilder(); dtMenu.Columns.Add("Menus"); foreach (DataRow drMenu in dtMenu.Rows) { w.Append("<li>"); w.Append("<a>"); w.Append("<span class='text'>"); w.Append(drMenu["MenuName"]); w.Append("</span>"); w.Append("</a>"); w.Append("</li>"); DataTable dtChildMenu = Common.DataSetting.TableSelect(" ParentMenuId='" + drMenu["MenuId"] + "' ", dsMenu.Tables[0]); drMenu["Menus"] = Common.JsonHelper.ToJson(dtChildMenu); } MenuJson = Common.JsonHelper.ToJson(dtMenu); Dictionary <string, string> MerConfig = BLL.StaticBLL.MerConfig(cm.CurrentMerId); try { sc.Append(" var DingDanTiXing='" + MerConfig["DingDanTiXing"] + "'; "); } catch { sc.Append(" var DingDanTiXing='0'; "); } foreach (var item in MerConfig) { sc.Append(" localStorage." + item.Key + "='" + item.Value + "'; "); } ScriptStr = sc.ToString(); //BLL.MerchantBLL mbll = new BLL.MerchantBLL(); //mbll.NewDingDanTiXing(CurrentMerId); }