Esempio n. 1
0
        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"));
            }
        }
Esempio n. 2
0
 public ActionResult ProfileView()
 {
     try
     {
         if (Session["ModId"] != null)
         {
             UserDAO        udao = new UserDAO();
             ModeratorDAO   dao  = new ModeratorDAO();
             SellDAO        sdao = new SellDAO();
             ApplicationDAO adao = new ApplicationDAO();
             ViewBag.Mod = dao.SearchById(int.Parse(Session["ModId"].ToString()));
             User u = udao.SearchById(int.Parse(Session["Id"].ToString()));
             ViewBag.NewUser   = udao.GetMonthUsers().Count;
             ViewBag.NewGame   = adao.GetGamesMonth().Count;
             ViewBag.NewSoft   = adao.GetSoftwareMonth().Count;
             ViewBag.NewMob    = adao.GetMobileMonth().Count;
             ViewBag.SaleCount = sdao.Get7DaysSells();
             ViewBag.User      = u;
             return(View());
         }
         else
         {
             return(RedirectToAction("../Home/Index"));
         }
     }
     catch
     {
         return(RedirectToAction("Index", "Home"));
     }
 }