Esempio n. 1
0
        public ActionResult reports()
        {
            reportsViewModel m = new reportsViewModel();

            if (Session["userId"] != null)
            {
                m.Name = _MemberService.GetById(Convert.ToInt32(Session["userId"])).Name;
                m.totalProductInCart = _CartService.GetByMemberId(Convert.ToInt32(Session["userId"])).Count();
            }

            return(View(m));
        }
Esempio n. 2
0
        public ActionResult reports(string title, string description)
        {
            reportsViewModel m = new reportsViewModel();

            if (Session["userId"] != null)
            {
                m.Name = _MemberService.GetById(Convert.ToInt32(Session["userId"])).Name;
                m.totalProductInCart = _CartService.GetByMemberId(Convert.ToInt32(Session["userId"])).Count();
            }

            Report r = new Report();

            r.MemeberId   = Convert.ToInt32(Session["userId"]);
            r.ReportTitle = title;
            r.Description = description;
            r.Date        = DateTime.Now;
            _ReportService.Insert(r);


            return(RedirectToAction("Index"));
        }