Example #1
0
 private void DoctorLE_EditValueChanged(object sender, EventArgs e)
 {
     if (DoctorLE.EditValue != null)
     {
         foreach (Doctor dr in _doctor)
         {
             if (dr.ID == int.Parse(DoctorLE.EditValue.ToString()))
             {
                 doctor       = dr;
                 _workingTime = _DB.GetWorkingTime();
                 foreach (Working_time wt in _workingTime)
                 {
                     if (wt.ID == dr.Working_time)
                     {
                         workingTime = wt;
                         WortTimeAM_PM();
                     }
                 }
             }
         }
         HideShowElement(true);
     }
     else
     {
         HideShowElement(false);
     }
 }
Example #2
0
 private void WorkingTimeGridView_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     working_time = new Working_time();
     try
     {
         GridView view = sender as GridView;
         object   row  = view.GetRow(e.RowHandle);
         working_time                      = (Working_time)row;
         Odd_EvenCB.SelectedIndex          = (working_time.Odd_Even == "Parni") ? 2 : 1;
         Morning_AfternoonCB.SelectedIndex = (working_time.Morning_Afternoon == "Jutro") ? 1 : 2;
     }
     catch
     {
     }
 }
Example #3
0
        public bool Execute(Working_time working_time)
        {
            try
            {
                var request = WebRequest.Create("http://localhost:3000/DeleteRadnoVrijeme");
                request.Headers["id"] = working_time.ID.ToString();
                request.GetResponse();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Example #4
0
        public bool Execute(Working_time workingTime)
        {
            try
            {
                var request = WebRequest.Create("http://localhost:3000/InsertRadnoVrijeme");
                request.Headers["odd_even"]          = workingTime.Odd_Even;
                request.Headers["morning_afternoon"] = workingTime.Morning_Afternoon;
                request.GetResponse();
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
        }
Example #5
0
        public bool DeleteWorkingDay(Working_time workingTime)
        {
            try
            {
                DeleteWorkingDay deleteWorkingDay = new DeleteWorkingDay();
                deleteWorkingDay.Execute(workingTime);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
            finally
            {
            }
        }
Example #6
0
        public bool UpdateWorkingDays(Working_time workingTime)
        {
            try
            {
                UpdateWorkingDays updateWorkingDays = new UpdateWorkingDays();
                updateWorkingDays.Execute(workingTime);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
            finally
            {
            }
        }
Example #7
0
        public bool InsertWorkingDay(Working_time workingTime)
        {
            try
            {
                InsertWorkingDay insertWorkingDay = new InsertWorkingDay();
                insertWorkingDay.Execute(workingTime);
                return(true);
            }
            catch (Exception ex)
            {
                return(false);

                throw ex;
            }
            finally
            {
            }
        }
Example #8
0
 private void NewBarItem_ItemClick(object sender, ItemClickEventArgs e)
 {
     if (Odd_EvenCB.SelectedIndex > 0 && Morning_AfternoonCB.SelectedIndex > 0)
     {
         string oddeven          = (Odd_EvenCB.SelectedIndex == 1) ? "Neparni" : "Parni";
         string morningafternoon = (Morning_AfternoonCB.SelectedIndex == 1) ? "Jutro" : "Posljepodne";
         working_time                   = new Working_time();
         working_time.Odd_Even          = oddeven;
         working_time.Morning_Afternoon = morningafternoon;
         if (!_DB.InsertWorkingDay(working_time))
         {
             XtraMessageBox.Show("Element is not added!");
         }
         _working_time = _DB.GetWorkingTime();
         WorkingTimeGridControl.DataSource = _working_time;
         Odd_EvenCB.SelectedIndex          = 0;
         Morning_AfternoonCB.SelectedIndex = 0;
     }
     else
     {
         XtraMessageBox.Show("All fields should be filled!");
     }
 }