コード例 #1
0
        public JsonResult GetStatisticsForMonthAndYear(int month, int year)
        {
            var clothingStoreBL = new ClothingStoreBL();

            return(new JsonResult()
            {
                Data = clothingStoreBL.GetStatisticsForMonthAndYear(month, year),
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
            });
        }
コード例 #2
0
        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,
            });
        }
コード例 #3
0
        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,
            });
        }