///Business Tools private void MIAddBusiness_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("businesses_types") == false) { MessageBox.Show("There are no businesses types to create a business.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (DCom.CountCheckTable("location") == false) { MessageBox.Show("There are no location to create a business.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (DCom.CountCheckTable("work_hours") == false) { MessageBox.Show("There are no work hours to create a business.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (DCom.CountCheckTable("users") == false) { MessageBox.Show("There are no users to create a business.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { BusinessForms.AddBusinessForm AddBusinessForm = new BusinessForms.AddBusinessForm(); AddBusinessForm.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlBusiness); AddBusinessForm.Dispose(); } }
///Ratings Tools private void MIAddRatings_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("users") == false) { MessageBox.Show("There are no user to create a rating.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { RatingsForms.AddRatingsForm AddRatingsForms = new RatingsForms.AddRatingsForm(); AddRatingsForms.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlRatings); AddRatingsForms.Dispose(); } }
/// <summary> /// When the client clicks this Menu Item the system first checks if /// any user type exist. If a login info exists the form for the edit /// of a login info(EditLogin) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the EditUsersTypes form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIEditLogin_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("login") == false) { MessageBox.Show("There are no login info to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { LoginForms.EditLogin EditLogin = new LoginForms.EditLogin(); EditLogin.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlLogin); EditLogin.Dispose(); } }
private void MIEditWorkHours_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("work_hours") == false) { MessageBox.Show("There are no work hours to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { WorkHoursForms.EditWorkHours EditWorkHours = new WorkHoursForms.EditWorkHours(); EditWorkHours.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlWorkHours); EditWorkHours.Dispose(); } }
///Location Tools /// <summary> /// When the client clicks this Menu Item the form for the creation /// of a location(AddLocation) is opening for any actions. /// Then refill the MainGridView and then dispose the Location form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIAddLocation_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("municipality") == false) { MessageBox.Show("There are no municipality to create a location.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { LocationForms.AddLocation AddLocation = new LocationForms.AddLocation(); AddLocation.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlLocation); AddLocation.Dispose(); } }
/// <summary> /// When the client clicks this Menu Item the system first checks if /// any day exist. If a day exists the form for the delete /// of a location(DeleteLocation) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the DeleteLocation form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIDeleteLocation_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("location") == false) { MessageBox.Show("There are no location to delete.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { LocationForms.DeleteLocation DeleteLocation = new LocationForms.DeleteLocation(); DeleteLocation.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlLocation); DeleteLocation.Dispose(); } }
/// <summary> /// When the client clicks this Menu Item the system first checks if /// any day exist. If a day exists the form for the edit /// of a day(EditDays) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the EditDays form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIEditDays_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("days") == false) { MessageBox.Show("There are no days to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { DaysForms.EditDays EditDays = new DaysForms.EditDays(); EditDays.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlDays); EditDays.Dispose(); } }
/// <summary> /// When the client clicks this Menu Item the system first checks if /// any businesses types exist. If a businesses types exists the form for the delete /// of a businesses types(DeleteBusinessesTypes) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the DeleteBusinessesTypes form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIDeleteBusinessesTypes_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("businesses_types") == false) { MessageBox.Show("There are no businesses types to delete.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Businesses_Types.DeleteBusinessesTypes DeleteBusinessesTypes = new Businesses_Types.DeleteBusinessesTypes(); DeleteBusinessesTypes.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlBusinesses_Types); DeleteBusinessesTypes.Dispose(); } }
/// <summary> /// When the client clicks this Menu Item the system first checks if /// any province exist. If a province exists the form for the delete /// of a province(DeleteProvince) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the DeleteProvince form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIDeleteProvince_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("province") == false) { MessageBox.Show("There are no province to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { ProvinceForms.DeleteProvince DeleteProvince = new ProvinceForms.DeleteProvince(); DeleteProvince.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlProvince); DeleteProvince.Dispose(); } }
private void MIDeleteRatings_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("ratings") == false) { MessageBox.Show("There are no ratings to delete.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { RatingsForms.DeleteRatingsForm DeleteRatingsForm = new RatingsForms.DeleteRatingsForm(); DeleteRatingsForm.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlRatings); DeleteRatingsForm.Dispose(); } }
private void MIEditBusiness_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("businesses") == false) { MessageBox.Show("There are no business to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { BusinessForms.EdiBusinessForm EdiBusinessForm = new BusinessForms.EdiBusinessForm(); EdiBusinessForm.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlBusiness); EdiBusinessForm.Dispose(); } }
/// <summary> /// When the client clicks this Menu Item the system first checks if /// any user exist. If a user exists the form for the edit /// of a user(EditUser) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the EditUser form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIEditUser_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("users") == false) { MessageBox.Show("There are no users to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { UserForms.EditUser EditUser = new UserForms.EditUser(); EditUser.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlUsers); EditUser.Dispose(); } }
private void MIEditMunicipality_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("muminipality") == false) { MessageBox.Show("There are no municipalities to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Municipality.EditMunicipality EditMunicipality = new Municipality.EditMunicipality(); EditMunicipality.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlMunicipality); EditMunicipality.Dispose(); } }
//Municipality Tools private void MIAddMunicipality_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("province") == false) { MessageBox.Show("There are no provinces to create a municipality.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { Municipality.AddMunicipality addMunicipality = new Municipality.AddMunicipality(); addMunicipality.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlMunicipality); addMunicipality.Dispose(); } }
private void MIEditReservation_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("reservation") == false) { MessageBox.Show("There are no reservations to edit.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { ReservationForms.EditReservationForm EditReservationForm = new ReservationForms.EditReservationForm(); EditReservationForm.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlReservation); EditReservationForm.Dispose(); } }
///User Tools /// <summary> /// When the client clicks this Menu Item the system first checks if /// any user type exist. If a user type exists the form for the creation /// of a user(AddUser) is opening for any actions. /// Else shows a error message. /// Then refill the MainGridView and then dispose the AddUser form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIAddUser_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("users_types") == false) { MessageBox.Show("There are no users types that reqiured to create a user.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { UserForms.AddUser AddUser = new UserForms.AddUser(); AddUser.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlUsers); AddUser.Dispose(); } }
///Reservation Tools private void MIAddReservation_Click(object sender, EventArgs e) { if (DCom.CountCheckTable("users") == false) { MessageBox.Show("There are no users to create a reservation.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (DCom.CountCheckTable("businesses") == false) { MessageBox.Show("There are no businesses to create a reservation.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { ReservationForms.AddReservationForm AddReservationForm = new ReservationForms.AddReservationForm(); AddReservationForm.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlReservation); AddReservationForm.Dispose(); } }
///Login Tools /// <summary> /// When the client clicks this Menu Item the form for the creation /// of a login info(AddLogin) is opening for any actions. /// Then refill the MainGridView and then dispose the AddLogin form. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MIAddLogin_Click(object sender, EventArgs e) { DataTable DT = DCom.GetData("SELECT count(*) FROM users where users.Username NOT IN (SELECT login.Username FROM login)"); if (DCom.CountCheckTable("users") == false) { MessageBox.Show("There are no users to create a login account.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if ((long)DT.Rows[0][0] == 0) { MessageBox.Show("All the users have a login account.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { LoginForms.AddLogin AddLogin = new LoginForms.AddLogin(); AddLogin.ShowDialog(); MainGridView.DataSource = DCom.GetData(SqlLogin); AddLogin.Dispose(); } }