コード例 #1
0
 protected void btnDelete_Command(object sender, CommandEventArgs e)
 {
     try
     {
         string id = Convert.ToString(e.CommandArgument);
         if (!string.IsNullOrEmpty(id))
         {
             CourseBLL courseBLL = new CourseBLL();
             Courses   course    = new Courses();
             course.CourseId = Convert.ToInt32(QuaintSecurityManager.Decrypt(id));
             if (course.CourseId > 0)
             {
                 if (courseBLL.Delete(course))
                 {
                     Alert(AlertType.Success, "Deleted successfully.");
                     LoadList();
                 }
                 else
                 {
                     Alert(AlertType.Error, "Failed to delete.");
                 }
             }
         }
     }
     catch (Exception)
     {
         Alert(AlertType.Error, "Failed to delete.");
     }
 }