public AddGood(ShopClient _Shop, string _Barcode = "") { InitializeComponent(); this.Shop = _Shop; this.Barcode = _Barcode; tabConstr(); }
private int GetSupproseShopCount(string provinceName, List <string> pids) { ShopSearchRequest request = new ShopSearchRequest() { ProvinceName = provinceName, Filters = new List <ShopQueryFilterModel>() { new ShopQueryFilterModel() { FilterValueType = ShopQueryFilterValueType.MrPid.ToString(), Values = pids,//传服务ID JoinType = JoinType.And.ToString() } }, PageSize = 10, //页面大小 PageIndex = 1 //第几页 }; int result = 0; try { using (var clinet = new ShopClient()) { var serviceResult = clinet.SearchShopIds(request); serviceResult.ThrowIfException(true); result = serviceResult.Result.Pager.Total; } } catch (Exception ex) { logger.Error($"SearchShopIds:{ex.Message}", ex); } return(result); }
/// <summary> /// 获取喷漆服务信息 /// </summary> /// <returns></returns> public List <ShopServiceModel> GetPaintServiceInfo() { var result = new List <ShopServiceModel>(); try { using (var client = new ShopClient()) { var data = client.SelectAllServices(); if (data.Success) { if (data.Result != null) { result = data.Result.Where(p => p.ServersType.Equals("Paint"))?.ToList(); } } else { data.ThrowIfException(true); } } } catch (Exception ex) { Logger.Log(Level.Error, ex, "GetPaintServiceInfo"); } return(result); }
public static List <ShopDetailModel> GetShopsByShopIds() { List <ShopDetailModel> shopDetailList = new List <ShopDetailModel>(); List <int> specificshopIdList = new List <int>(); if (!string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["ShopIdList"])) { specificshopIdList = ConfigurationManager.AppSettings["ShopIdList"].Split(new char[] { ',' }).Select(q => Convert.ToInt32(q)).ToList(); } try { if (specificshopIdList.Any()) { using (var client = new ShopClient()) { var result = client.SelectShopDetails(specificshopIdList); result.ThrowIfException(); if (result.Success && result.Result != null && result.Result.Any()) { shopDetailList.AddRange(result.Result); } } shopDetailList = shopDetailList.Where(q => (q.ServiceType & 4) == 4 || (q.ServiceType & 2) == 2).ToList(); shopDetailList = shopDetailList.Where(q => q.SuspendStartDateTime == null || q.SuspendEndDateTime == null || (DateTime.Now < q.SuspendStartDateTime) || DateTime.Now > q.SuspendEndDateTime.Value.AddDays(1)).ToList(); } } catch (Exception ex) { TuhuShopSyncJob.Logger.Error(ex); } return(shopDetailList); }
public DetailsToSale(ShopClient _Shop, int idCash) { InitializeComponent(); this.Shop = _Shop; AddItemListView(idCash); }
/// <summary> /// 删除按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BT_DeletCity_Click(object sender, EventArgs e) { if (CB_Province.SelectedIndex <= 0) { MessageBox.Show("请先指定省份!"); return; } if (LB_City.SelectedIndex < 0) { MessageBox.Show("请选择您要删除的城市!"); return; } DialogResult res = MessageBox.Show("该操作会将您选定的城市信息连同该城市的所有店铺等信息全部删除,该操作是不可逆的,是否继续进行?", "警告!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2, 0); if (res == DialogResult.OK) { UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); int ProvinceID = Province_Client.SelectProvince_Name(CB_Province.SelectedItem.ToString()).Province_ID; int CityID = City_Client.SelectCity_Name(LB_City.SelectedItem.ToString(), ProvinceID).City_ID; if (Shop_Client.SelectShop_CityID(CityID).Count() != 0) { List <WFpart.ShopService.Car_Shop> List_Shop = Shop_Client.SelectShop_CityID(CityID).ToList(); //删除店铺和店铺关系 foreach (WFpart.ShopService.Car_Shop temp in List_Shop) { UserManager_Client.UserDropShop_ShopID(temp.Shop_ID); Shop_Client.DeleteShop(temp.Shop_ID); } } City_Client.DeleteCity(CityID); } List_City = City_Client.SelectAllCitys().ToList(); LB_CityBind(); }
public AddCategory(ShopClient _Shop) { InitializeComponent(); this.shop = _Shop; this.Text = "Введите категории(ю)"; this.Width = 400; tabConstr(); }
public Form_ShopManage() { InitializeComponent(); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); UserManager_Client = (UserManagerClient)ClientFactory.GetClient(ClientType.Type.UserManager); List_ShopInfo = UserManager_Client.GetAllShops(null, null, null).ToList(); CB_ProviceBind(); }
// 옥션상품 상태 호출 public async Task <string> API_ViewItemStatusAsync(string ItemID) { ViewItemRequestT req = new ViewItemRequestT(); req.ItemID = ItemID; string res = await ShopClient.ViewItemStatusAsync(req); return(res); }
public Form1() { InitializeComponent(); shop = new ShopClient(); //Строим таблицы cashWorkToday(); goodsBalance(); }
public async Task <IEnumerable <ShopDetailModel> > SelectShopDetailsAsync(IEnumerable <int> shopIds) { using (var client = new ShopClient()) { var result = await client.SelectShopDetailsAsync(shopIds); result.ThrowIfException(true); return(result.Result); } }
public Users(ShopClient _Shop) { InitializeComponent(); this.Shop = _Shop; //Заполняем ComboBox Ролями cbRole.Items.AddRange(Shop.GetRoles()); cbRole.SelectedIndex = 0; //this.AddUsersListView(); }
public Form1() { try { InitializeComponent(); Shop = new ShopClient(); //Shop.UserAuth("Serg", this.GetHashString("123")); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public Form1() { InitializeComponent(); tabConstr(); try { Shop = new ShopClient(); flagSort = false; } catch (Exception ex) { MessageBox.Show(ex.Message); MessageBox.Show(ex.StackTrace); } }
public static bool TuhuShopIsExisted(int shopid) { bool isTuhuExisted = true; using (var shopclient = new ShopClient()) { var tuhushopisExisted = shopclient.FetchShop(shopid); if (tuhushopisExisted != null && tuhushopisExisted.Result != null) { isTuhuExisted = false; } } return(isTuhuExisted); }
public bool CleanCache(int shopId, int pid) { try { using (var client = new ShopClient()) { var result = client.SendBeautyShopChangeQueue(shopId, pid); return(result.Success); } } catch (Exception ex) { return(false); throw ex; } }
public List <Shop> GetShop(string Regions, string ShopBusinessType, string ShopServices, string ShopTechLevel) { ShopsForPromotionSearchRequest search = new ShopsForPromotionSearchRequest(); if (!string.IsNullOrWhiteSpace(Regions)) { search.Regions = JsonConvert.DeserializeObject <RegionInfo[]>(Regions); } if (!string.IsNullOrWhiteSpace(ShopBusinessType)) { ShopBusinessType = ShopBusinessType.Substring(0, ShopBusinessType.Length - 1); search.ShopBusinessType = ShopBusinessType.Split(','); } if (!string.IsNullOrWhiteSpace(ShopServices)) { ShopServices = ShopServices.Substring(0, ShopServices.Length - 1); search.ShopServices = ShopServices.Split(','); } if (!string.IsNullOrWhiteSpace(ShopTechLevel)) { ShopTechLevel = ShopTechLevel.Substring(0, ShopTechLevel.Length - 1); var list = ShopTechLevel.Split(','); int[] arr = new int[list.Length]; for (int i = 0; i < list.Length; i++) { arr[i] = Convert.ToInt32(list[i]); } search.ShopTechLevel = arr; } search.PageIndex = 1; search.PageSize = int.MaxValue; List <Shop> result = new List <Shop>(); using (var client = new ShopClient()) { var action = client.SelectShopForPromotion(search); if (action.Success && action.Result.Any()) { result = action.Result.ToList(); } } return(result); }
private static void AbstractFactoryPatternSample() { Console.WriteLine("--Sample Abstract Factory Pattern--"); Console.WriteLine("--Chairs and Sofas from IKEA--"); IShop s = new IKEAShop(); ShopClient sc = new ShopClient(s, CommonEnums.ChairTypes.Folding, CommonEnums.SofaTypes.Tuxedo); Console.WriteLine(sc.GetChairDetails()); Console.WriteLine(sc.GetSofaDetails()); Console.WriteLine("--Chairs and Sofas from Walmart--"); s = new WalmartShop(); sc = new ShopClient(s, CommonEnums.ChairTypes.Folding, CommonEnums.SofaTypes.Tuxedo); Console.WriteLine(sc.GetChairDetails()); Console.WriteLine(sc.GetSofaDetails()); }
public ShopModel GetTuhuShop(int tuhuShopId) { ShopModel result = null; if (tuhuShopId > 0) { using (var client = new ShopClient()) { var serviceResult = client.FetchShop(tuhuShopId); if (serviceResult.Success && serviceResult.Result != null) { result = serviceResult.Result; } } } return(result); }
public static List <ShopBeautyProductResultModel> GetTuanGouXiCheModel(int shopid) { List <ShopBeautyProductResultModel> TGXiCheList = new List <ShopBeautyProductResultModel>(); using (var client = new ShopClient()) { var result = client.GetShopBeautyDetailResultModel(shopid, null); if (result != null && result.Result != null) { var xicheitem = result.Result.Where(q => q.CategoryId == 1).FirstOrDefault(); if (xicheitem != null && xicheitem.Products != null) { TGXiCheList = xicheitem.Products.Where(q => tuangouxicheTypes.Contains(q.PID)).ToList(); } } } return(TGXiCheList); }
public string GetTuhuProductName(string tuhuProductId) { string result = string.Empty; if (!string.IsNullOrEmpty(tuhuProductId)) { using (var client = new ShopClient()) { var serviceResult = client.GetBeautyProductDetailByPid(tuhuProductId); if (serviceResult.Success && serviceResult.Result != null && !string.IsNullOrEmpty(serviceResult.Result.ProductName)) { result = serviceResult.Result.ProductName; } } } return(result); }
//Предполагается что в реальном проекте shopClient будет получаться из информации об аутентификации, //а не напрямую прокидываться с фронтэнда/потребителя апи public async Task <IActionResult> CreateOrder([FromBody] ShopClient shopClient, [FromBody] IEnumerable <BasketItem> basketItems) { if (basketItems.Count() == 0) { return(ValidationProblem()); } try { await _shoppingService.CreateOrderAsync(shopClient, basketItems); } catch (Exception ex) { //Лучше, конечно, стактрейс в логи кидать return(Problem($"Ошибка при создании заказа: {ex.Message}")); } return(Ok()); }
public ActionResult GetAllVipService() { var allVipService = new Dictionary <string, string>(); using (var client = new ShopClient()) { var vipServiceIds = (client.GetBeautyProductIdsByCategoryId(67)).Result; if (vipServiceIds != null) { foreach (var item in vipServiceIds) { var product = (client.GetBeautyProductDetailByPid(item)).Result; allVipService[item] = product.ProductName; } } } return(Json(allVipService, JsonRequestBehavior.AllowGet)); }
public override void HandlePacket(PacketReader packet, ShopClient client) { var characterId = packet.ReadInt(); var accountId = client.Server.Manager.ValidateMigration(client.Host, characterId); if (accountId == 0) { client.Terminate("Invalid migration"); return; } client.Account = new ShopAccount(accountId, client); client.Account.Load(); client.SetOnline(true); client.Character = new ShopCharacter(characterId, client); client.Character.Load(); client.Character.Initialize(); }
/// <summary> /// /// </summary> /// <param name="_shop"></param> /// <param name="param">1 означает что это возврат товара</param> public BarcodeEnter(ShopClient _shop, int param = 0) { InitializeComponent(); masGoods = new List <Good>(); textBox1.Select(); this.shop = _shop; this.param = param; r = new Random(); sale(); if (param == 0) { this.Text = "Продажа товара"; goodsCount = shop.GetGoodsBalance(); } else { this.Text = "Возврат товара"; } }
// 상품 등록 호출 public async Task <AddItemResponseT> API_AddItemAsync(AddItemRequestT req) { AddItemResponseT res = new AddItemResponseT(); try { req.MemberTicket = new MemberTicketT(); req.MemberTicket.Ticket = Host.Tic; req.InputChannel = Host.PartnerID; res = await ShopClient.AddItemAsync(req); } catch (WebException webex) { webex.ToString(); } catch (Exception ex) { ex.ToString(); } return(res); }
public static List <ShopServiceModel> GetXBYShopServiceModelListByShopId(int shopId) { List <ShopServiceModel> shopservicemodelList = new List <ShopServiceModel>(); try { using (var client = new ShopClient()) { var shopdetail = client.FetchShopDetail(shopId); if (shopdetail != null && shopdetail.Result != null && shopdetail.Result.ShopServices != null && shopdetail.Result.ShopServices.Any()) { shopservicemodelList = shopdetail.Result.ShopServices.Where( q => q.ServiceId.Contains("FU-BY-XBY|")).ToList(); } } } catch (Exception ex) { TuhuShopSyncJob.Logger.Error(ex);; } return(shopservicemodelList); }
public Form_VersionManage() { InitializeComponent(); Mark = false; CarSummery_Client = (CarSummeryClient)ClientFactory.GetClient(ClientType.Type.CarSummery); Province_Client = (ProvinceClient)ClientFactory.GetClient(ClientType.Type.Province); City_Client = (CityClient)ClientFactory.GetClient(ClientType.Type.City); Shop_Client = (ShopClient)ClientFactory.GetClient(ClientType.Type.Shop); Brand_Client = (BrandClient)ClientFactory.GetClient(ClientType.Type.Brand); Type_Client = (TypeClient)ClientFactory.GetClient(ClientType.Type.Type); Version_Client = (VersionClient)ClientFactory.GetClient(ClientType.Type.Version); List_VersionInfo = CarSummery_Client.SelectAllCar().ToList(); List_Car_Province = Province_Client.SelectAllProvinces().ToList(); List_City = City_Client.SelectAllCitys().ToList(); List_Shop = Shop_Client.SelectAllShops().ToList(); List_Brand = Brand_Client.SelectAllBrands().ToList(); List_Type = Type_Client.SelectAllTypes().ToList(); CB_ProviceBind(); CB_BrandBind(); CB_TypeBind(); BT_UpdateVersion.Visible = false; }
public static IDictionary <string, string> GetAllShopServices() { IDictionary <string, string> result = new Dictionary <string, string>(); try { using (var client = new ShopClient()) { var data = client.GetAllBeautyProductPidAndName(); if (data != null && data.Success) { result = data.Result; } } } catch (Exception ex) { logger.Log(Level.Error, ex, "GetAllShopServices"); } return(result); }
public static List <ShopServiceModel> GetShopServiceModelListByShopId(int shopId) { List <ShopServiceModel> shopservicemodelList = new List <ShopServiceModel>(); try { using (var client = new ShopClient()) { client.UpdateShop(shopId); var shopdetail = client.FetchShopDetail(shopId); if (shopdetail != null && shopdetail.Result != null && shopdetail.Result.ShopServices != null && shopdetail.Result.ShopServices.Any()) { shopservicemodelList = shopdetail.Result.ShopServices.Where( q => q.ServersType.Equals("CarWashing", StringComparison.OrdinalIgnoreCase)).ToList(); } } } catch (Exception ex) { TuhuShopSyncJob.Logger.Error(ex);; } return(shopservicemodelList); }