public JsonResult GetStatisticsForMonthAndYear(int month, int year) { var clothingStoreBL = new ClothingStoreBL(); return(new JsonResult() { Data = clothingStoreBL.GetStatisticsForMonthAndYear(month, year), JsonRequestBehavior = JsonRequestBehavior.AllowGet, }); }
public JsonResult AddItem(NewClothingItemModel data) { var clothingStoreBL = new ClothingStoreBL(); clothingStoreBL.AddItem(new ClothingItem() { Name = data.Name, Price = data.Price, BrandName = data.BrandName, ClothingItemTypeId = data.ClothingItemTypeId, }, data.Ammount); return(new JsonResult() { Data = "Success", JsonRequestBehavior = JsonRequestBehavior.AllowGet, }); }
public JsonResult Return([FromBody] int clothingItemId) { var clothingStoreBL = new ClothingStoreBL(); var data = "Success"; try { clothingStoreBL.Return(clothingItemId); } catch (Exception ex) { data = ex.Message; } return(new JsonResult() { Data = data, JsonRequestBehavior = JsonRequestBehavior.AllowGet, }); }