Exemple #1
0
        public JsonResult SaveLimitAreaSaleCity(int productConfigId, int cityId, string cityName, int isAllowSale, int warehouseId, string warehouseName, int supplierId, string supplierName, string muticityCheckedIds)
        {
            bool result     = true;
            var  warehouses = LimitAreaSaleManager.SelectWarehouse();

            warehouseName = warehouses.Where(r => r.WarehouseId == warehouseId).Select(r => r.WarehouseName).FirstOrDefault();
            var suppliers = LimitAreaSaleManager.SelectSupplier();

            supplierName = suppliers.Where(r => r.SupplierId == supplierId).Select(r => r.SupplierName).FirstOrDefault();
            if (string.IsNullOrEmpty(muticityCheckedIds))
            {
                result = LimitAreaSaleManager.SaveLimitAreaSaleCity(productConfigId, cityId, cityName, isAllowSale,
                                                                    warehouseId, warehouseName, supplierId, supplierName, User.Identity.Name);
            }

            else
            {
                //批量新增
                var list = muticityCheckedIds.Split(',').ToList();
                foreach (var item in list)
                {
                    cityId   = Convert.ToInt32(item.Split(';')[0]);
                    cityName = item.Split(';')[1];
                    result   = result && LimitAreaSaleManager.SaveLimitAreaSaleCity(productConfigId, cityId, cityName, isAllowSale,
                                                                                    warehouseId, warehouseName, supplierId, supplierName, User.Identity.Name);
                }
            }
            if (result)
            {
                return(Json(new
                {
                    status = 1
                }));
            }
            else
            {
                return(Json(new
                {
                    status = 0
                }));
            }
        }
Exemple #2
0
        public ActionResult SelectSupplier()
        {
            var result = LimitAreaSaleManager.SelectSupplier();

            return(Json(result));
        }