Beispiel #1
0
 public static bool DeleteSpecialById(int specialId)
 {
     RolePermissions.AccessCheck(OperateCode.SpecialManage);
     DeleteFolder(specialId);
     DeleteSpecialInfoBySpecialId(specialId);
     return(dal.DeleteSpecial(specialId));
 }
 private void ShowPop()
 {
     if (PEContext.Current.Admin.Identity.IsAuthenticated)
     {
         if (string.Compare(SiteConfig.SiteInfo.ProductEdition, "eshop", StringComparison.OrdinalIgnoreCase) == 0)
         {
             Order.CountByOrderStatus(OrderStatus.WaitForConfirm);
             Product.GetStockAlarmCount(2);
             Order.CountByNoConsignment();
         }
         if (RolePermissions.AccessCheck(OperateCode.OrderConfirm))
         {
             this.XmlResponseWriter.WriteElementString("ordercount", Order.CountByOrderStatus(OrderStatus.WaitForConfirm).ToString());
         }
         this.XmlResponseWriter.WriteElementString("messagecount", Message.UnreadMessageCount(PEContext.Current.Admin.UserName).ToString());
         if (RolePermissions.AccessCheck(OperateCode.ContentManage))
         {
             this.XmlResponseWriter.WriteElementString("articlestatuscount", ContentManage.GetCountByStatus(0).ToString());
         }
         if (RolePermissions.AccessCheck(OperateCode.CommentManage))
         {
             this.XmlResponseWriter.WriteElementString("commentcount", Comment.GetCountByStatus(2).ToString());
         }
         this.XmlResponseWriter.WriteElementString("articlesignincount", ContentManage.GetCountBySignIn(PEContext.Current.Admin.UserName, false).ToString());
         if (RolePermissions.AccessCheck(OperateCode.StockManage))
         {
             this.XmlResponseWriter.WriteElementString("productstockalarmcount", Product.GetStockAlarmCount(2).ToString());
         }
         if (RolePermissions.AccessCheck(OperateCode.OrderSendOrReturnGoods))
         {
             this.XmlResponseWriter.WriteElementString("ordercountbynoconsignment", Order.CountByNoConsignment().ToString());
         }
     }
 }
Beispiel #3
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (!RolePermissions.AccessCheck(OperateCode.UserModifyPermissions))
     {
         throw new CustomException(PEExceptionType.ExceedAuthority);
     }
 }
Beispiel #4
0
 public static bool DeleteSpecialCategoryById(int specialCategoryId)
 {
     RolePermissions.AccessCheck(OperateCode.SpecialManage);
     DeleteSpecialCategoryFolder(specialCategoryId);
     foreach (SpecialInfo info in GetSpecialList(specialCategoryId))
     {
         DeleteSpecialById(info.SpecialId);
     }
     return(dal.DeleteSpecialCategoryById(specialCategoryId));
 }
Beispiel #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.XLoadNodeTree.RootText   = SiteConfig.SiteInfo.SiteName;
     this.XLoadNodeTree.RootAction = "SpecialInfosManage.aspx";
     this.XLoadNodeTree.XmlSrc     = "SpecialInfoTreeXml.aspx";
     this.RegisterRightMenuJs();
     if (RolePermissions.AccessCheck(OperateCode.CategoryInfoManage))
     {
         this.LblNavigationLink.Text = "<a href=\"nodeTree.aspx\" onclick='Reflash_main_right()'>切换到网站节点</a> ";
     }
 }
Beispiel #6
0
 protected override void OnInit(EventArgs e)
 {
     if (this.IsChecked)
     {
         base.Disabled = !RolePermissions.AccessCheck(this.m_Operatecode);
     }
     if (this.IsVisible)
     {
         this.Visible = !base.Disabled;
     }
     base.OnInit(e);
 }
 private bool CheckPermission(string operateCode)
 {
     if (operateCode == "None")
     {
         return(true);
     }
     if (string.IsNullOrEmpty(operateCode))
     {
         return(false);
     }
     return(RolePermissions.AccessCheck(operateCode));
 }
        public static DataActionState Update(UserGroupsInfo userGroupsInfo)
        {
            DataActionState unknown = DataActionState.Unknown;

            if (!RolePermissions.AccessCheck(OperateCode.UserGroupManage))
            {
                throw new CustomException(PEExceptionType.ExceedAuthority);
            }
            if (dal.Update(userGroupsInfo))
            {
                unknown = DataActionState.Successed;
            }
            return(unknown);
        }
Beispiel #9
0
        protected override void OnInit(EventArgs e)
        {
            bool flag = RolePermissions.AccessCheck(this.m_Operatecode);

            if (this.IsChecked && !flag)
            {
                this.Enabled = false;
            }
            if (this.IsVisible && !flag)
            {
                this.Visible = true;
            }
            base.OnInit(e);
        }
        private bool CheckPermission(string operateCode)
        {
            if (operateCode == "None")
            {
                return(true);
            }
            if (!Enum.IsDefined(typeof(OperateCode), operateCode))
            {
                return(false);
            }
            OperateCode code = (OperateCode)Enum.Parse(typeof(OperateCode), operateCode);

            return(RolePermissions.AccessCheck(code));
        }
Beispiel #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!PEContext.Current.Admin.IsSuperAdmin)
     {
         this.m_HasPermissions = RolePermissions.AccessCheck(this.OperateCode);
     }
     if (string.IsNullOrEmpty(base.Title))
     {
         base.Title = "我负责跟踪的订单";
     }
     this.EgvOrders.DataSource = Order.GetList(0, this.PageSize, this.SearchType, "", "", "");
     this.EgvOrders.DataBind();
     base.Subtitle = "共" + Order.GetTotalOfOrder(this.SearchType, "", "", "").ToString() + "条";
     base.TitleUrl = base.BasePath + SiteConfig.SiteOption.ManageDir + "/Shop/OrderList.aspx?SearchType=" + this.SearchType;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!PEContext.Current.Admin.IsSuperAdmin)
     {
         this.m_HasPermissions = RolePermissions.AccessCheck(this.OperateCode);
     }
     if (string.IsNullOrEmpty(base.Title))
     {
         base.Title = "库存报警的商品";
     }
     this.EgvStockAlarm.DataSource = Product.GetProductsList(0, this.PageSize, "SpeedSearch", this.Keyword, 0, 0, 100);
     this.EgvStockAlarm.DataBind();
     base.Subtitle = "共" + Product.GetTotalOfAllProducts("SpeedSearch", this.Keyword, 0, 0, 100).ToString() + "条";
     base.TitleUrl = base.BasePath + SiteConfig.SiteOption.ManageDir + "/Shop/ProductManage.aspx?SearchType=SpeedSearch&Keyword=" + this.Keyword;
 }
Beispiel #13
0
 protected void EgvBankList_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         BankInfo dataItem = e.Row.DataItem as BankInfo;
         if (dataItem != null)
         {
             bool       flag    = RolePermissions.AccessCheck(OperateCode.BankAccountManage);
             LinkButton button  = e.Row.Cells[7].FindControl("LbtnDefault") as LinkButton;
             LinkButton button2 = e.Row.Cells[7].FindControl("LbtnDisabled") as LinkButton;
             LinkButton button3 = e.Row.Cells[7].FindControl("LbtnDel") as LinkButton;
             button.Enabled  = flag && !dataItem.IsDefault;
             button2.Enabled = flag && !dataItem.IsDefault;
             button3.Enabled = flag && !dataItem.IsDefault;
         }
     }
 }
 private void InitPrivew()
 {
     if (PEContext.Current.Admin.UserName.Equals(BasePage.RequestString("UserName")))
     {
         this.BtnModifyUserSubmit.Enabled = true;
     }
     else
     {
         this.BtnModifyUserSubmit.Enabled = RolePermissions.AccessCheck(OperateCode.UserModify);
     }
     this.BtnAddPoint.Enabled       = RolePermissions.AccessCheck(OperateCode.UserPointManage);
     this.BtnAddValidDate.Enabled   = RolePermissions.AccessCheck(OperateCode.UserValidDateManage);
     this.BtnDelete.Enabled         = RolePermissions.AccessCheck(OperateCode.UserDelete);
     this.BtnLock.Enabled           = RolePermissions.AccessCheck(OperateCode.UserLock);
     this.BtnMinusPoint.Enabled     = RolePermissions.AccessCheck(OperateCode.UserPointManage);
     this.BtnMinusValidDate.Enabled = RolePermissions.AccessCheck(OperateCode.UserValidDateManage);
 }
Beispiel #15
0
 protected void EgvSpecialCategory_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         SpecialCategoryInfo dataItem = (SpecialCategoryInfo)e.Row.DataItem;
         HyperLink           link     = (HyperLink)e.Row.FindControl("HypSpecialAdd");
         HyperLink           link2    = (HyperLink)e.Row.FindControl("HypSpecialBathAdd");
         HyperLink           link3    = (HyperLink)e.Row.FindControl("HypSpecialOrder");
         link2.Text        = "批量添加专题";
         link.Text         = "添加专题";
         link3.Text        = "专题排序";
         link.NavigateUrl  = "Special.aspx?SpecialCategoryID=" + dataItem.SpecialCategoryId.ToString();
         link2.NavigateUrl = "Special.aspx?SpecialCategoryID=" + dataItem.SpecialCategoryId.ToString() + "&Action=add&AddType=BatchSpecial";
         link3.NavigateUrl = "SpecialOrder.aspx?SpecialCategoryID=" + dataItem.SpecialCategoryId.ToString();
         link.Enabled      = RolePermissions.AccessCheck(OperateCode.SpecialManage);
         link3.Enabled     = RolePermissions.AccessCheck(OperateCode.SpecialManage);
     }
 }
        public static DataActionState Add(UserGroupsInfo userGroupsInfo)
        {
            if (!RolePermissions.AccessCheck(OperateCode.UserGroupManage))
            {
                throw new CustomException(PEExceptionType.ExceedAuthority);
            }
            DataActionState unknown = DataActionState.Unknown;

            if (GroupNameIsExist(userGroupsInfo.GroupName))
            {
                return(DataActionState.Exist);
            }
            if (dal.Add(userGroupsInfo))
            {
                unknown = DataActionState.Successed;
            }
            return(unknown);
        }
Beispiel #17
0
 protected override void OnAuthorizeWebPart(WebPartAuthorizationEventArgs e)
 {
     if (PEContext.Current.Admin.Identity.IsAuthenticated)
     {
         if (!string.IsNullOrEmpty(e.AuthorizationFilter) && Enum.IsDefined(typeof(OperateCode), e.AuthorizationFilter))
         {
             OperateCode operateCode = (OperateCode)Enum.Parse(typeof(OperateCode), e.AuthorizationFilter);
             if (operateCode == OperateCode.None)
             {
                 e.IsAuthorized = true;
             }
             else
             {
                 e.IsAuthorized = RolePermissions.AccessCheck(operateCode);
             }
         }
     }
     else
     {
         e.IsAuthorized = false;
     }
 }
Beispiel #18
0
        /// <summary>
        /// 用来判断用户对该页面是否有访问权限
        /// </summary>
        private void CheckPagePermission()
        {
            bool        flag     = false;
            string      str      = base.Request.AppRelativeCurrentExecutionFilePath.ToLower(CultureInfo.CurrentCulture).Replace("~/admin/", "");
            string      strA     = "";
            XmlDocument document = SiteCache.Get("CK_System_XmlDocument_FilePermissionConfig") as XmlDocument;//从缓存获取文件权限

            if (document == null)
            {
                //缓存对象所依赖的文件或目录的路径。当该资源更改时,缓存的对象将过时,并从缓存中移除
                string str3;
                document = new XmlDocument();
                HttpContext current = HttpContext.Current;
                if (current != null)
                {
                    str3 = current.Server.MapPath("~/Config/Security.config");
                }
                else
                {
                    str3 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config/Security.config");
                }
                try
                {
                    document.Load(str3);
                }
                catch (XmlException exception)
                {
                    WriteErrMsg("Security.config配置文件不符合XML规范,具体错误信息:" + exception.Message);
                }
                // CacheDpendency(string filename)初始化 CacheDependency 类的新实例,它监视文件或目录的更改情况
                SiteCache.Insert("CK_System_XmlDocument_FilePermissionConfig", document, new CacheDependency(str3));
            }
            XmlNode xmlNode = document.SelectSingleNode("security/checkPermissions");

            if (xmlNode == null)
            {
                WriteErrMsg("Security.config配置文件不存在checkPermissions根元素");
            }
            string      attributeValue = GetAttributeValue(xmlNode, "mode");
            XmlNodeList list           = document.SelectNodes("//*[@url='" + str + "']");

            if ((string.Compare(attributeValue, "All", StringComparison.CurrentCultureIgnoreCase) == 0) && (list.Count <= 0))
            {
                WriteErrMsg("<li>对不起,您没有当前页面的访问权限!</li>");
            }
            if (list.Count > 0)
            {
                foreach (XmlNode node2 in list)
                {
                    string[] strArray4;
                    strA = GetAttributeValue(node2, "operateCode");
                    if (string.Compare(strA, "None", StringComparison.CurrentCultureIgnoreCase) == 0)
                    {
                        flag = true;
                        break;
                    }
                    if (!strA.Contains(","))
                    {
                        goto Label_022D;
                    }
                    string[] strArray = strA.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                    string   str5     = GetAttributeValue(node2, "checkType");
                    if (string.IsNullOrEmpty(str5))
                    {
                        str5 = "or";
                    }
                    string str8 = str5;
                    if (str8 != null)
                    {
                        if (!(str8 == "or"))
                        {
                            if (str8 == "and")
                            {
                                goto Label_0200;
                            }
                        }
                        else
                        {
                            foreach (string str6 in strArray)
                            {
                                if (RolePermissions.AccessCheck(str6))
                                {
                                    flag = true;//为真时返回
                                    break;
                                }
                            }
                        }
                    }
                    goto Label_0237;
Label_0200:
                    strArray4 = strArray;
                    for (int i = 0; i < strArray4.Length; i++)
                    {
                        string operateCode = strArray4[i];
                        if (!RolePermissions.AccessCheck(operateCode))
                        {
                            flag = false;//为假时返回
                            break;
                        }
                    }
                    goto Label_0237;
Label_022D:
                    if (RolePermissions.AccessCheck(strA))
                    {
                        flag = true;
                    }
Label_0237:
                    if (flag)
                    {
                        break;
                    }
                }
                if (!flag)
                {
                    WriteErrMsg("<li>对不起,您没有当前页面的访问权限!</li>");
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     this.LitSiteConfig.Visible = RolePermissions.AccessCheck(OperateCode.SiteConfig);
     this.LitFrontPageTemplateConfig.Visible = RolePermissions.AccessCheck(OperateCode.DynamicPageConfig);
     this.LtrShop.Visible = BasePage.IseShop;
 }
        private void Initial()
        {
            this.InitCreateHtmlControl();
            if (!this.Page.IsPostBack)
            {
                this.RadNeedCache0.Attributes.Add("onclick", "javascript:TrSetCacheTime.style.display='none';");
                this.RadNeedCache1.Attributes.Add("onclick", "javascript:TrSetCacheTime.style.display='';");
                IList <NodeInfo> nodeNameForContainerItems = Nodes.GetNodeNameForContainerItems();
                if (nodeNameForContainerItems.Count < 1)
                {
                    ListItem item = new ListItem("无节点,请先添加节点", "0");
                    item.Enabled = false;
                }
                else
                {
                    this.LstNodes.DataSource = nodeNameForContainerItems;
                    this.LstNodes.DataBind();
                }
            }
            StringBuilder builder = new StringBuilder();

            builder.Append("<script type=\"text/javascript\">");
            builder.Append("function SelectAll(){");
            builder.Append("for(var i=0;i<document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').length;i++){");
            builder.Append("document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').options[i].selected=true;}}");
            builder.Append("function UnSelectAll(){");
            builder.Append("for(var i=0;i<document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').length;i++){");
            builder.Append("document.getElementById('");
            builder.Append(this.LstNodes.ClientID);
            builder.Append("').options[i].selected=false;}}");
            builder.Append("</script>");
            base.ClientScript.RegisterClientScriptBlock(base.GetType(), "Select", builder.ToString());
            if (!this.Page.IsPostBack)
            {
                IList <NodeInfo> nodeNameForItemsExceptOutLinks = Nodes.GetNodeNameForItemsExceptOutLinks();
                this.LstRelationNodes.DataSource     = nodeNameForItemsExceptOutLinks;
                this.LstRelationNodes.DataTextField  = "NodeName";
                this.LstRelationNodes.DataValueField = "NodeId";
                this.LstRelationNodes.DataBind();
                IList <UserGroupsInfo> userGroupList = UserGroups.GetUserGroupList(0, 0);
                this.EgvPermissions.DataSource = userGroupList;
                this.EgvPermissions.DataBind();
                this.EgvRoleView.DataSource = UserRole.GetRoleList();
                this.EgvRoleView.DataBind();
                IList <ModelInfo> modelList = ModelManager.GetModelList(ModelType.Content, ModelShowType.Enable);
                this.RepContentModelTemplate.DataSource = modelList;
                this.RepContentModelTemplate.DataBind();
                this.RepShopModelTemplate.DataSource = ModelManager.GetModelList(ModelType.Shop, ModelShowType.Enable);
                this.RepShopModelTemplate.DataBind();
                IList <WorkFlowsInfo> workFlowsList = WorkFlow.GetWorkFlowsList();
                this.DropWorkFlow.DataSource = workFlowsList;
                this.DropWorkFlow.DataBind();
                this.LstRelationSpecial.DataSource = Special.GetSpecialList();
                this.LstRelationSpecial.DataBind();
            }
            bool flag  = RolePermissions.AccessCheck(OperateCode.AdministratorManage);
            bool flag2 = RolePermissions.AccessCheck(OperateCode.UserGroupManage);

            if (!flag)
            {
                this.TdRolePermissions.Style.Add("display", "none");
            }
            if (!flag2)
            {
                this.TdGroupPermissions.Style.Add("display", "none");
            }
            if (!flag && !flag2)
            {
                this.TabTitle5.Style.Add("display", "none");
            }
            if (!SiteConfig.SiteOption.EnablePointMoneyExp)
            {
                this.TabTitle2.Style.Add("display", "none");
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     RolePermissions.AccessCheck(OperateCode.SpecialManage);
 }
Beispiel #22
0
 public static bool AddSpecial(SpecialInfo specialInfo)
 {
     RolePermissions.AccessCheck(OperateCode.SpecialManage);
     return(dal.AddSpecial(specialInfo));
 }
Beispiel #23
0
        private void InitialText()
        {
            RolePermissions.AccessCheck(OperateCode.SpecialManage);
            string str = BasePage.RequestStringToLower("Action", "add");

            if (this.Page.IsPostBack)
            {
                return;
            }
            if (str == "copy")
            {
                this.specialId = Special.GetSpecialByIdCopySpecial(this.specialId);
                if (this.specialId > 0)
                {
                    this.InputPermissions(this.specialId);
                    this.InputRolePermission(this.specialId);
                    IncludeFile.CreateIncludeFileByAssociateType(AssociateType.Special);
                    base.Response.Write("<script type='text/javascript'>parent.frames[\"left\"].location.reload();</script>");
                    AdminPage.WriteSuccessMsg("<li>专题信息保存成功!</li>", "Special.aspx?Action=Modify&SpecialID=" + this.specialId.ToString());
                }
                else
                {
                    AdminPage.WriteErrMsg("<li>发生错误!</li>", "");
                }
            }
            IList <SpecialCategoryInfo> specialCategoryList = Special.GetSpecialCategoryList();

            this.DropSpecialCategory.SelectedValue = this.specialCategoryId.ToString();
            this.DropSpecialCategory.DataSource    = specialCategoryList;
            this.DropSpecialCategory.DataBind();
            ((DropDownList)this.PnlCustomFileds.FindControl("DropCustomNum")).Attributes.Add("onchange", "setFileFileds(this.value)");
            this.InitEChklPermission();
            string str2 = str;

            if (str2 != null)
            {
                if (!(str2 == "add"))
                {
                    if (str2 == "modify")
                    {
                        this.SmpNavigator.CurrentNode = "修改专题";
                        this.EBtnModify.Visible       = true;
                        if (!this.Page.IsPostBack)
                        {
                            this.BindSpecial();
                        }
                        goto Label_023A;
                    }
                }
                else
                {
                    this.SmpNavigator.CurrentNode = "添加专题";
                    this.EBtnAdd.Visible          = true;
                    BasePage.SetSelectedIndexByValue(this.DropSpecialCategory, this.specialCategoryId.ToString());
                    if (BasePage.RequestString("AddType").CompareTo("BatchSpecial") == 0)
                    {
                        this.SpecialName.Visible       = false;
                        this.SpecialIdentifier.Visible = false;
                        this.SpecialDir.Visible        = false;
                        this.BatchSpecial.Visible      = true;
                        this.TxtSpecialNames.Attributes.Add("onchange", "GetBatchInitial();");
                    }
                    else
                    {
                        this.TxtSpecialName.Attributes.Add("onchange", "GetInitial();");
                    }
                    goto Label_023A;
                }
            }
            this.SmpNavigator.CurrentNode = "添加专题";
            this.EBtnAdd.Visible          = true;
Label_023A:
            if (!RolePermissions.AccessCheck(OperateCode.AdministratorManage))
            {
                this.TabTitle1.Style.Add("display", "none");
            }
        }