public ActionResult Add(string user, string name, string Messege, DateTime DateStart, DateTime DateEnd) { UserOnline.online(); obj.Add(new TasksManager() { UserId = Guid.Parse(user), Name = name, Text = Messege, DateStart = DateStart, DateEnd = DateEnd, Status = false }); NotificationObj.Add(new Notification { AspNetUserId = Guid.Parse(User.Identity.GetUserId()), Url = string.Format(Url.Content("~/Task/Calendar")), Status = false, Message = "Вам назначено новое задание!" }); return(RedirectToAction("Index")); }
public ActionResult ShowTask(TasksManager od, string check) { TaskObj task = new TaskObj(); if (check == "on") { od.Status = true; NotificationObj.Add(new Notification { AspNetUserId = Guid.Parse("3950eec4-39b4-4b16-a4e7-c7e7e3f978c8"), Url = Url.Content("~/Task/Index"), Status = false, Message = "Данный пользователь" + obj.ViewUserName(od.UserId).UserName + " выполнил задания." }); } obj.Edit(od); return(RedirectToAction("Calendar")); }
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)); }