Ejemplo n.º 1
0
        private void addDoctor_Click(object sender, EventArgs e)
        {
            AddDoctor ins = new AddDoctor();

            this.Hide();
            ins.ShowDialog();
            updateData();
            this.Show();
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     Utility.InitDb();
     AddRoom.AddRooms();
     AddDoctor.AddDoctors();
     AddPatient.AddPatients();
     AddDisease.AddDiseases();
     AddExam.ImportExams();
     AddRehabilitation.ImportRehabilitation();
     AddSurgery.ImportSurgery();
 }
 public void AddDoctor(AddDoctor dr)
 {
     _dbc.Doctors.Add(new Doctor
     {
         Email     = dr.Email,
         FirstName = dr.FirstName,
         LastName  = dr.LastName,
         //IdDoctor = 1
     });
     _dbc.SaveChanges();
 }
Ejemplo n.º 4
0
 public IActionResult AddDoctor(AddDoctor dr)
 {
     try
     {
         _db.AddDoctor(dr);
         return(Ok(dr));
     }
     catch (Exception e)
     {
         return(BadRequest(e.ToString()));
     }
 }
Ejemplo n.º 5
0
 private void RegistrationDoctorExecute()
 {
     try
     {
         addDoctorWindow = new AddDoctor();
         addDoctorWindow.Show();
         main.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
Ejemplo n.º 6
0
 public IActionResult AddDoctor(AddDoctor addDoctor)
 {
     if (!(hospitalDbContext.Doctor.Where(d => d.IdDoctor == addDoctor.IdDoctor).Any()))
     {
         var doctor = new Doctor {
             IdDoctor  = addDoctor.IdDoctor,
             FirstName = addDoctor.FirstName,
             LastName  = addDoctor.LastName,
             Email     = addDoctor.Email
         };
         hospitalDbContext.Doctor.Add(doctor);
         hospitalDbContext.SaveChanges();
         return(Ok());
     }
     return(BadRequest());
 }
Ejemplo n.º 7
0
        public async void AddNewDoctor()
        {
            Value = true;
            var connection = await apiService.CheckConnection();

            if (!connection.IsSuccess)
            {
                await Application.Current.MainPage.DisplayAlert(
                    Languages.Warning,
                    Languages.CheckConnection,
                    Languages.Ok);

                return;
            }
            if (string.IsNullOrEmpty(FirstName) || string.IsNullOrEmpty(LastName) || string.IsNullOrEmpty(Code) || string.IsNullOrEmpty(FiscalCode) || string.IsNullOrEmpty(Phone))
            {
                Value = true;
                return;
            }
            if (Client == null || Residence == null)
            {
                Value = true;
                return;
            }
            var _residence = new Residence
            {
                comuniLocal = Residence
            };
            var doctor = new AddDoctor
            {
                code       = Code,
                firstName  = FirstName,
                lastName   = LastName,
                fiscalCode = FiscalCode,
                phone      = Phone,
                birthDate  = BirthDate,
                email      = Email,
                residence  = _residence,
                client     = Client
            };
            var cookie = Settings.Cookie;  //.Split(11, 33)
            var res    = cookie.Substring(11, 32);

            var response = await apiService.Save <AddDoctor>(
                "https://portalesp.smart-path.it",
                "/Portalesp",
                "/doctor/save",
                res,
                doctor);

            Debug.WriteLine("********responseIn ViewModel*************");
            Debug.WriteLine(response);

            /*if (!response.IsSuccess)
             * {
             *  await Application.Current.MainPage.DisplayAlert("Error", response.Message, "ok");
             *  return;
             * }*/
            Value = false;
            MessagingCenter.Send((App)Application.Current, "OnSaved");
            DependencyService.Get <INotification>().CreateNotification("PortalSP", "Doctor Added");
            await App.Current.MainPage.Navigation.PopPopupAsync(true);
        }
Ejemplo n.º 8
0
 public AddDoctorViewModels(AddDoctor addDoctorOpen, Doctor doctorEdit)
 {
     doctor    = doctorEdit;
     addDoctor = addDoctorOpen;
 }
Ejemplo n.º 9
0
 public AddDoctorViewModels(AddDoctor addDoctorOpen)
 {
     doctor    = new Doctor();
     addDoctor = addDoctorOpen;
 }