private void btnEditFlag_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         ColorFlag flag = this.cbbEditFlag.GetSelectedEnum <ColorFlag>();
         if (MessageBox.Show("是否将旗帜更新为:" + this.cbbEditFlag.Text, "警告", MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
         {
             return;
         }
         var goods = this.GetGoodss();
         foreach (var v in goods)
         {
             if (v.Source.Flag != flag)
             {
                 v.Source.Flag = flag;
                 v.Flag        = flag;
                 ServiceContainer.GetService <GoodsService>().Update(v.Source);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void UpdateOrder(OrderViewModel order, ColorFlag flag, string comment, bool appendAlready = true)
 {
     try
     {
         if (order == null)
         {
             return;
         }
         comment += string.Format("【{0} {1}】", OperatorService.LoginOperator.Name[0],
                                  DateTime.Now.ToString("MM-dd HH:mm"));
         if (appendAlready && string.IsNullOrWhiteSpace(order.PopSellerComment) == false)
         {
             comment = order.PopSellerComment + " " + comment;
         }
         ServiceContainer.GetService <OrderService>().ModifyPopSellerComment(order.Source.Id, flag, comment);
         order.OrderFlag               = flag;
         order.PopSellerComment        = comment;
         order.Source.PopSellerComment = comment;
         order.Source.PopFlag          = flag;
         ServiceContainer.GetService <OrderService>().Update(order.Source);
         MessageCenter.Instance.SendMessage(new OrderPopSellerCommentChangedMessage
         {
             Flag          = flag,
             SellerComment = comment,
             OrderId       = order.Source.Id,
             SenderName    = "",
             Targets       = new string[0],
             Time          = DateTime.Now
         });
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "更新失败");
     }
 }
        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);
            }
        }
Beispiel #4
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);
     }
 }
Beispiel #5
0
 public void ModifyComment(Shop shop, string popOrderId, string comment, ColorFlag flag)
 {
     if (shop.AppEnabled == false)
     {
         throw new Exception("店铺订单发货接口已禁用,无法调用相应接口操作");
     }
     this.InvokeWithRefreshAccessToken(shop, () => GetPop(shop.PopType).ModifyComment(shop, popOrderId, comment, flag));
 }
 /// <summary>s
 /// Return the best case array.
 /// </summary>
 /// <param name="flag"></param>
 /// <returns></returns>
 public byte[,] GetIdealColorArray(ColorFlag flag)
 {
     if (myIdeal == null)
     {
         return(image.GetColorArray(flag));
     }
     return(myIdeal.GetRawColorArray(flag));
 }
 /// <summary>
 /// Returns the calcuted output of the neural network.
 /// </summary>
 /// <param name="flag"></param>
 /// <returns></returns>
 public byte[,] GetCalculatedArray(ColorFlag flag)
 {
     if (calculated == null)
     {
         throw new NullReferenceException("This was not yet calculated.");
     }
     return(calculated.GetColorArray(flag));
 }
 private void UpdateSelectedOrder(ColorFlag flag, string comment, bool appendAlreay = true)
 {
     try
     {
         this.UpdateOrder(this.GetCurrentSelectedModel(), flag, comment, appendAlreay);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "更新失败");
     }
 }
Beispiel #9
0
        /// <summary>
        /// Return the requested color array of the Image.
        /// </summary>
        /// <param name="color"></param>
        /// <returns></returns>
        internal byte[,] GetColorArray(ColorFlag color)
        {
            switch (color)
            {
            case ColorFlag.red:
                return(red);

            case ColorFlag.blue:
                return(blue);

            case ColorFlag.green:
                return(green);
            }
            throw new NotSupportedException("Not supported ColorFlag");
        }
        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);
            }
        }
Beispiel #11
0
        internal void SetColorArray(byte[,] colorArray, ColorFlag colorFlag)
        {
            switch (colorFlag)
            {
            case ColorFlag.red:
                red = colorArray;
                break;

            case ColorFlag.blue:
                blue = colorArray;
                break;

            case ColorFlag.green:
                green = colorArray;
                break;
            }
            throw new NotSupportedException("Not supported ColorFlag");
        }
Beispiel #12
0
        public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
        {
            Dictionary <string, object> para = new Dictionary <string, object>();

            para["shopId"]    = shopId;
            para["state"]     = state;
            para["timeType"]  = timeType;
            para["start"]     = start;
            para["end"]       = end;
            para["vendor"]    = vendor;
            para["number"]    = number;
            para["type"]      = type;
            para["comment"]   = comment;
            para["flag"]      = flag;
            para["videoType"] = videoType;
            para["order"]     = order;
            para["vendorAdd"] = vendorAdd;
            para["shipper"]   = shipper;
            para["pageIndex"] = pageIndex;
            para["pageSize"]  = pageSize;
            return(DoPost <DataCollectionResponse <Goods> >(para));
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ColorFlag flag = (ColorFlag)value;

            if (flag == ColorFlag.UN_LABEL)
            {
                return(IMAGE_UN_LABLE);
            }

            if (flag == ColorFlag.BLUE)
            {
                return(IMAGE_BLUE);
            }

            if (flag == ColorFlag.GREEN)
            {
                return(IMAGE_GREEN);
            }

            if (flag == ColorFlag.PINK)
            {
                return(IMAGE_PINK);
            }

            if (flag == ColorFlag.RED)
            {
                return(IMAGE_RED);
            }

            if (flag == ColorFlag.YELLOW)
            {
                return(IMAGE_YELLOW);
            }

            return(IMAGE_UN_LABLE);
        }
Beispiel #14
0
 public OrderFlagViewModel(bool isChecked, ColorFlag flag)
 {
     this.IsChecked = isChecked;
     this.Flag      = flag;
     this.Color     = EnumUtil.GetEnumValueDescription(flag).Trim('色');
 }
Beispiel #15
0
 public override void ModifyComment(Shop shop, string popOrderId, string comment, ColorFlag flag)
 {
     throw new NotImplementedException();
 }
Beispiel #16
0
 public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
 {
     try
     {
         return(this.dao.GetByAll(shopId, state, timeType, start, end, vendor, number, type, comment, flag, videoType, order, vendorAdd, shipper, pageIndex, pageSize));
     }
     catch (Exception ex)
     {
         throw new WebFaultException <ResponseBase>(new ResponseBase(ex.Message), System.Net.HttpStatusCode.OK);
     }
 }
Beispiel #17
0
 public abstract void ModifyComment(Shop shop, string popOrderId, string comment, ColorFlag flag);
Beispiel #18
0
        public DataCollectionResponse <Goods> GetByAll(long shopId, GoodsState state, int timeType, DateTime start, DateTime end, string vendor, string number, GoodsType type, string comment, ColorFlag flag, GoodsVideoType videoType, string order, string vendorAdd, string shipper, int pageIndex, int pageSize)
        {
            List <object> para           = new List <object>();
            string        dataHsqlHeader = " select distinct  G  from " + this.GetEntiyName() + " as  G left join fetch G.Vendor as V left join  G.Shops as GS ";
            //对于count统计sql语句left join 不能使用 fetch,不然会产生错误的sql语句,!!!!!
            string countHsqlHeader = " select count( distinct G.Id)  from " + this.GetEntiyName() + " as  G left join G.Vendor as V left join G.Shops as GS  ";

            string where = "";

            //店铺查询条件
            if (shopId <= -1)
            {
                where += "  G.Id not in (select distinct GoodsId from GS group by GoodsId having count(GoodsId) >=1 ) and ";
            }
            else if (shopId > 0)
            {
                where += " GS.ShopId=" + shopId + " and ";
            }
            where += this.MakeQuery("GS.State", (int)state, (int)GoodsState.NONE);
            where += this.MakeQuery("G.Type", (int)type, (int)GoodsType.GOODS_SHOES_NONE);
            if (timeType <= 0)
            {
                where += this.MakeQuery("G." + TIME_TYPES[timeType], start, true);
                where += this.MakeQuery("G." + TIME_TYPES[timeType], end, false);
            }
            else
            {
                where += this.MakeQuery("GS." + TIME_TYPES[timeType], start, true);
                where += this.MakeQuery("GS." + TIME_TYPES[timeType], end, false);
            }

            if (string.IsNullOrWhiteSpace(vendor) == false)
            {
                where += " (V.Name like ? or V.PingyingName like ?) and ";
                para.Add('%' + vendor + '%');
                para.Add('%' + vendor + '%');
            }
            where += this.MakeQueryLike("V.MarketAddress", vendorAdd, para);
            where += this.MakeQueryLike("G.Number", number, para);
            where += this.MakeQueryLike("G.Comment", comment, para);
            where += this.MakeQuery("G.Flag", (int)flag, (int)ColorFlag.None);
            where += this.MakeQuery("G.VideoType", (int)videoType, (int)GoodsVideoType.NONE);
            where += this.MakeQueryLike("G.Shipper", shipper, para);
            string dataHsql = dataHsqlHeader + this.TrimHSql("where " + where) + " order by ";

            if (string.IsNullOrWhiteSpace(order))
            {
                dataHsql += " G.Id desc ";
            }
            else if (order.Contains("State"))
            {
                dataHsql += " GS.State " + (order.Contains("asc") ? "asc " : "desc");
            }
            else if (order.Contains("UploadTime"))
            {
                dataHsql += " GS.UploadTime " + (order.Contains("asc") ? "asc " : "desc");
            }
            else if (order.Contains("Vendor"))
            {
                dataHsql += order.Contains("Vendor") ? (" V.Name " + (order.Contains("asc") ? "asc " : "desc")) : ("G." + order);
            }
            else
            {
                dataHsql += "G." + order;
            }
            return(this.GetPageEx(dataHsql, this.TrimHSql(countHsqlHeader + " where " + where), pageIndex, pageSize, para.ToArray()));
        }
 public void SetCalculatedArray(byte[,] colorArray, ColorFlag flag)
 {
     image.SetColorArray(colorArray, flag);
 }
 /// <summary>
 /// Returns the given input array.
 /// </summary>
 /// <param name="flag"></param>
 /// <returns></returns>
 public byte[,] GetRawColorArray(ColorFlag flag)
 {
     return(image.GetColorArray(flag));
 }