コード例 #1
0
        public JsonResult GetLoanFromXmlForPendingApproval()
        {
            String             _xml = string.Empty;
            HttpPostedFileBase file = Request.Files[0]; //Uploaded file, we use the first one asuming that at least one file has been selected.
            //Use the following properties to get file's name, size and MIMEType
            int    fileSize = file.ContentLength;
            string fileName = file.FileName;
            string mimeType = file.ContentType;

            System.IO.Stream fileContent = file.InputStream;

            using (StreamReader reader = new StreamReader(fileContent))
            {
                _xml = reader.ReadToEnd();
            }

            Boolean toReturn = LoanServiceFacade.GetLoanFromXmlForPendingApproval(_xml, AccountHelper.GetUserAccountId());

            if (toReturn)
            {
                return(Json("OK", JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("Error", JsonRequestBehavior.AllowGet));
            }
        }