Пример #1
0
        public APIReturn _Del([FromForm] uint[] ids)
        {
            int affrows = 0;

            foreach (uint id in ids)
            {
                affrows += Faq.Delete(id);
            }
            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"删除成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }
Пример #2
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         if (ModelState.IsValid)
         {
             Faq model = faq.FindBy(id);
             model.Delete();
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         return(View());
     }
 }
Пример #3
0
    private void Delete(string entry)
    {
        try{
            if (entry == "")
            {
                lblMessage.Text = "Select a Title.";
                return;
            }


            if (Faq.Delete(Convert.ToInt32(entry)))
            {
                lblMessage.Text = "The content was succesfully Deleted.";
            }
            else
            {
                lblMessage.Text = "There was problem Deleting the content.";
            }
        }
        catch { }
    }