예제 #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                //mom.IdMom = Convert.ToInt64(idMomTextBox.Text);
                mom = bl.getMother(Convert.ToInt64(idMomTextBox.Text));

                this.DataContext = mom;

                if (mom.DaysRequestMom[0] == true)
                {
                    SunCheck.IsChecked = true;
                    SunStart.Value     = mom.startHour[0];
                    SunEnd.Value       = mom.endHour[0];
                }
                if (mom.DaysRequestMom[1] == true)
                {
                    MonCheck.IsChecked = true;
                    MonStart.Value     = mom.startHour[1];
                    MonEnd.Value       = mom.endHour[1];
                }
                if (mom.DaysRequestMom[2] == true)
                {
                    TueCheck.IsChecked = true;
                    TueStart.Value     = mom.startHour[2];
                    TueEnd.Value       = mom.endHour[2];
                }
                if (mom.DaysRequestMom[3] == true)
                {
                    WedCheck.IsChecked = true;
                    WedStart.Value     = mom.startHour[3];
                    WedEnd.Value       = mom.endHour[3];
                }
                if (mom.DaysRequestMom[4] == true)
                {
                    ThuCheck.IsChecked = true;
                    ThuStart.Value     = mom.startHour[4];
                    ThuEnd.Value       = mom.endHour[4];
                }
                if (mom.DaysRequestMom[5] == true)
                {
                    FriCheck.IsChecked = true;
                    FriStart.Value     = mom.startHour[5];
                    FriEnd.Value       = mom.endHour[5];
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("check your input and try again");
            }
        }
 private void comboBoxChooseChildUpdate_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if (comboBoxChooseChildUpdate.SelectedIndex != -1)
         {
             contract = bl.getContract((long)comboBoxChooseChildUpdate.SelectedValue);
             gridDetalisContract.DataContext = contract;
             mom = bl.getMother((long)comboBoxchooseMomUPdate.SelectedValue);
             gridHourMom.DataContext        = mom;
             buttonUpdateContract.IsEnabled = true;
             buttonUpdateMomhour.IsEnabled  = true;
         }
     }
     catch (Exception Ex)
     {
         MessageBox.Show(Ex.Message);
     }
 }