Пример #1
0
        public ActionResult Delete(int id)
        {
            Author author = dao.Find(id);

            dao.Delete(author);
            return(RedirectToAction("Index"));
        }
Пример #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);
                }
            }
        }
Пример #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
                }));
            }
        }
Пример #4
0
 public static void Delete(int id)
 {
     AuthorDAO.Delete(id);
 }