public object GetExistShopBranch(long shopId, long regionId, string productIds) { var query = new ShopBranchQuery(); query.Status = ShopBranchStatus.Normal; query.ShopId = shopId; var region = RegionApplication.GetRegion(regionId, CommonModel.Region.RegionLevel.City); query.AddressPath = region.GetIdPath(); query.ProductIds = productIds.Split(',').Select(p => long.Parse(p)).ToArray(); query.ShopBranchProductStatus = ShopBranchSkuStatus.Normal; var existShopBranch = ShopBranchApplication.Exists(query); return new { success = true, ExistShopBranch = existShopBranch ? 1 : 0 }; }
public JsonResult ExistShopBranch(int shopId, int regionId, long[] productIds) { ShopBranchQuery query = new ShopBranchQuery { Status = 0, ShopId = shopId }; query.AddressPath = RegionApplication.GetRegion((long)regionId, Region.RegionLevel.City).GetIdPath(","); query.ProductIds = productIds; bool data = ShopBranchApplication.Exists(query); return(base.Json(data, JsonRequestBehavior.AllowGet)); }
public JsonResult ExistShopBranch(int shopId, int regionId, long[] productIds) { var query = new CommonModel.ShopBranchQuery(); query.Status = CommonModel.ShopBranchStatus.Normal; query.ShopId = shopId; var region = RegionApplication.GetRegion(regionId, CommonModel.Region.RegionLevel.City); query.AddressPath = region.GetIdPath(); query.ProductIds = productIds; var existShopBranch = ShopBranchApplication.Exists(query); return(Json(existShopBranch, JsonRequestBehavior.AllowGet)); }
public JsonResult ExistShopBranch(int shopId, int regionId, long[] productIds) { var query = new ShopBranchQuery(); query.Status = ShopBranchStatus.Normal; query.ShopId = shopId; var region = RegionApplication.GetRegion(regionId, Region.RegionLevel.City); query.AddressPath = region.GetIdPath(); query.ProductIds = productIds; var existShopBranch = ShopBranchApplication.Exists(query); return(SuccessResult <dynamic>(data: existShopBranch)); }
public object GetExistShopBranch(long shopId, long regionId, string productIds) { ShopBranchQuery query = new ShopBranchQuery(); query.Status = new ShopBranchStatus?(ShopBranchStatus.Normal); query.ShopId = shopId; Region region = RegionApplication.GetRegion(regionId, Region.RegionLevel.City); query.AddressPath = region.GetIdPath(","); query.ProductIds = Enumerable.ToArray <long>(Enumerable.Select <string, long>((IEnumerable <string>)productIds.Split(','), (Func <string, long>)(p => long.Parse(p)))); return((object)this.Json(new { Success = true, ExistShopBranch = ShopBranchApplication.Exists(query) ? 1 : 0 })); }
private void InitOrderSubmitModel(MobileOrderDetailConfirmModel model) { if (model.Address != null) { ShopBranchQuery query = new ShopBranchQuery { Status = 0 }; query.AddressPath = RegionApplication.GetRegion((long)model.Address.RegionId, Region.RegionLevel.City).GetIdPath(","); foreach (MobileShopCartItemModel model2 in model.products) { query.ShopId = model2.shopId; query.ProductIds = (from p in model2.CartItemModels select p.id).ToArray <long>(); model2.ExistShopBranch = ShopBranchApplication.Exists(query); } } }
private void InitOrderSubmitModel(DTO.OrderSubmitModel model) { if (model.address != null) { var query = new CommonModel.ShopBranchQuery(); query.Status = CommonModel.ShopBranchStatus.Normal; var region = RegionApplication.GetRegion(model.address.RegionId, CommonModel.Region.RegionLevel.City); query.AddressPath = region.GetIdPath(); foreach (var item in model.products) { query.ShopId = item.shopId; query.ProductIds = item.freightProductGroup.Select(p => p.ProductId).ToArray(); item.ExistShopBranch = ShopBranchApplication.Exists(query); } } }
private void InitOrderSubmitModel(MobileOrderDetailConfirmModel model) { if (model.Address != null) { var query = new ShopBranchQuery(); query.Status = ShopBranchStatus.Normal; var region = RegionApplication.GetRegion(model.Address.RegionId, Region.RegionLevel.City); query.AddressPath = region.GetIdPath(); foreach (var item in model.products) { query.ShopId = item.shopId; query.ProductIds = item.CartItemModels.Select(p => p.id).ToArray(); query.ShopBranchProductStatus = ShopBranchSkuStatus.Normal; item.ExistShopBranch = ShopBranchApplication.Exists(query); } } }