public ActionResult Delete(int id)
        {
            Author author = dao.Find(id);

            dao.Delete(author);
            return(RedirectToAction("Index"));
        }
Example #2
0
        private void Delete_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(Id.Text))
            {
                int id;

                if (int.TryParse(Id.Text, out id))
                {
                    creatorDAO.Delete(id);
                }
            }
        }
Example #3
0
        public JsonResult Delete(long[] id)
        {
            try
            {
                int[] status = new int[id.Length];

                for (int i = 0; i < id.Length; i++)
                {
                    status[i] = dao.Delete(id[i]);
                }

                return(Json(new
                {
                    status = status
                }));
            }
            catch (Exception)
            {
                return(Json(new
                {
                    status = 0
                }));
            }
        }
Example #4
0
 public static void Delete(int id)
 {
     AuthorDAO.Delete(id);
 }