public ActionResult Create(DoctorVM doctor)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    IBL bL = new BlClass();
                    Dictionary <string, string> errorMessege = bL.PersonValidation(doctor.Current);
                    if (errorMessege.Count == 0)
                    {
                        bL.AddDoctor(doctor.Current);
                        ViewBag.TitlePopUp = "עבר בהצלחה";
                        ViewBag.Message    = "הרופא.ה התווספ.ה בהצלחה למאגר הרופאים";
                        return(View("Index", new DoctorModel().getDoctorVms()));
                    }

                    foreach (var item in errorMessege)
                    {
                        ModelState.AddModelError(item.Key, item.Value);
                    }
                }
                return(View(doctor));
            }
            catch (Exception ex)
            {
                ViewBag.TitlePopUp = "שגיאה";
                ViewBag.Message    = ex.Message;
                return(View("Index", new DoctorModel().getDoctorVms()));
            }
        }
Example #2
0
        //private IEventAggregator eventAggregator;
        public DoctorUC()
        {
            DoctorVM VM = new DoctorVM((App.Current as App).controlManage);

            DataContext = VM;
            InitializeComponent();
        }
Example #3
0
        public async Task <ActionResult <string> > Add([FromBody] DoctorVM doctor)
        {
            var doctorId = await _addUpdateDoctor.Execute(new Models.Doctor
            {
                DoctorName = doctor.DoctorName,
                Address    = doctor.Address
            });

            return(CreatedAtAction("Get", new { id = doctorId }));
        }
Example #4
0
        public ActionResult EditDoctor(DoctorVM doctorVM)
        {
            var doctor = doctorService.GetDoctors().FirstOrDefault(doctorID => doctorID.DoctorId == doctorVM.DoctorId);

            doctor.FirstName   = doctorVM.FirstName;
            doctor.LastName    = doctorVM.LastName;
            doctor.Patronymic  = doctorVM.Patronymic;
            doctor.PhoneNumber = doctorVM.PhoneNumber;
            doctorService.EditDoctor(doctor);
            return(RedirectToAction("ListDoctors", "Home"));
        }
Example #5
0
 public ActionResult DeleteDoctor(DoctorVM doctorVM)
 {
     try
     {
         doctorService.DeleteDoctor(doctorVM.DoctorId);
         return(RedirectToAction("ListDoctors", "Home"));
     }
     catch
     {
         ViewBag.Title   = "Ошибка удаления врача.";
         ViewBag.Message = "Не удалось удалить врача с идентификационным номером = " + doctorVM.DoctorId;
         return(View("Error"));
     }
 }
Example #6
0
        public IActionResult Doctor(DoctorVM doc, string Payment, string offlinepay)
        {
            int Patient_Reg_Id = (int)HttpContext.Session.GetInt32("User_Reg_Id");
            int Patient_Id     = _HDB.Patients.Where(f => f.Registration_Id == Patient_Reg_Id).Select(h => h.Id).SingleOrDefault();

            Patient p;

            p = _HDB.Patients.FirstOrDefault(s => s.Id == Patient_Id);
            p.Medical_Record = doc.MedicalRecord;
            _HDB.Update(p);
            _HDB.SaveChanges();

            Follow_Up fup = new Follow_Up();

            fup.Patient_Id = Patient_Id;
            fup.Staff_Id   = doc.Id;
            fup.Status     = "Pending";

            _HDB.Add(fup);
            _HDB.SaveChanges();

            Follow_Up_History fuph = new Follow_Up_History();

            fuph.Date = doc.Date + "T" + doc.Hour;
            fuph.Follow_Up_Type_Id = 2;
            fuph.Follow_Up_Id      = fup.Id;

            _HDB.Add(fuph);
            _HDB.SaveChanges();
            ViewBag.message = "Your Time has been recorded";
            HttpContext.Session.SetInt32("choose_test", 2);

            if (Payment == "PayOnline")
            {
                return(RedirectToAction("Payment", "Patient"));
            }
            else //if (offlinepay == "offlinepay")
            {
                return(RedirectToAction("offlinepay", "Patient"));
            }
        }
        public List <DoctorVM> GetDoctors(int spId)
        {
            List <Doctor>   doctors  = _context.Doctors.Include("Gender").Include("Speacialization").Where(x => x.SpeacializationId == spId).ToList();
            List <DoctorVM> doctors1 = new List <DoctorVM>();

            foreach (var item in doctors)
            {
                DoctorVM vM = new DoctorVM
                {
                    DoctorId        = item.DoctorId,
                    AboutDetails    = item.AboutDetails,
                    BMDCNumber      = item.BMDCNumber,
                    Email           = item.Email,
                    FullName        = item.FullName,
                    Gender          = item.Gender.GenderName,
                    PhoneNumber     = item.PhoneNumber,
                    Photo           = item.Photo,
                    Speacialization = item.Speacialization.SpeacializationDepartment
                };
                doctors1.Add(vM);
            }
            return(doctors1);
        }
        public async Task NotifyOfNewUser(ApplicationUser user, Roles role)
        {
            if (role != Roles.admin)
            {
                string  group;
                IUserVM userVM;

                if (role == Roles.doctor)
                {
                    group  = UserGroups.PatientsGroup.ToString();
                    userVM = new DoctorVM();
                }
                else
                {
                    group  = UserGroups.DoctorsGroup.ToString();
                    userVM = new PatientVM();
                }

                await dataHub.Clients.Groups(group).SendCoreAsync(
                    "OnNewUserAdded",
                    new object[] { mapper.Map(user, userVM) }
                    );
            }
        }
Example #9
0
 public DoctorCommand(DoctorVM VM)
 {
     CurrentVM = VM;
 }
Example #10
0
        // GET: Doctor/SearchDoctor
        public async Task <ActionResult> SearchDoctor(DoctorVM model)
        {
            HttpClient             Client = new HttpClient();
            IEnumerable <DoctorVM> list;

            System.Diagnostics.Debug.WriteLine("******************specialit :" + model.speciality_id);
            System.Diagnostics.Debug.WriteLine("******************lon :" + model.longitude);
            System.Diagnostics.Debug.WriteLine("******************lat :" + model.latitude);
            System.Diagnostics.Debug.WriteLine("******************name :" + model.name);
            string uriString = "http://localhost:18080/epione-jee-web/api/Doctor";

            Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            //search by speciality
            if (model.latitude == null && model.longitude == null && model.name == null && model.speciality_id != 0)
            {
                uriString = uriString + "?idS=" + model.speciality_id;
            }
            //search by name
            else if (model.latitude == null && model.longitude == null && model.name != null &&
                     model.speciality_id == 0)
            {
                uriString = uriString + "?name=" + model.name;
            }
            //search by location
            else if (model.latitude != null && model.longitude != null && model.name == null &&
                     model.speciality_id == 0)
            {
                uriString = uriString + "?lon=" + model.longitude + "&lat=" + model.latitude;
            }
            //search by name and speciality
            else if (model.latitude == null && model.longitude == null && model.name != null &&
                     model.speciality_id != 0)
            {
                uriString = uriString + "?idS=" + model.speciality_id + "&name=" + model.name;
                System.Diagnostics.Debug.WriteLine(uriString);
            }
            //search by name and location
            else if (model.latitude != null && model.longitude != null && model.name != null &&
                     model.speciality_id == 0)
            {
                uriString = uriString + "?lon=" + model.longitude + "&lat=" + model.latitude + "&name=" + model.name;
            }
            //search by location and speciality
            else if (model.latitude != null && model.longitude != null && model.name == null &&
                     model.speciality_id != 0)
            {
                uriString = uriString + "?idS=" + model.speciality_id + "&lon=" + model.longitude + "&lat=" +
                            model.latitude + "&name=" + model.name;
            }
            else
            {
                uriString = "http://localhost:18080/epione-jee-web/api/Home/Index";
            }

            // HttpResponseMessage response = await Client.GetAsync("http://localhost:18080/epione-jee-web/api/Doctor?idS=1&lon=&lat=5&name=oumayma");
            HttpResponseMessage response = await Client.GetAsync(uriString);

            System.Diagnostics.Debug.WriteLine("http://localhost:18080/epione-jee-web/api/Doctor?idS=" +
                                               model.speciality_id + "&lon=" + model.longitude + "&lat=" +
                                               model.latitude + "&name=" + model.name);
            if (response.IsSuccessStatusCode)
            {
                list = await response.Content.ReadAsAsync <IEnumerable <DoctorVM> >();

                System.Diagnostics.Debug.WriteLine("******************DOCTOR LIST LENGTH :" + list.Count());
                ViewData["doctorsList"] = list;
            }
            else
            {
                ViewBag.result = "erreur";
            }

            return(View());
        }