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)); }
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")); }