Esempio n. 1
0
        public ActionResult DeletePartVendorQuoteFile(int rowID)
        {
            string error;
            string partVendorQuoteNumber = "PVQ_" + rowID.ToString();
            string attachmentCategory    = "VendorQuote";

            ObjectParameter tranDT = new ObjectParameter("TranDT", typeof(DateTime?));
            ObjectParameter result = new ObjectParameter("Result", typeof(Int32?));

            try
            {
                _context.usp_PVQ_FileManagement_Delete(partVendorQuoteNumber, attachmentCategory, tranDT, result);
            }
            catch (EntityCommandExecutionException e)
            {
                error = (e.InnerException == null) ? e.Message : e.InnerException.Message;
                return(new HttpStatusCodeResult(410, error));
            }
            catch (Exception e)
            {
                error = (e.InnerException == null) ? e.Message : e.InnerException.Message;
                return(new HttpStatusCodeResult(410, error));
            }
            return(new HttpStatusCodeResult(200));

            //if (ViewData["Attempt"] == null)
            //{
            //    ViewData["Attempt"] = 1;
            //    return new HttpStatusCodeResult(200);
            //}
            //else
            //{
            //    ViewData["Attempt"] = null;
            //    return new HttpStatusCodeResult(410, "TESTING: error capture and display.");
            //}
        }