示例#1
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         this.tbLastInfo.Text = "最后统计信息:" + ServiceContainer.GetService <SystemConfigService>().Get(-1, "GoodsCountLastOrder", "");
         if (this.myLoaded)
         {
             return;
         }
         //旗帜
         var flags   = new ColorFlag[] { ColorFlag.UN_LABEL, ColorFlag.RED, ColorFlag.YELLOW, ColorFlag.GREEN, ColorFlag.BLUE, ColorFlag.PINK };
         var flagVms = flags.Select(obj => new OrderFlagViewModel(false, obj)).ToArray();
         flagVms.Where(obj => obj.Flag == ColorFlag.GREEN || obj.Flag == ColorFlag.BLUE).ToList().ForEach(obj => obj.IsChecked = true);
         this.cbbFlags.ItemsSource = flagVms;
         var shippers = ServiceContainer.GetService <GoodsService>().GetAllShippers().Datas;
         shippers.Insert(0, "");
         this.cbbShippers.ItemsSource   = shippers;
         this.dgvGoodsCount.ItemsSource = this.gcs;
         this.dpStart.Value             = DateTime.Now.AddDays(-60);
         this.myLoaded = true;
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.Message);
     }
 }
示例#2
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                foreach (var pp in printOrderPages)
                {
                    pp.LoadBarValue();
                }
                if (this.myLoaded == true)
                {
                    return;
                }

                //旗帜
                var flags = new ColorFlag[]
                {
                    ColorFlag.UN_LABEL, ColorFlag.RED, ColorFlag.YELLOW, ColorFlag.GREEN, ColorFlag.BLUE, ColorFlag.PINK
                };
                var flagVms = flags.Select(obj => new OrderFlagViewModel(false, obj)).ToArray();
                this.cbbFlags.ItemsSource = flagVms;
                //支付类型
                this.cbbPopPayTypes.Bind <PopPayType>();
                this.cbbPopPayTypes.SetSelectedEnum(PopPayType.ONLINE);
                var shippers = ServiceContainer.GetService <GoodsService>().GetAllShippers().Datas;
                shippers.Insert(0, "");
                this.cbbShippers.ItemsSource = shippers;
                this.tc1.ItemsSource         = printOrderPages;
                this.myLoaded = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("加载出错:" + ex.Message);
                MessageBox.Show(ex.StackTrace);
            }
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (this.myLoaded)
            {
                return;
            }
            try
            {
                this.dpStart.Value = DateTime.Now.AddDays(-30);
                this.cbbOrderType.Bind <OrderType>();
                this.cbbState.Bind <OrderState>();
                this.cbbCreateType.Bind <OrderCreateType>();
                orderService = ServiceContainer.GetService <OrderService>();
                vs           = ServiceContainer.GetService <VendorService>();

                //快递公司
                var coms = DeliveryCompanyService.GetDeliveryCompaniyNames().ToList();
                coms.Insert(0, "");
                this.cbbDeliveryCompany.ItemsSource = coms;

                //店铺
                var shops = ServiceContainer.GetService <ShopService>().GetByAll().Datas.Where(obj => obj.Enabled).ToList();
                shops.Insert(0, new Shop {
                    Mark = ""
                });
                this.cbbShops.ItemsSource = shops;

                //旗帜
                var flags = new ColorFlag[]
                {
                    ColorFlag.UN_LABEL, ColorFlag.RED, ColorFlag.YELLOW, ColorFlag.GREEN, ColorFlag.BLUE, ColorFlag.PINK
                };
                var flagVms = flags.Select(obj => new OrderFlagViewModel(false, obj)).ToArray();
                this.cbbFlags.ItemsSource = flagVms;

                var shippers = ServiceContainer.GetService <GoodsService>().GetAllShippers().Datas;
                shippers.Insert(0, "");
                this.cbbShippers.ItemsSource = shippers;

                this.myLoaded = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }