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")); }
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)); }