private void btnSave_Click(object sender, EventArgs e) { //verify stuff if (checkInfo()) { DateTime start = dateDay.Value.Date + dateStart.Value.TimeOfDay; DateTime end = dateDay.Value.Date + dateEnd.Value.TimeOfDay; DateTime startNew = start.ToUniversalTime(); DateTime endNew = end.ToUniversalTime(); _appt.startTime = startNew; _appt.endTime = endNew; _appt.apptType = cmbType.Text; /* if (chkComplete.Checked) * { * _appt.apptComplete = true; * } * else * { * _appt.apptComplete = false; * }*/ var result = _dbhelper.changeAppointment(_appt); if (result) { if (MessageBox.Show("Appointment changed successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnCancel_Click(object sender, EventArgs e) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); }
private void btnSave_Click(object sender, EventArgs e) { //verify still if (checkCustomerInfo()) { _customer.Name = txtName.Text; _customer.Phone = txtPhone.Text; if (radYes.Checked) { _customer.isActive = true; } else { _customer.isActive = false; } _address.addr1 = txtAddress.Text; _address.addr2 = txtAddress2.Text; _address.city = txtCity.Text; _address.postCode = txtPostalCode.Text; _address.state = cmbState.SelectedItem.ToString(); var result = _dbhelp.updateCustomerInfo(_customer, _address); if (result) { if (MessageBox.Show("Customer changes saved successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnNew_Click(object sender, EventArgs e) { if (checkInfo()) { DateTime start = dateDay.Value.Date + dateStart.Value.TimeOfDay; DateTime end = dateDay.Value.Date + dateEnd.Value.TimeOfDay; DateTime startNew = start.ToUniversalTime(); DateTime endNew = end.ToUniversalTime(); _appt.startTime = startNew; _appt.endTime = endNew; _appt.addrId = _address.addrId; // _appt.petid = _dog.dogId; _appt.customerid = _customer.custId; _appt.apptType = cmbType.Text; var result = _dbhelp.NewAppointment(_appt); if (result) { if (MessageBox.Show("Appointment added successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void button1_Click(object sender, EventArgs e) { var result = _dbhelp.Login(txtUsername.Text, txtPassword.Text); if (result) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } else { MessageBox.Show("Could not log you in. Check username and password.", "Error"); } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete this information?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes) { var result = _dbhelp.DeleteDogInfo(_dog.dogId); if (result) { if (MessageBox.Show("Dog information deleted successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure you want to delete this user?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes) { var result = _dbhelp.DeleteUser(Convert.ToInt32(cmbUsers.SelectedValue)); if (result) { if (MessageBox.Show("user deleted successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnNew_Click(object sender, EventArgs e) { if (checkInfo()) { var result = _dbhelp.CreateUser(txtUsername.Text, txtPassword.Text); if (result) { if (MessageBox.Show("New user added successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnDelete_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to delete this customer?", "Confirm", MessageBoxButtons.YesNo) == DialogResult.Yes) { var result = _dbhelp.DeleteCustomer(_customer, _address); if (result) { if (MessageBox.Show("Customer deleted successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnSave_Click(object sender, EventArgs e) { // _dog.dogName = txtName.Text; _dog.dogName = cmbDogs.Text; _dog.note = richTxtNotes.Rtf; var result = _dbhelp.UpdateDogInfo(_dog); if (result) { if (MessageBox.Show("Dog information saved successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } }
private void btnSave_Click(object sender, EventArgs e) { if (checkInfo()) { _user.userName = txtUsername.Text; _user.Password = txtPassword.Text; var result = _dbhelp.UpdateUser(_user); if (result) { if (MessageBox.Show("User information saved successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }
private void btnAdd_Click(object sender, EventArgs e) { //verify still if (checkInfo()) { _dog.dogName = txtName.Text; _dog.note = richTxtNotes.Rtf; _dog.custId = Convert.ToInt32(cmbCustomers.SelectedValue); var result = _dbhelp.AddNewDog(_dog); if (result) { if (MessageBox.Show("Dog information added successfully.", "Success", MessageBoxButtons.OK) == DialogResult.OK) { MainScreen frm = new MainScreen(); this.Hide(); frm.Show(); } } } }