コード例 #1
0
ファイル: StudentController.cs プロジェクト: mahdiQ/Trello2
 public ActionResult Delete(int?Id)
 {
     if (Id != null)
     {
         var std = _StudentBLL.Delete(Id.Value);
     }
     return(RedirectToAction("Index"));
 }
コード例 #2
0
        private void MenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            try
            {
                if (MessageBox.Show("Are you sure you want to delete this???????", "Confirmation",
                                    MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    if (DtgStudents.SelectedItem == null)
                    {
                        MessageBox.Show("You have not selected any item.");
                    }
                    var student = DtgStudents.SelectedItem as Student;

                    _bll.Delete(student.Id);
                    DtgStudents.ItemsSource = _bll.GetAll();
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show($"Could not delete the student. {exception.Message}");
            }
        }
コード例 #3
0
        private void button4_Click(object sender, EventArgs e)
        { //Delete
            StudentBs student1 = new StudentBll();

            student1.Delete(studentId.Text, studentName.Text, lastName.Text, birthDate.Text);
        }