예제 #1
0
        private void CheckTextBoxDelete(TextBox a)
        {
            if (String.IsNullOrEmpty(a.Text))
            {
                MessageBox.Show("Invalid values entered. Check the input, please");
            }

            else if (fileLogic.GetTitleForDelete(id1, a.Text) == 0)
            {
                MessageBox.Show("No such file exists. Check the input, please");
            }

            else
            {
                fileLogic.DeleteFile("DeleteFile", TitleBox1.Text, dateTimePicker1.Value, id1);
            }
        }
예제 #2
0
 public ActionResult DeleteFile(int ArticleID, string File)
 {
     try
     {
         FileModel fileModel = Flogic.GetCurrentFile(ArticleID, File);
         Flogic.DeleteFile(ArticleID, fileModel.File_ID);
         return(RedirectToAction("EditFile", "File"));
     }
     catch (SqlException sqlException)
     {
         return(View("Error", sqlException));
     }
     catch (InvalidCastException invalidCastException)
     {
         return(View("Error", invalidCastException));
     }
 }