Ejemplo n.º 1
0
        public AddReserveForm()
        {
            InitializeComponent();
            _city    = new City();
            _cityBLL = new CityBLL();

            _town    = new Town();
            _townBLL = new TownBLL();

            _clinic    = new Clinic();
            _clinicBLL = new ClinicBLL();

            _hospital    = new Hospital();
            _hospitalBLL = new HospitalBLL();

            _policlinic    = new Policlinic();
            _policlinicBLL = new PolicilinicBLL();

            _doctor    = new Doctor();
            _doctorBLL = new DoctorBLL();

            _reserve    = new Reserve();
            _reserveBLL = new ReverseBLL();

            _user    = new User();
            _userBLL = new UserBLL();
        }
Ejemplo n.º 2
0
        private void btnReserveSave_Click(object sender, EventArgs e)
        {
            Clinic     clinic     = (Clinic)cmbClinic.SelectedValue;
            Hospital   hospital   = (Hospital)cmbHospital.SelectedValue;
            Policlinic policlinic = (Policlinic)cmbPoliclinic.SelectedValue;
            Doctor     doctor     = (Doctor)cmbDoctor.SelectedValue;

            try
            {
                int hcpdID = _reserveBLL.HCPDID(hospital.Id, clinic.Id, policlinic.Id, doctor.ID);
                if (reserveTime != "")
                {
                    _reserve.UserID      = Form1._userID;
                    _reserve.hcpdID      = hcpdID;
                    _reserve.IsDrop      = false;
                    _reserve.IsPassed    = false;
                    _reserve.ReserveDate = dtpReserveDateTime.Value;
                    _reserve.ReserveTime = Convert.ToDateTime(reserveTime);

                    int reserveControl = _reserveBLL.ReserveControl(Form1._userID, clinic.Id);


                    if (reserveControl == 0)
                    {
                        DialogResult dr = MessageBox.Show("Randevunuzu Onaylıyor musunuz?\n\nHastane Adı: " + hospital.Name + "\nKlinik: " + clinic.Name + "\nPoliklinik: " + policlinic.Name + "\nDoktor Adı: " + doctor.FullName + "\nRandevu Tarihi:" + dtpReserveDateTime.Value.ToShortDateString() + "\nRandevu Saati:" + DateTime.Parse(reserveTime.ToString()).ToShortTimeString(), "Randevu Onay", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                        if (dr == DialogResult.Yes)
                        {
                            int affectedRows = _reserveBLL.Insert(_reserve);

                            if (affectedRows == 1)
                            {
                                MessageBox.Show("Randevunuz Kaydedilmiştir", "Randevu işlemi Başarılı", MessageBoxButtons.OK, MessageBoxIcon.Information);

                                ReserveSearch();
                            }
                            else
                            {
                                MessageBox.Show("Hata Var");
                            }
                        }
                        else
                        {
                        }
                    }
                    else
                    {
                        MessageBox.Show("Zaten " + clinic.Name + " bölümüne ait randevunuz bulunmaktadır.");
                    }
                }
                else
                {
                    MessageBox.Show("Randevunuzu Tamamlamak için saat seçmeniz gerekmektedir.");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void cmbPoliclinic_SelectedIndexChanged(object sender, EventArgs e)
        {
            cmbDoctor.Enabled = true;
            ComboBoxItem cbi = (ComboBoxItem)cmbPoliclinic.SelectedItem;

            CPoliclinic = policlinicService.Get(cbi.Value);

            DoctorBind(CPoliclinic.Id);
        }
        public ActionResult Policlinic(int Id)
        {
            Policlinic policlinic = null;

            if (ModelState.IsValid)
            {
                policlinic = DataService.Service.PoliclinicService.SelectFirst(x => x.Id == Id);
                return(Json(policlinic));
            }

            return(Json(null));
        }
Ejemplo n.º 5
0
        private void cmbPoliclinic_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                Town       town       = (Town)cmbTown.SelectedValue;
                Clinic     clinic     = (Clinic)cmbClinic.SelectedValue;
                Hospital   hospital   = (Hospital)cmbHospital.SelectedValue;
                Policlinic policlinic = (Policlinic)cmbPoliclinic.SelectedValue;

                cmbDoctor.DataSource = _doctorBLL.GetDoctor(town.Id, clinic.Id, hospital.Id, policlinic.Id);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 6
0
        public List <Policlinic> GetAllPoliclinic()
        {
            List <Policlinic> listPoliclinic = null;
            Policlinic        policlinic;

            _command.CommandText = "sp_GetAllPoliclinic";
            _command.CommandType = System.Data.CommandType.StoredProcedure;
            _command.Parameters.Clear();


            try
            {
                if (_command.Connection.State == System.Data.ConnectionState.Closed)
                {
                    _command.Connection.Open();
                }

                SqlDataReader rd = _command.ExecuteReader();

                if (rd.HasRows)
                {
                    listPoliclinic = new List <Policlinic>();
                    while (rd.Read())
                    {
                        policlinic            = new Policlinic();
                        policlinic.Id         = (int)rd[0];
                        policlinic.Name       = rd.GetString(1);
                        policlinic.HospitalId = rd.GetInt32(2);
                        policlinic.ClinicId   = rd.GetInt32(3);
                        policlinic.Duration   = rd.GetInt32(4);
                        listPoliclinic.Add(policlinic);
                    }

                    rd.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                _command.Connection.Close();
            }

            return(listPoliclinic);
        }
 public ActionResult Update(Policlinic newPoliclinicData)
 {
     DataService.Service.PoliclinicService.Update(newPoliclinicData);
     return(RedirectToAction("Main", "User"));
 }
 public ActionResult Add(Policlinic policlinicData)
 {
     DataService.Service.PoliclinicService.Insert(policlinicData);
     return(RedirectToAction("Main", "User"));
 }