public List <LocationModel> GetLocations() { List <LocationModel> locations = new List <LocationModel>(); locations = InWebService.HttpRequest <List <LocationModel> >("api/Locations"); return(locations != null ? locations : new List <LocationModel>()); }
public List <SubcategoryModel> GetSubcategories(int locationId, int departmentId, int categoryId) { Session["CategoryId"] = categoryId; List <SubcategoryModel> items = new List <SubcategoryModel>(); string dataUrl = "api/Locations/" + locationId + "/Departments/" + departmentId + "/Categories/" + categoryId + "/SubCategories"; items = InWebService.HttpRequest <List <SubcategoryModel> >(dataUrl); return(items != null ? items : new List <SubcategoryModel>()); }
public ActionResult GetDepartments(int locationId) { Session["LocationId"] = locationId; List <DepartmentModel> items = new List <DepartmentModel>(); string dataUrl = "api/Locations/" + locationId + "/Departments"; items = InWebService.HttpRequest <List <DepartmentModel> >(dataUrl); return(Json(new SelectList(items != null ? items : new List <DepartmentModel>(), "DepartmentId", "DepartmentName"))); }
public List <DepartmentModel> GetDepartments(int locationId) { Session["LocationId"] = locationId; List <DepartmentModel> items = new List <DepartmentModel>(); string dataUrl = "api/Locations/" + locationId + "/Departments"; items = InWebService.HttpRequest <List <DepartmentModel> >(dataUrl); return(items != null ? items : new List <DepartmentModel>()); }
public ActionResult GetCategories(int locationId, int departmentId) { List <CategoryModel> items = new List <CategoryModel>(); Session["DepartmentId"] = departmentId; string dataUrl = "api/Locations/" + locationId + "/Departments/" + departmentId + "/Categories"; items = InWebService.HttpRequest <List <CategoryModel> >(dataUrl); return(Json(new SelectList(items != null ? items : new List <CategoryModel>(), "CategoryId", "CategoryName"))); }
// GET: EditRecord public ActionResult Index() { SKUDetailViewModel data = new SKUDetailViewModel(); if (RouteData.Values.ContainsKey("id")) { string skuId = RouteData.Values["id"].ToString(); data = InWebService.HttpRequest <SKUDetailViewModel>("Inventory/GetSkuInfo?skuId=" + skuId); data.Locations = GetLocations(); data.Departments = GetDepartments(data.LocationId); data.Categories = GetCategories(data.LocationId, data.DepartmentId); data.Subcategories = GetSubcategories(data.LocationId, data.DepartmentId, data.CategoryId); } return(View(data)); }
public List <InventoryModel> GetSearchResults()//int locationId, int departmentId, int categoryId, int subCategoryId) { int locationId = Session["locationId"] != null ? (int)Session["locationId"] : 0; int departmentId = Session["departmentId"] != null ? (int)Session["departmentId"] : 0; int categoryId = Session["CategoryId"] != null ? (int)Session["CategoryId"] : 0; int subCategoryId = Session["subCategoryId"] != null ? (int)Session["subCategoryId"] : 0; string dataUrl = "Inventory/GetInventoryInfo?locationId=" + locationId + "&departmentId=" + departmentId + "&categoryId=" + categoryId + "&subCategoryId=" + subCategoryId; List <InventoryModel> items = new List <InventoryModel>(); items = InWebService.HttpRequest <List <InventoryModel> >(dataUrl); return(items); }
public ActionResult SaveRecord(int skuId, string skuName, int subCategoryId) { try { DBinventory dBinventory = new DBinventory(); dBinventory.SkuId = skuId; dBinventory.SkuName = skuName; dBinventory.SubCategoryId = subCategoryId; var credentialString = JsonConvert.SerializeObject(dBinventory, Formatting.None); InWebService.HttpRequest <object>("Inventory/PutInventory", dBinventory, InHttpAction.Post); return(Json("Updated")); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View("Index")); } }
// GET: Login public ActionResult Index() { try { InventoryModel data = new InventoryModel(); if (RouteData.Values.ContainsKey("id")) { string skuId = RouteData.Values["id"].ToString(); data = InWebService.HttpRequest <InventoryModel>("Inventory/GetSkuInfo?skuId=" + skuId); } return(View(data)); } catch (Exception ex) { ViewBag.Message = ex.Message; return(View("Index")); } }