private void SetYear()
        {
            List <ListItem <int> > list = new List <ListItem <int> >();

            list.Add(new ListItem <int>(CommonGlobalUtil.COMBOBOX_ALL, -1));
            List <int> years = YearHelper.GetYearList(DateTime.Now);

            foreach (int item in years)
            {
                list.Add(new ListItem <int>(item.ToString(), item));
            }
            this.skinComboBoxYear.DataSource    = list;
            this.skinComboBoxYear.DisplayMember = "key";
            this.skinComboBoxYear.ValueMember   = "value";
        }
예제 #2
0
        private void SetYear()
        {
            List <ListItem <String> > list = new List <ListItem <String> >();
            //  list.Add(new ListItem<String>(GlobalCache.COMBOX_FIRST_LINE, null));
            List <int> years = YearHelper.GetYearList(DateTime.Now);

            foreach (int item in years)
            {
                list.Add(new ListItem <String>(item.ToString(), item.ToString()));
            }
            this.skinComboBox_Year.DataSource    = list;
            this.skinComboBox_Year.DisplayMember = "key";
            this.skinComboBox_Year.ValueMember   = "value";


            //默认选择当年
            this.skinComboBox_Year.SelectedValue = DateTime.Now.Year.ToString();
        }
예제 #3
0
        /// <summary>
        /// 初始化缓存列表
        /// </summary>
        private static void InitializeCache()
        {
            try
            {
                int total = 19;
                int sleep = 20;
                CommonGlobalCache.iniProgress(total, "加载中……");
                #region 权限
                CommonGlobalCache.updateProgress("权限");
                if (GlobalCache.currentUser == null)
                {
                    InteractResult <UserInfo> userInfo = GlobalCache.ServerProxy.GetUserInfo(CommonGlobalCache.CurrentUserID);
                    GlobalCache.currentUser = userInfo.Data;
                    GlobalCache.IsPos       = GlobalCache.currentUser.Type == UserInfoType.Guide;
                }

                #endregion
                #region 用户信息

                CommonGlobalCache.updateProgress("用户信息");
                ////season
                if (GlobalCache.adminUserList == null)
                {
                    GlobalCache.adminUserList = GlobalCache.ServerProxy.GetAllAdminUser();
                }
                #endregion
                #region 店铺信息
                CommonGlobalCache.updateProgress("店铺信息");
                if (GlobalCache.ShopList == null)
                {
                    GlobalCache.generalStoreShopID = GlobalCache.ServerProxy.GetGeneralStoreShopID();
                    GlobalCache.currentShopID      = GlobalCache.currentUser.ShopId;
                    GlobalCache.ShopList           = GlobalCache.ServerProxy.GetShopList();
                    //      GlobalCache.eMall = GlobalCache.EMallServerProxy.GetEMall();
                }
                #endregion
                #region 导购
                CommonGlobalCache.updateProgress("导购");
                if (GlobalCache.guideList == null)
                {
                    List <Guide> guideList = GlobalCache.ServerProxy.GetGuideList(string.Empty);
                    GlobalCache.guideList = guideList;
                }
                #endregion

                #region 促销活动
                CommonGlobalCache.updateProgress("促销活动");
                if (salesPromotionList == null)
                {
                    GetSalesPromotionListPara getSalesPromotionListPara = new GetSalesPromotionListPara();
                    getSalesPromotionListPara.PromotionType = (int)PromotionTypeEnum.Null;
                    salesPromotionList = GlobalCache.ServerProxy.GetSalesPromotionList(getSalesPromotionListPara);
                }

                #endregion
                #region 充值规则
                CommonGlobalCache.updateProgress("充值规则");
                if (rechargeDonateRuleList == null)
                {
                    GlobalCache.rechargeDonateRuleList = GlobalCache.ServerProxy.GetRechargeDonateRuleList();
                    RechargeDonateRule rechargeDonateRule = GlobalCache.rechargeDonateRuleList[0];
                    if (rechargeDonateRule != null)
                    {
                        GlobalCache.RechargeDonateRule = rechargeDonateRule;
                    }
                }

                #endregion
                #region  装颜色
                CommonGlobalCache.updateProgress("服装颜色");
                if (GlobalCache.costumeColorList == null)
                {
                    GlobalCache.costumeColorList = GlobalCache.ServerProxy.GetCostumeColor();
                }

                #endregion
                #region 年份
                CommonGlobalCache.updateProgress("年份");
                List <int> list = YearHelper.GetYearList(DateTime.Now);
                foreach (int year in list)
                {
                    GlobalCache.yearList.Add(new ListItem <int>(year.ToString(), year));
                }
                #endregion
                #region 品牌
                CommonGlobalCache.updateProgress("品牌");
                if (GlobalCache.brandList == null)
                {
                    //  List<Brand> bList= GlobalCache.ServerProxy.GetBrand().FindAll(t=>t.IsDisable=false);
                    List <Brand> bList = GlobalCache.ServerProxy.GetEnableBrands().Data;
                    GlobalCache.brandList = bList;
                    GlobalCache.brandList?.Sort();
                }

                #endregion
                #region 菜单
                GlobalCache.Permissons = WinformUIUtil.GetAllTreeNodes(PermissonUtil.GetTreeNodes());
                GlobalCache.Permissons.Add(PermissonUtil.NewTreeNode(RolePermissionMenuEnum.工作台));
                if (CommonGlobalCache.CurrentUserID == SystemDefault.DefaultAdmin)
                {
                    GlobalCache.Permissons.Add(PermissonUtil.NewTreeNode(RolePermissionMenuEnum.管理员));
                }
                GlobalCache.Permissons.Add(PermissonUtil.NewTreeNode(RolePermissionMenuEnum.退出));

                #endregion
                #region 配置
                CommonGlobalCache.updateProgress("配置");
                if (GlobalCache.parameterConfigList == null)
                {
                    GlobalCache.parameterConfigList = GlobalCache.ServerProxy.GetAllParameterConfig();
                    SetParams();
                }
                #endregion
                #region 促销类型
                CommonGlobalCache.updateProgress("促销类型");
                if (GlobalCache.promotionTypeEnumList == null)
                {
                    List <ListItem <PromotionTypeEnum> > promotionTypeList = new List <ListItem <PromotionTypeEnum> >();
                    promotionTypeList.Add(new ListItem <PromotionTypeEnum>(GlobalUtil.COMBOBOX_ALL, PromotionTypeEnum.Null));
                    promotionTypeList.Add(new ListItem <PromotionTypeEnum>(EnumHelper.GetDescription(PromotionTypeEnum.MJ), PromotionTypeEnum.MJ));
                    promotionTypeList.Add(new ListItem <PromotionTypeEnum>(EnumHelper.GetDescription(PromotionTypeEnum.Discount), PromotionTypeEnum.Discount));
                    promotionTypeList.Add(new ListItem <PromotionTypeEnum>(EnumHelper.GetDescription(PromotionTypeEnum.YKJ), PromotionTypeEnum.YKJ));
                    GlobalCache.promotionTypeEnumList = promotionTypeList;
                }

                #endregion
                #region 供应商

                CommonGlobalCache.updateProgress("供应商");
                if (GlobalCache.supplierList == null)
                {
                    GlobalCache.supplierList = GlobalCache.ServerProxy.GetSupplierList();
                    GlobalCache.supplierList?.Sort();
                }
                #endregion


                if (GlobalCache.distributorMemberList == null)
                {
                    GlobalCache.distributorMemberList = (List <TreeModel>)CommonGlobalCache.ServerProxy.GetRetailDistributionTree().Data;
                    // GlobalCache.supplierList = GlobalCache.ServerProxy.GetSupplierList();
                }
                if (GlobalCache.distributorPFMemberList == null)
                {
                    GlobalCache.distributorPFMemberList = (List <TreeModel>)CommonGlobalCache.ServerProxy.GetPfDistributionTree().Data;

                    /*  GetDistributorPagePara para = new GetDistributorPagePara()
                     * {
                     *    IdOrName = null,
                     *    PageIndex = 0,
                     *    PageSize = int.MaxValue
                     * };
                     * DistributorPage page = GlobalCache.ServerProxy.GetDistributorPage(para);
                     * List<TreeModel> listM = new List<TreeModel>();
                     * List<Distributor> Dlist =  page.Distributors as List<Distributor>;
                     * foreach (Distributor item in Dlist)
                     * {
                     *    TreeModel curModel = new TreeModel();
                     *    curModel.ID= item.ID;
                     *    curModel.AccruedCommission = item.AccruedCommission;
                     *    curModel.Name = item.Name;
                     *    listM.Add(curModel);
                     * }
                     * GlobalCache.distributorPFMemberList = listM;*/



                    // GlobalCache.supplierList = GlobalCache.ServerProxy.GetSupplierList();
                }
                #region  装信息
                CommonGlobalCache.updateProgress("服装信息");
                if (costumeList == null)
                {
                    LoadCostumeInfos(total, true);
                }
                //条形码
                #endregion
                #region 尺码组
                CommonGlobalCache.updateProgress("尺码组");
                if (sizeGroupList == null)
                {
                    sizeGroupList = GlobalCache.ServerProxy.GetAllSizeGroup();
                }
                #endregion
                #region COS
                CommonGlobalCache.updateProgress("COS");
                if (cosLoginInfo == null)
                {
                    GlobalCache.cosLoginInfo = GlobalCache.EMallServerProxy.GetCosLoginInfo();
                }
                #endregion

                #region 分销人员
                CommonGlobalCache.updateProgress("分销人员");
                if (GlobalCache.distributorList == null)
                {
                    GetDistributorPagePara para = new GetDistributorPagePara()
                    {
                        IdOrName  = null,
                        PageIndex = 0,
                        PageSize  = int.MaxValue
                    };
                    DistributorPage page = GlobalCache.ServerProxy.GetDistributorPage(para);
                    GlobalCache.distributorList = page.Distributors;
                }
                #endregion
                #region 批发
                CommonGlobalCache.updateProgress("批发");
                PfCustomerCache.Load();
                #endregion

                #region 商城
                CommonGlobalCache.updateProgress("商城");
                if (eMallMiniProgramImg == null)
                {
                    byte[] imageByte = GlobalCache.ServerProxy.GetEMallMiniProgramImg();
                    if (imageByte != null)
                    {
                        eMallMiniProgramImg = CCWin.SkinControl.ImageHelper.Convert(imageByte);
                    }
                }
                #endregion
                GlobalCache.updateProgress("");
                GlobalCache.iniCompleted();
            }
            catch (Exception ex)
            {
                CommonGlobalCache.iniFailed(ex);
            }
        }