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"));
        }
Example #2
0
        public ActionResult Index()
        {
            NotificationObj.TaskSrok(Guid.Parse(User.Identity.GetUserId()), string.Format(Url.Content("~/Task/Calendar")));
            UserOnline.online();
            using (var db = new ApplicationDbContext())
            {
                ViewBag.UserList = db.Users.ToList();
            }

            return(View(obj.ViewsListObj()));
        }
Example #3
0
 public ActionResult Delete(int id)
 {
     UserOnline.online();
     try
     {
         return(View(NotificationObj.ViewsObj(id)));
     }
     catch (Exception)
     {
         return(HttpNotFound());
     }
 }
Example #4
0
 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 DeleteFinish(int id)
 {
     FinishedProducts = new EFRepository <FinishedProducts>(new ApplicationDbContext());
     UserOnline.online();
     try
     {
         return(View(FinishedProducts.FindById(id)));
     }
     catch (Exception)
     {
         return(HttpNotFound());
     }
 }
        public ActionResult DeleteConfirmed(int id)
        {//add
            UserOnline.online();
            try
            {
            }
            catch (Exception)
            {
                return(HttpNotFound());
            }


            return(RedirectToAction("Index"));
        }
        public ActionResult Edit(int?id)
        {
            var db       = new ApplicationDbContext();
            var products = db.Products;

            UserOnline.online();
            try
            {
                return(View());
            }
            catch (Exception)
            {
                return(HttpNotFound());
            }
        }
        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));
        }
Example #9
0
        public ActionResult Index(bool?logOn, bool?logOff, string chatMessage)
        {
            if (!User.Identity.IsAuthenticated)
            {
                return(Redirect("~/Home"));
            }
            UserOnline.online();
            var db     = new ApplicationDbContext();
            var online = from onl in UserOnline.chatModel.Users.ToList()
                         where onl.Name != User.Identity.Name
                         select onl;


            ViewBag.online   = online.ToList();
            ViewBag.newUsers = db.Users.ToList();

            try
            {
                if (!Request.IsAjaxRequest())
                {
                    return(View(UserOnline.chatModel));
                }

                else if (logOn != null && (bool)logOn)
                {
                    return(PartialView("Index", UserOnline.chatModel));
                }

                else if (logOff != null && (bool)logOff)
                {
                    return(PartialView("Index", UserOnline.chatModel));
                }
                else
                {
                    return(PartialView("History", UserOnline.chatModel));
                }
            }
            catch (Exception ex)
            {
                Response.StatusCode = 500;
                return(Content(ex.Message));
            }
        }
        public ActionResult Index()
        {
            NotificationObj.TaskNot(Url.Content("~/Task/Index"));
            NotificationObj.TaskSrok(Guid.Parse(User.Identity.GetUserId()), string.Format(Url.Content("~/Task/Calendar")));
            UserOnline.online();
            var db          = new ApplicationDbContext();
            var newProducts = from newprod in db.Products.ToList()
                              //where (DateTime.Now - newprod.Date <= new TimeSpan(7, 0, 0, 0))
                              select newprod;


            var events = db.Events.ToList();
            var user   = Guid.Parse(User.Identity.GetUserId());



            ViewBag.newProducts = newProducts.Count();

            ViewBag.totalSum = string.Format("{0:N0}", 4);
            ViewBag.events   = events;

            return(View());
        }
Example #11
0
 public ActionResult Index()
 {
     UserOnline.online();
     return(View(NotificationObj.ViewsListObj()));
 }
 public ActionResult ViewInvoice()
 {
     UserOnline.online();
     return(View());
 }
Example #13
0
 public ActionResult Edit(TasksManager task)
 {
     UserOnline.online();
     obj.Edit(task);
     return(RedirectToAction("Index"));
 }
 /// <summary>
 /// Список сырья и приход нового:- Вывод
 /// </summary>
 /// <returns></returns>
 public ActionResult InSklad()
 {
     UserOnline.online();
     ViewBag.Syr = new SelectList(sklad.GetProductList(), "Id", "Name");
     return(View(sklad.GetProductList()));
 }
 /// <summary>
 /// Список сырья
 /// </summary>
 /// <returns></returns>
 public ActionResult Index()
 {
     UserOnline.online();
     return(View(sklad.GetProductList()));
 }
 public ActionResult AddDocument(Document doc)
 {
     UserOnline.online();
     obj.Add(doc);
     return(View());
 }
Example #17
0
 public ActionResult Remove(int id)
 {
     UserOnline.online();
     obj.Remove(id);
     return(RedirectToAction("Index"));
 }
 public ActionResult Chart()
 {
     UserOnline.online();
     return(View());
 }
Example #19
0
 public ActionResult Calendar()
 {
     UserOnline.online();
     return(View());
 }
 // GET: Document
 public ActionResult ViewСlaim()
 {
     UserOnline.online();
     return(View());
 }