private void btnDeleteWeek_Click(object sender, EventArgs e) { DisplayWeeks displayWeek = new DisplayWeeks { DisplayWeeksID = Convert.ToInt32(txtDeleteWeek.Text.Trim()) }; DisplayWeeksController displayWeeksController = new DisplayWeeksController(); bool IsWeekDeleted = displayWeeksController.DeletesDisplayWeeks(displayWeek); if (IsWeekDeleted) { string successMessage = "Hafta silme başarılı."; MessageBox.Show(successMessage); } else { string failMessage = "Hafta silme başarısız."; MessageBox.Show(failMessage); } }
private void btnInsertWeek_Click(object sender, EventArgs e) { DisplayWeeks displayWeek = new DisplayWeeks { WeekName = txtInsertWeek.Text.Trim() }; DisplayWeeksController displayWeeksController = new DisplayWeeksController(); bool IsWeekInserted = displayWeeksController.InsertsDisplayWeeks(displayWeek); if (IsWeekInserted) { string successMessage = "Hafta ekleme başarılı."; MessageBox.Show(successMessage); } else { string failMessage = "Hafta ekleme başarısız."; MessageBox.Show(failMessage); } }
private void btnUpdateWeek_Click(object sender, EventArgs e) { DisplayWeeks displayWeek = new DisplayWeeks { WeekName = txtUpdateWeekName.Text.Trim(), DisplayWeeksID = Convert.ToInt32(txtDisplayWeeksIDToBeUpdated.Text.Trim()) }; DisplayWeeksController displayWeeksController = new DisplayWeeksController(); bool IsWeekUpdated = displayWeeksController.UpdatesDisplayWeeks(displayWeek); if (IsWeekUpdated) { string successMessage = "Hafta güncelleme başarılı."; MessageBox.Show(successMessage); } else { string failMessage = "Hafta güncelleme başarısız."; MessageBox.Show(failMessage); } }