Ejemplo n.º 1
0
        public ActionResult Edit()
        {
            User user = AuthenticationManager.LoggedUser;

            DoctorService service = new DoctorService();
            Doctor        doctor  = service.GetById(user.Id);

            EditDoctorVM edit = new EditDoctorVM();

            edit.Id        = user.Id;
            edit.Email     = user.Email;
            edit.Password  = user.Password;
            edit.Firstname = user.Firstname;
            edit.Lastname  = user.Lastname;
            edit.Phone     = user.Phone;
            edit.IsAdmin   = AuthenticationManager.LoggedUser.IsAdmin;

            if (doctor != null)
            {
                edit.Specialization = doctor.Specialization;
                edit.Address        = doctor.Address;
            }

            return(View(edit));
        }
Ejemplo n.º 2
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //var doctor = db.Doctors.Find(id);
            var doctor = doctorService.GetById(id);

            if (doctor == null)
            {
                return(HttpNotFound());
            }

            return(View(doctor));
        }
Ejemplo n.º 3
0
        public ActionResult DoctorDetailsInfo(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            var doctor = _doctorService.GetById(id.Value);

            if (doctor == null)
            {
                return(HttpNotFound());
            }

            return(View(doctor));
        }