Example #1
0
 private void BtnGenMarketAddressShort_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         var vendors = ServiceContainer.GetService <VendorService>().GetByAll("", "", "", "", 0, 0).Datas;
         foreach (var v in vendors)
         {
             v.MarketAddressShort = VendorService.FormatVendorDoor(v.MarketAddress);
             if (v.MarketAddress.Contains("温州") || v.MarketAddress.Contains("晋江") || v.MarketAddress.Contains("温岭"))
             {
             }
             else
             {
                 if (v.MarketAddress.StartsWith("成都") == false)
                 {
                     v.MarketAddress = "成都 " + v.MarketAddress;
                 }
             }
             ServiceContainer.GetService <VendorService>().Update(v);
         }
         MessageBox.Show("更新成功");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Example #2
0
        private void UpdateDoorNumber()
        {
            string sb = "";

            if (this.Source.OrderGoodss != null && this.Source.OrderGoodss.Count > 0 && this.Source.Type != OrderType.SHUA)
            {
                foreach (var goods in this.Source.OrderGoodss.Where(obj => obj.State != OrderState.CLOSED && obj.State != OrderState.CANCLED && obj.State != OrderState.SPILTED))
                {
                    string door = VendorService.FormatVendorDoor(ServiceContainer.GetService <VendorService>().GetVendorAddress_InCach(goods.Vendor));
                    if (sb.Contains(door) == false)
                    {
                        sb += door + " ";
                    }
                }
            }

            this.DoorNumber = sb;
        }
Example #3
0
        public object Format(PrintTemplate template, PrintTemplateItem item, OrderReturn or)
        {
            string vendorName = "";
            var    ss         = or.GoodsInfo.Split(new char[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);

            if (ss.Length > 0)
            {
                vendorName = ss[0];
            }
            if (string.IsNullOrWhiteSpace(vendorName))
            {
                return("");
            }
            var vens = ServiceContainer.GetService <VendorService>().GetVendorAddress_InCach(vendorName);

            if (string.IsNullOrWhiteSpace(vens))
            {
                return("");
            }
            var door = VendorService.FormatVendorDoor(vens);

            return(door);
        }