Ejemplo n.º 1
0
        public ActionResult Index(POViwerModel model)
        {
            if (ModelState.IsValid)
            {
                POViewerServices PSvc = new POViewerServices();
                model = PSvc.GetPODocument(model.PONumber);

                if (model == null)
                {
                    ModelState.AddModelError("PONumber", "Purchase order not found or matched");
                    return(View("Index", model));
                }
            }
            return(View("Index", model));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get purchase order
        /// </summary>
        /// <param name="PONumber">a string parameter</param>
        /// <returns>return purchase order file</returns>
        public ActionResult GetPOFile(string PONumber)
        {
            POViwerModel POViewModel = new POViwerModel();

            try
            {
                POViewerServices PSvc = new POViewerServices();
                POViewModel = PSvc.GetPODocument(PONumber);

                if (POViewModel.InvoiceDocument.Length > 0)
                {
                    return(File(POViewModel.InvoiceDocument, POViewModel.InvoiceMIME));
                }
            }
            catch (Exception ex)
            {
                Console.Write(ex);
            }
            return(View("Index", POViewModel));
        }