示例#1
0
 /// <summary>
 /// Initializes a new instance of the form EditSchedule class.
 /// </summary>
 /// <param name="shedule">Shedule form details to edit.</param>
 /// <param name="date">Date of first date in the DataGridView.</param>
 public EditDate(Shedule shedule, DateTime date)
 {
     InitializeComponent();
     this.shedule = shedule;
     this.date    = date;
     startDateTimePicker.Value = date;
 }
示例#2
0
        /// <summary>
        /// Occurs when the Button control is clicked. Sign the user in.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void btnLogin_Click(object sender, EventArgs e)
        {
            user = userController.Login(user = new User()
            {
                Username = txtUsername.Text, Password = txtPassword.Text
            });

            if (user != null)
            {
                if (user.Role == "Error")
                {
                    MessageBox.Show("Kon geen verbinding maken.");
                }
                else
                {
                    Shedule shedule = new Shedule(user);
                    shedule.Show();
                    txtUsername.Text = "";
                    this.Hide();
                }
            }
            else
            {
                MessageBox.Show("De gebruikersnaam of wachtwoord is onjuist");
            }

            txtPassword.Text = "";
        }
 /// <summary>
 /// Initializes a new instance of the form EditAppointment class.
 /// </summary>
 /// <param name="shedule">Shedule form details to edit.</param>
 /// <param name="date">Date of first date in the DataGridView.</param>
 public EditAppointment(Shedule shedule, DateTime date)
 {
     InitializeComponent();
     this.shedule            = shedule;
     this.date               = date;
     timePicker.Format       = DateTimePickerFormat.Custom;
     timePicker.CustomFormat = "HH:mm";
     datePicker.Value        = date;
     timePicker.Value        = date;
 }