Ejemplo n.º 1
0
        public ActionResult Edit(Product products)
        {//add
            UserOnline.online();

            StaticUserObj.Add(new UserStatistics {
                UserId = Guid.Parse(User.Identity.GetUserId()), URL = string.Format(Url.Content("~/Sklad/Index")), Message = "Изменен товар " + products.Name + " с ценой " + " и количеством " + products.Count, DateOfCompletion = DateTime.Now
            });
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
        public async Task <JsonResult> Add(Product product)
        {
            this.product = new EFRepository <Product>(new ApplicationDbContext());
            UserOnline.online();

            await sklad.AddProduct(product);

            var user = Guid.Parse(User.Identity.GetUserId());

            NotificationObj.Add(new Notification {
                AspNetUserId = user, Status = false, Url = string.Format(Url.Content("~/Sklad/Index")), Message = "Добавлен товар на склад " + product.Name
            });
            StaticUserObj.Add(new UserStatistics {
                UserId = Guid.Parse(User.Identity.GetUserId()), URL = string.Format(Url.Content("~/Sklad/Index")), Message = "Добавлен товар " + product.Name + " с ценой " + " и количеством " + product.Count, DateOfCompletion = DateTime.Now
            });
            return(Json(product, JsonRequestBehavior.AllowGet));
        }