Esempio n. 1
0
 public ActionResult Documents()
 {
     var model = new ScanDocumentModel();
     var docTypes = contractApi.GetDocument(WorkflowID);
     model.DocumentTypes = from c in docTypes
                           select new SelectListItem
                           {
                               Text = c.DocumentName,
                               Value = c.DocumentTypeId.ToString()
                           };
     return PartialView("_documents", model);
 }
Esempio n. 2
0
 public ActionResult ScanDoc()
 {
     var model = new ScanDocumentModel();
     model.DocumentTypes = GetDocTypes();
     return View(model);
     //   return PartialView("_ScanDoc", model);
 }
Esempio n. 3
0
        public void Index(ScanDocumentModel mod, HttpPostedFileBase file)
        {
            if (ModelState.IsValid)
            {
                var docModel = new Pecuniaus.Models.Contract.DocumentModel();
                string fileName = "";
                string fileType = "";
                if (file != null && file.ContentLength > 0)
                {
                    fileName = "doc_" + ContractID + "_" + Guid.NewGuid() + Path.GetExtension(file.FileName);
                    var path = Path.Combine(Server.MapPath("~/ScanDocuments/"), fileName);
                    file.SaveAs(path);
                    fileType = file.ContentType;
                    // Save Data
                    // TempData["SuccessMsg"] = "Document Updated.";
                    // return RedirectToAction("Index");
                }

                docModel.DocumentId = mod.DocumentID;
                docModel.ContractId = ContractID;
                docModel.MerchantId = CurrentMerchantID;
                docModel.DocumentTypeId = mod.DocumentTypeID;
                docModel.FileName = fileName;
                docModel.FileDetails = fileType;
                docModel.UploadUserId = CurrentUserID;

                if (mod.IsPending)
                {
                    docModel.StatusId = (long)StatusTypes.DocPending;
                }
                else
                {
                    docModel.StatusId = (long)StatusTypes.DocUploaded;
                }
                documentsApi.UpdateDocuments(docModel);

            }

            //var model = new ScanDocumentModel();
            //mod.DocumentTypes = GetDocTypes();

            //return View("ScanDocument", mod);
        }
Esempio n. 4
0
 public ActionResult Index()
 {
     var model = new ScanDocumentModel();
     model.DocumentTypes = GetDocTypes();
     return View(model);
 }