public ActionResult Sales() { try { if (Session["ModId"] != null) { SellDAO dao = new SellDAO(); IList <Sell> s = dao.List(); ViewBag.Sells = dao.List(); ViewBag.Graph1 = dao.Get7DaysSells(); ViewBag.Graph2 = dao.GetMonthlySells(); ViewBag.SaleCount = dao.Get7DaysSells(); UserDAO udao = new UserDAO(); User u = udao.SearchById(int.Parse(Session["Id"].ToString())); ViewBag.User = u; return(View()); } else { return(RedirectToAction("../Home/Index")); } } catch { return(RedirectToAction("../Home/Index")); } }