Esempio n. 1
0
        public int AceptarPeticionAmistad(int pe_peticion)
        {
            /*Codigos de error                          */
            /* 0 --> No existe peticion                    */
            /* -1 --> Ya esta en mi lista de amigos     */
            /* -2 --> Ya esta en mi lista de bloqueados */
            /* 1 --> Petición aceptada                  */
            int       ret   = -1;
            UsuarioCP usuCP = new UsuarioCP();

            try
            { SessionInitializeTransaction();
              UsuarioCAD usuCAD = new UsuarioCAD(session);
              UsuarioCEN usuCEN = new UsuarioCEN(usuCAD);

              PeticionAmistadCEN petCEN   = new PeticionAmistadCEN(new PeticionAmistadCAD(session));
              PeticionAmistadEN  peticion = petCEN.get_IPeticionAmistadCAD().ReadOIDDefault(pe_peticion);


              PeticionAmistadEN petEN = petCEN.DamePeticionAmistadPorOID(pe_peticion);
              UsuarioEN         emiEN = usuCEN.DameUsuarioPorOID(petEN.Emisor.Id);

              System.Collections.Generic.IList <UsuarioEN> l_amigos = usuCEN.ObtenerAmigos(petEN.Receptor.Id, 0, -1);
              System.Collections.Generic.IList <UsuarioEN> l_bloque = usuCEN.ObtenerBloqueadosSP(petEN.Receptor.Id);

              if (petEN == null)
              {
                  return(0);
              }

              if (l_amigos.Contains(emiEN))
              {
                  return(-1);
              }

              if (l_bloque.Contains(emiEN))
              {
                  return(-2);
              }

              petCEN.AceptarPeticionAmistad(pe_peticion);

              usuCP.AgregarAmigo(petEN.Emisor.Id, petEN.Receptor.Id);

              SessionCommit(); }
            catch (Exception ex)
            {
                SessionRollBack();
                throw ex;
            }
            finally
            {
                SessionClose();
            }
            return(ret);
        }
Esempio n. 2
0
 private bool DeleteValidate(System.Collections.Generic.IList <string> attributeIds)
 {
     System.Collections.Generic.IList <string> notDelResourceType = this.GetNotDelResourceType();
     foreach (string current in notDelResourceType)
     {
         if (attributeIds.Contains(current))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 3
0
        public static async Task CreateUserRoles(IApplicationBuilder app)
        {
            using (IServiceScope scope = app.ApplicationServices.CreateScope())
            {
                RoleManager <IdentityRole>    RoleManager = scope.ServiceProvider.GetRequiredService <RoleManager <IdentityRole> >();
                UserManager <ApplicationUser> UserManager = scope.ServiceProvider.GetRequiredService <UserManager <ApplicationUser> >();
                //var JobsRepo = scope.ServiceProvider.GetRequiredService<IJobPostingRepository>();
                //await JobsRepo.BuildCache();
                ApplicationDbContext content = scope.ServiceProvider.GetRequiredService <ApplicationDbContext>();

                IdentityResult roleResult;

                //Adding Admin Role
                bool roleCheck = await RoleManager.RoleExistsAsync("Admin");

                if (!roleCheck)
                {
                    //create the roles and seed them to the database
                    roleResult = await RoleManager.CreateAsync(new IdentityRole("Admin"));
                }

                //Assign Admin role to the main User here we have given our newly registered
                //login id for Admin management
                // Also Assigning them Claims to perform CUD operations
                ApplicationUser user = await UserManager.FindByEmailAsync("*****@*****.**");

                if (user != null)
                {
                    System.Collections.Generic.IList <string> currentUserRoles = await UserManager.GetRolesAsync(user);

                    if (!currentUserRoles.Contains("Admin"))
                    {
                        await UserManager.AddToRoleAsync(user, "Admin");
                    }

                    System.Collections.Generic.IList <Claim> currentClaims = await UserManager.GetClaimsAsync(user);

                    if (!currentClaims.Any())
                    {
                        Claim CanCreatePostingClaim = new Claim("CanCreatePosting", "True");
                        await UserManager.AddClaimAsync(user, CanCreatePostingClaim);

                        Claim CanEditPostingClaim = new Claim("CanEditPosting", "True");
                        await UserManager.AddClaimAsync(user, CanEditPostingClaim);

                        Claim CanDeletePostingClaim = new Claim("CanDeletePosting", "True");
                        await UserManager.AddClaimAsync(user, CanDeletePostingClaim);
                    }
                }
            }
        }
Esempio n. 4
0
 private void LoadData(int roleId)
 {
     System.Collections.Generic.IList <int> privilegeByRoles = ManagerHelper.GetPrivilegeByRoles(roleId);
     this.cbSummary.Checked                           = privilegeByRoles.Contains(1000);
     this.cbSiteContent.Checked                       = privilegeByRoles.Contains(1001);
     this.cbVotes.Checked                             = privilegeByRoles.Contains(2009);
     this.cbShippingTemplets.Checked                  = privilegeByRoles.Contains(1006);
     this.cbExpressComputerpes.Checked                = privilegeByRoles.Contains(1007);
     this.cbPictureMange.Checked                      = privilegeByRoles.Contains(1009);
     this.cbProductTypesView.Checked                  = privilegeByRoles.Contains(3017);
     this.cbProductTypesAdd.Checked                   = privilegeByRoles.Contains(3018);
     this.cbProductTypesEdit.Checked                  = privilegeByRoles.Contains(3019);
     this.cbProductTypesDelete.Checked                = privilegeByRoles.Contains(3020);
     this.cbManageCategoriesView.Checked              = privilegeByRoles.Contains(3021);
     this.cbManageCategoriesAdd.Checked               = privilegeByRoles.Contains(3022);
     this.cbManageCategoriesEdit.Checked              = privilegeByRoles.Contains(3023);
     this.cbManageCategoriesDelete.Checked            = privilegeByRoles.Contains(3024);
     this.cbBrandCategories.Checked                   = privilegeByRoles.Contains(3025);
     this.cbManageProductsView.Checked                = privilegeByRoles.Contains(3001);
     this.cbManageProductsAdd.Checked                 = privilegeByRoles.Contains(3002);
     this.cbManageProductsEdit.Checked                = privilegeByRoles.Contains(3003);
     this.cbManageProductsDelete.Checked              = privilegeByRoles.Contains(3004);
     this.cbInStock.Checked                           = privilegeByRoles.Contains(3005);
     this.cbManageProductsUp.Checked                  = privilegeByRoles.Contains(3006);
     this.cbManageProductsDown.Checked                = privilegeByRoles.Contains(3007);
     this.cbProductUnclassified.Checked               = privilegeByRoles.Contains(3010);
     this.cbProductBatchUpload.Checked                = privilegeByRoles.Contains(3012);
     this.cbProductBatchExport.Checked                = privilegeByRoles.Contains(3026);
     this.cbSubjectProducts.Checked                   = privilegeByRoles.Contains(3011);
     this.cbClientGroup.Checked                       = privilegeByRoles.Contains(7007);
     this.cbClientActivy.Checked                      = privilegeByRoles.Contains(7009);
     this.cbClientNew.Checked                         = privilegeByRoles.Contains(7008);
     this.cbClientSleep.Checked                       = privilegeByRoles.Contains(7010);
     this.cbMemberRanksView.Checked                   = privilegeByRoles.Contains(5004);
     this.cbMemberRanksAdd.Checked                    = privilegeByRoles.Contains(5005);
     this.cbMemberRanksEdit.Checked                   = privilegeByRoles.Contains(5006);
     this.cbMemberRanksDelete.Checked                 = privilegeByRoles.Contains(5007);
     this.cbManageMembersView.Checked                 = privilegeByRoles.Contains(5001);
     this.cbManageMembersEdit.Checked                 = privilegeByRoles.Contains(5002);
     this.cbManageMembersDelete.Checked               = privilegeByRoles.Contains(5003);
     this.cbMemberArealDistributionStatistics.Checked = privilegeByRoles.Contains(10008);
     this.cbUserIncreaseStatistics.Checked            = privilegeByRoles.Contains(10009);
     this.cbMemberRanking.Checked                     = privilegeByRoles.Contains(10007);
     this.cbManageOrderView.Checked                   = privilegeByRoles.Contains(4001);
     this.cbManageOrderDelete.Checked                 = privilegeByRoles.Contains(4002);
     this.cbManageOrderEdit.Checked                   = privilegeByRoles.Contains(4003);
     this.cbManageOrderConfirm.Checked                = privilegeByRoles.Contains(4004);
     this.cbManageOrderSendedGoods.Checked            = privilegeByRoles.Contains(4005);
     this.cbExpressPrint.Checked                      = privilegeByRoles.Contains(4006);
     this.cbManageOrderRemark.Checked                 = privilegeByRoles.Contains(4008);
     this.cbExpressTemplates.Checked                  = privilegeByRoles.Contains(4009);
     this.cbShipper.Checked                           = privilegeByRoles.Contains(4010);
     this.cbPaymentModes.Checked                      = privilegeByRoles.Contains(1004);
     this.cbShippingModes.Checked                     = privilegeByRoles.Contains(1005);
     this.cbOrderRefundApply.Checked                  = privilegeByRoles.Contains(4012);
     this.cbOrderReturnsApply.Checked                 = privilegeByRoles.Contains(4014);
     this.cbOrderReplaceApply.Checked                 = privilegeByRoles.Contains(4013);
     this.cbSaleTotalStatistics.Checked               = privilegeByRoles.Contains(10001);
     this.cbUserOrderStatistics.Checked               = privilegeByRoles.Contains(10002);
     this.cbSaleList.Checked                          = privilegeByRoles.Contains(10003);
     this.cbSaleTargetAnalyse.Checked                 = privilegeByRoles.Contains(10004);
     this.cbProductSaleRanking.Checked                = privilegeByRoles.Contains(10005);
     this.cbProductSaleStatistics.Checked             = privilegeByRoles.Contains(10006);
     this.cbGifts.Checked                             = privilegeByRoles.Contains(8001);
     this.cbGroupBuy.Checked                          = privilegeByRoles.Contains(8005);
     this.cbCountDown.Checked                         = privilegeByRoles.Contains(8006);
     this.cbCoupons.Checked                           = privilegeByRoles.Contains(8007);
     this.cbProductPromotion.Checked                  = privilegeByRoles.Contains(8002);
     this.cbOrderPromotion.Checked                    = privilegeByRoles.Contains(8003);
 }
Esempio n. 5
0
 public bool Contains(T item)
 {
     return(list.Contains(item));
 }
Esempio n. 6
0
        /// <summary>
        /// 该游客是否可以申请
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string isHave(string id, List <int> ApplyFlights, List <int> RefundFlights)
        {
            EyouSoft.BLL.PlanStruture.PlaneTicket bll = new EyouSoft.BLL.PlanStruture.PlaneTicket();
            string strvalue = "";

            #region 原来的判断
            if (CustomerList == null)
            {
                CustomerList = bll.CustomerList(Utils.GetQueryStringValue("tourId"));
            }
            if (CustomerList != null)
            {
                if (CustomerList.Contains(id))
                {
                    string iD = Utils.GetString(Request.QueryString["id"], "");
                    if (id != "" && modelinfo == null)
                    {
                        modelinfo = bll.GetTicketOutListModel(iD);
                    }
                    if (modelinfo != null)
                    {
                        if (modelinfo.CustomerInfoList.Where(x => x.ID == id).Count() > 0)
                        {
                            strvalue = "checked='true'";
                        }
                        else
                        {
                            ////////判断是否可选
                            //strvalue = "disabled=\"disabled\"";

                            #region 配置判断
                            if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.None)
                            {
                                strvalue = "";
                            }
                            else
                            {
                                int istuipiao = 0, enumtuipiao = 0;//1有退票,2全部退票,0没有退票
                                if (ApplyFlights != null)
                                {
                                    if (RefundFlights != null)
                                    {
                                        foreach (var v in ApplyFlights)
                                        {
                                            var l = RefundFlights.Where(x => x == v);
                                            if (l.Count() > 0)
                                            {
                                                istuipiao++;
                                            }
                                        }
                                    }
                                    if (istuipiao > 0)
                                    {
                                        enumtuipiao = 1;
                                    }
                                    if (istuipiao == ApplyFlights.Count)
                                    {
                                        enumtuipiao = 2;
                                    }
                                    if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.LeastOne)
                                    {
                                        if (enumtuipiao == 0)
                                        {
                                            strvalue += " disabled=\"disabled\"";
                                        }
                                    }
                                    if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.All)
                                    {
                                        if (enumtuipiao != 2)
                                        {
                                            strvalue += " disabled=\"disabled\"";
                                        }
                                    }
                                }
                            }

                            #endregion
                        }
                    }
                    else
                    {
                        //strvalue = "disabled=\"disabled\"";
                        #region 配置判断
                        if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.None)
                        {
                            strvalue = "";
                        }
                        else
                        {
                            int istuipiao = 0, enumtuipiao = 0;//1有退票,2全部退票,0没有退票
                            if (ApplyFlights != null)
                            {
                                if (RefundFlights != null)
                                {
                                    foreach (var v in ApplyFlights)
                                    {
                                        var l = RefundFlights.Where(x => x == v);
                                        if (l.Count() > 0)
                                        {
                                            istuipiao++;
                                        }
                                    }
                                }
                                if (istuipiao > 0)
                                {
                                    enumtuipiao = 1;
                                }
                                if (istuipiao == ApplyFlights.Count)
                                {
                                    enumtuipiao = 2;
                                }
                                if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.LeastOne)
                                {
                                    if (enumtuipiao == 0)
                                    {
                                        strvalue += " disabled=\"disabled\"";
                                    }
                                }
                                if (TicketTraveller == EyouSoft.Model.EnumType.CompanyStructure.TicketTravellerCheckedType.All)
                                {
                                    if (enumtuipiao != 2)
                                    {
                                        strvalue += " disabled=\"disabled\"";
                                    }
                                }
                            }
                        }

                        #endregion
                    }
                }
                else
                {
                    strvalue = "";
                }
            }
            else
            {
                strvalue = "";
            }
            #endregion
            if (id == Utils.GetQueryStringValue("cid"))
            {
                strvalue += " checked=\"true\"";
            }
            return(strvalue);
        }
Esempio n. 7
0
 private bool CheckPrivilegeReturn(string Username, Privilege privilegeCode)
 {
     System.Collections.Generic.IList <string> userPrivileges = EcShop.Membership.Core.RoleHelper.GetUserPrivileges(Username);
     return(userPrivileges != null && userPrivileges.Count != 0 && userPrivileges.Contains(privilegeCode.ToString()));
 }
Esempio n. 8
0
        private void btnAddBalance_Click(object sender, System.EventArgs e)
        {
            System.Collections.Generic.IList <int> userPrivileges = Hidistro.Membership.Core.RoleHelper.GetUserPrivileges(Hidistro.Membership.Context.HiContext.Current.User.Username);
            if (!userPrivileges.Contains(9002) && Hidistro.Membership.Context.HiContext.Current.User.UserRole != Hidistro.Membership.Core.Enums.UserRole.SiteManager)
            {
                this.ShowMsg("权限不够", false);
                return;
            }
            int num = 0;

            if (this.txtReCharge.Text.Trim().IndexOf(".") > 0)
            {
                num = this.txtReCharge.Text.Trim().Substring(this.txtReCharge.Text.Trim().IndexOf(".") + 1).Length;
            }
            int     userId = int.Parse(this.currentUserId.Value);
            decimal num2;

            if (!decimal.TryParse(this.txtReCharge.Text.Trim(), out num2) || num > 2)
            {
                this.ShowMsg("本次充值要给当前客户加款的金额只能是数值,且不能超过2位小数", false);
                return;
            }
            if (num2 < -10000000m || num2 > 10000000m)
            {
                this.ShowMsg("金额大小必须在正负1000万之间", false);
                return;
            }
            Hidistro.Membership.Context.Member member = Hidistro.Membership.Context.Users.GetUser(userId, false) as Hidistro.Membership.Context.Member;
            if (member == null || !member.IsOpenBalance)
            {
                this.ShowMsg("本次充值已失败,该用户不存在或预付款还没有开通", false);
                return;
            }
            decimal           balance           = num2 + member.Balance;
            BalanceDetailInfo balanceDetailInfo = new BalanceDetailInfo();

            balanceDetailInfo.UserId    = userId;
            balanceDetailInfo.UserName  = member.Username;
            balanceDetailInfo.TradeDate = System.DateTime.Now;
            balanceDetailInfo.TradeType = TradeTypes.BackgroundAddmoney;
            balanceDetailInfo.Income    = new decimal?(num2);
            balanceDetailInfo.Balance   = balance;
            balanceDetailInfo.Remark    = Globals.HtmlEncode(this.txtRemark.Text.Trim());
            ValidationResults validationResults = Validation.Validate <BalanceDetailInfo>(balanceDetailInfo, new string[]
            {
                "ValBalanceDetail"
            });
            string text = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults)
                {
                    text += Formatter.FormatErrorMessage(current.Message);
                }
                this.ShowMsg(text, false);
                return;
            }
            if (MemberHelper.AddBalance(balanceDetailInfo, num2))
            {
                this.txtReCharge.Text = "";
                this.ReBind(false);
            }
        }
Esempio n. 9
0
 private void LoadData(System.Guid roleId)
 {
     System.Collections.Generic.IList <int> privilegeByRoles = Hidistro.Membership.Core.RoleHelper.GetPrivilegeByRoles(roleId);
     this.cbSummary.Checked                           = privilegeByRoles.Contains(1000);
     this.cbSiteContent.Checked                       = privilegeByRoles.Contains(1001);
     this.cbVotes.Checked                             = privilegeByRoles.Contains(2009);
     this.cbFriendlyLinks.Checked                     = privilegeByRoles.Contains(2007);
     this.cbManageThemes.Checked                      = privilegeByRoles.Contains(2001);
     this.cbManageHotKeywords.Checked                 = privilegeByRoles.Contains(2008);
     this.cbAfficheList.Checked                       = privilegeByRoles.Contains(2002);
     this.cbHelpCategories.Checked                    = privilegeByRoles.Contains(2003);
     this.cbHelpList.Checked                          = privilegeByRoles.Contains(2004);
     this.cbArticleCategories.Checked                 = privilegeByRoles.Contains(2005);
     this.cbArticleList.Checked                       = privilegeByRoles.Contains(2006);
     this.cbEmailSettings.Checked                     = privilegeByRoles.Contains(1002);
     this.cbSMSSettings.Checked                       = privilegeByRoles.Contains(1003);
     this.cbMessageTemplets.Checked                   = privilegeByRoles.Contains(1008);
     this.cbShippingTemplets.Checked                  = privilegeByRoles.Contains(1006);
     this.cbExpressComputerpes.Checked                = privilegeByRoles.Contains(1007);
     this.cbPictureMange.Checked                      = privilegeByRoles.Contains(1009);
     this.cbDistributorGradesView.Checked             = privilegeByRoles.Contains(6001);
     this.cbDistributorGradesAdd.Checked              = privilegeByRoles.Contains(6002);
     this.cbDistributorGradesEdit.Checked             = privilegeByRoles.Contains(6003);
     this.cbDistributorGradesDelete.Checked           = privilegeByRoles.Contains(6004);
     this.cbDistributorsView.Checked                  = privilegeByRoles.Contains(6005);
     this.cbDistributorsEdit.Checked                  = privilegeByRoles.Contains(6006);
     this.cbDistributorsDelete.Checked                = privilegeByRoles.Contains(6007);
     this.cbDistributorsRequests.Checked              = privilegeByRoles.Contains(6008);
     this.cbDistributorsRequestInstruction.Checked    = privilegeByRoles.Contains(6009);
     this.cbManagePurchaseOrderView.Checked           = privilegeByRoles.Contains(11001);
     this.cbManagePurchaseOrderEdit.Checked           = privilegeByRoles.Contains(11002);
     this.cbManagePurchaseOrderDelete.Checked         = privilegeByRoles.Contains(11003);
     this.cbPurchaseOrderSendGoods.Checked            = privilegeByRoles.Contains(11004);
     this.cbPurchaseOrderRemark.Checked               = privilegeByRoles.Contains(11006);
     this.cbPurchaseOrderRefundApply.Checked          = privilegeByRoles.Contains(11007);
     this.cbPurchaseOrderReturnsApply.Checked         = privilegeByRoles.Contains(11009);
     this.cbPurchaseOrderReplaceApply.Checked         = privilegeByRoles.Contains(11008);
     this.cbDistributorAccount.Checked                = privilegeByRoles.Contains(9004);
     this.cbDistributorReCharge.Checked               = privilegeByRoles.Contains(9005);
     this.cbDistributorBalanceDrawRequest.Checked     = privilegeByRoles.Contains(9006);
     this.cbDistributionReport.Checked                = privilegeByRoles.Contains(10010);
     this.cbPurchaseOrderStatistics.Checked           = privilegeByRoles.Contains(10011);
     this.cbDistributionProductSaleRanking.Checked    = privilegeByRoles.Contains(100112);
     this.cbDistributorAchievementsRanking.Checked    = privilegeByRoles.Contains(100113);
     this.cbManageDistributorSites.Checked            = privilegeByRoles.Contains(6010);
     this.cbDistributorSiteRequests.Checked           = privilegeByRoles.Contains(6011);
     this.cbProductLinesView.Checked                  = privilegeByRoles.Contains(3013);
     this.cbAddProductLine.Checked                    = privilegeByRoles.Contains(3014);
     this.cbEditProductLine.Checked                   = privilegeByRoles.Contains(3015);
     this.cbDeleteProductLine.Checked                 = privilegeByRoles.Contains(3016);
     this.cbProductTypesView.Checked                  = privilegeByRoles.Contains(3017);
     this.cbProductTypesAdd.Checked                   = privilegeByRoles.Contains(3018);
     this.cbProductTypesEdit.Checked                  = privilegeByRoles.Contains(3019);
     this.cbProductTypesDelete.Checked                = privilegeByRoles.Contains(3020);
     this.cbManageCategoriesView.Checked              = privilegeByRoles.Contains(3021);
     this.cbManageCategoriesAdd.Checked               = privilegeByRoles.Contains(3022);
     this.cbManageCategoriesEdit.Checked              = privilegeByRoles.Contains(3023);
     this.cbManageCategoriesDelete.Checked            = privilegeByRoles.Contains(3024);
     this.cbBrandCategories.Checked                   = privilegeByRoles.Contains(3025);
     this.cbManageProductsView.Checked                = privilegeByRoles.Contains(3001);
     this.cbManageProductsAdd.Checked                 = privilegeByRoles.Contains(3002);
     this.cbManageProductsEdit.Checked                = privilegeByRoles.Contains(3003);
     this.cbManageProductsDelete.Checked              = privilegeByRoles.Contains(3004);
     this.cbInStock.Checked                           = privilegeByRoles.Contains(3005);
     this.cbManageProductsUp.Checked                  = privilegeByRoles.Contains(3006);
     this.cbManageProductsDown.Checked                = privilegeByRoles.Contains(3007);
     this.cbPackProduct.Checked                       = privilegeByRoles.Contains(3008);
     this.cbUpPackProduct.Checked                     = privilegeByRoles.Contains(3009);
     this.cbProductUnclassified.Checked               = privilegeByRoles.Contains(3010);
     this.cbProductBatchUpload.Checked                = privilegeByRoles.Contains(3012);
     this.cbProductBatchExport.Checked                = privilegeByRoles.Contains(3026);
     this.cbMakeProductsPack.Checked                  = privilegeByRoles.Contains(6012);
     this.ckTaobaoNote.Checked                        = privilegeByRoles.Contains(6013);
     this.cbDistributorSendedMsg.Checked              = privilegeByRoles.Contains(6014);
     this.cbDistributorAcceptMsg.Checked              = privilegeByRoles.Contains(6015);
     this.cbDistributorNewMsg.Checked                 = privilegeByRoles.Contains(6016);
     this.cbSubjectProducts.Checked                   = privilegeByRoles.Contains(3011);
     this.cbClientGroup.Checked                       = privilegeByRoles.Contains(7007);
     this.cbClientActivy.Checked                      = privilegeByRoles.Contains(7009);
     this.cbClientNew.Checked                         = privilegeByRoles.Contains(7008);
     this.cbClientSleep.Checked                       = privilegeByRoles.Contains(7010);
     this.cbMemberRanksView.Checked                   = privilegeByRoles.Contains(5004);
     this.cbMemberRanksAdd.Checked                    = privilegeByRoles.Contains(5005);
     this.cbMemberRanksEdit.Checked                   = privilegeByRoles.Contains(5006);
     this.cbMemberRanksDelete.Checked                 = privilegeByRoles.Contains(5007);
     this.cbManageMembersView.Checked                 = privilegeByRoles.Contains(5001);
     this.cbManageMembersEdit.Checked                 = privilegeByRoles.Contains(5002);
     this.cbManageMembersDelete.Checked               = privilegeByRoles.Contains(5003);
     this.cbBalanceDrawRequest.Checked                = privilegeByRoles.Contains(9003);
     this.cbAccountSummary.Checked                    = privilegeByRoles.Contains(9001);
     this.cbReCharge.Checked                          = privilegeByRoles.Contains(9002);
     this.cbBalanceDetailsStatistics.Checked          = privilegeByRoles.Contains(5010);
     this.cbBalanceDrawRequestStatistics.Checked      = privilegeByRoles.Contains(5011);
     this.cbMemberArealDistributionStatistics.Checked = privilegeByRoles.Contains(10008);
     this.cbUserIncreaseStatistics.Checked            = privilegeByRoles.Contains(10009);
     this.cbMemberRanking.Checked                     = privilegeByRoles.Contains(10007);
     this.cbOpenIdServices.Checked                    = privilegeByRoles.Contains(5008);
     this.cbOpenIdSettings.Checked                    = privilegeByRoles.Contains(5009);
     this.cbManageOrderView.Checked                   = privilegeByRoles.Contains(4001);
     this.cbManageOrderDelete.Checked                 = privilegeByRoles.Contains(4002);
     this.cbManageOrderEdit.Checked                   = privilegeByRoles.Contains(4003);
     this.cbManageOrderConfirm.Checked                = privilegeByRoles.Contains(4004);
     this.cbManageOrderSendedGoods.Checked            = privilegeByRoles.Contains(4005);
     this.cbExpressPrint.Checked                      = privilegeByRoles.Contains(4006);
     this.cbManageOrderRemark.Checked                 = privilegeByRoles.Contains(4008);
     this.cbExpressTemplates.Checked                  = privilegeByRoles.Contains(4009);
     this.cbShipper.Checked                           = privilegeByRoles.Contains(4010);
     this.cbPaymentModes.Checked                      = privilegeByRoles.Contains(1004);
     this.cbShippingModes.Checked                     = privilegeByRoles.Contains(1005);
     this.cbOrderRefundApply.Checked                  = privilegeByRoles.Contains(4012);
     this.cbOrderReturnsApply.Checked                 = privilegeByRoles.Contains(4014);
     this.cbOrderReplaceApply.Checked                 = privilegeByRoles.Contains(4013);
     this.cbSaleTotalStatistics.Checked               = privilegeByRoles.Contains(10001);
     this.cbUserOrderStatistics.Checked               = privilegeByRoles.Contains(10002);
     this.cbSaleList.Checked                          = privilegeByRoles.Contains(10003);
     this.cbSaleTargetAnalyse.Checked                 = privilegeByRoles.Contains(10004);
     this.cbProductSaleRanking.Checked                = privilegeByRoles.Contains(10005);
     this.cbProductSaleStatistics.Checked             = privilegeByRoles.Contains(10006);
     this.cbGifts.Checked                             = privilegeByRoles.Contains(8001);
     this.cbGroupBuy.Checked                          = privilegeByRoles.Contains(8005);
     this.cbCountDown.Checked                         = privilegeByRoles.Contains(8006);
     this.cbCoupons.Checked                           = privilegeByRoles.Contains(8007);
     this.cbProductPromotion.Checked                  = privilegeByRoles.Contains(8002);
     this.cbOrderPromotion.Checked                    = privilegeByRoles.Contains(8003);
     this.cbBundPromotion.Checked                     = privilegeByRoles.Contains(8004);
     this.cbProductConsultationsManage.Checked        = privilegeByRoles.Contains(7001);
     this.cbProductReviewsManage.Checked              = privilegeByRoles.Contains(7002);
     this.cbReceivedMessages.Checked                  = privilegeByRoles.Contains(7003);
     this.cbSendedMessages.Checked                    = privilegeByRoles.Contains(7004);
     this.cbSendMessage.Checked                       = privilegeByRoles.Contains(7005);
     this.cbManageLeaveComments.Checked               = privilegeByRoles.Contains(7006);
 }
Esempio n. 10
0
 public bool HasPrivilege(string privilegeCode)
 {
     System.Collections.Generic.IList <string> userPrivileges = RoleHelper.GetUserPrivileges(this.Username);
     return(userPrivileges != null && userPrivileges.Count != 0 && userPrivileges.Contains(privilegeCode));
 }