Example #1
0
        public new ActionResult Profile()
        {
            string username = (string)Session["username"];

            ViewBag.borrower     = BorrowerDAO.GetBorrowerByUsername(username);
            ViewBag.reservations = ReservationDAO.GetReservationByUsername(username);
            ViewBag.reviews      = ReviewDAO.GetReviewByUsername(username);
            ViewBag.message      = "";
            return(View());
        }
Example #2
0
        public ActionResult Profile(FormCollection f)
        {
            string username = (string)Session["username"];
            string name     = f["fullname"];
            string email    = f["email"];
            double deposit  = Convert.ToDouble(f["deposit"]);

            if (BorrowerDAO.UpdateBorrower(name, username, email, deposit) > 0)
            {
                ViewBag.borrower     = BorrowerDAO.GetBorrowerByUsername(username);
                ViewBag.reservations = ReservationDAO.GetReservationByUsername(username);
                ViewBag.message      = "Update Successful!";
            }
            else
            {
                ViewBag.message = "Update Failed!";
            }

            return(View());
        }