Ejemplo n.º 1
0
        public ActionResult edit(int id)
        {
            if (Convert.ToInt32(Session["userId"]) == id)
            {
                myEditViewModel d = new myEditViewModel();
                d.MemberId    = id;
                d.Name        = _MemberService.GetById(id).Name;
                d.Email       = _MemberService.GetById(id).Email;
                d.Gender      = _MemberService.GetById(id).Gender;
                d.PhoneNumber = _MemberService.GetById(id).PhoneNumber;

                d.member             = _MemberService.GetById(id);
                d.totalProductInCart = _CartService.GetByMemberId(Convert.ToInt32(Session["userId"])).Count();
                return(View(d));
            }
            else
            {
                return(RedirectToAction("Index", "UserHome"));
            }
        }
Ejemplo n.º 2
0
        public ActionResult edit(int id, string Name, string Email, string Gender, string PhoneNumber)
        {
            Member m = new Member();

            m             = _MemberService.GetById(id);
            m.Name        = Name;
            m.Email       = Email;
            m.Gender      = Gender;
            m.PhoneNumber = PhoneNumber;
            _MemberService.Update(m);

            myEditViewModel d = new myEditViewModel();


            d.MemberId    = id;
            d.Name        = _MemberService.GetById(id).Name;
            d.Email       = _MemberService.GetById(id).Email;
            d.Gender      = _MemberService.GetById(id).Gender;
            d.PhoneNumber = _MemberService.GetById(id).PhoneNumber;

            d.member             = _MemberService.GetById(id);
            d.totalProductInCart = _CartService.GetByMemberId(Convert.ToInt32(Session["userId"])).Count();
            return(RedirectToAction("info", "UserDashboard", new { id = id }));
        }