Esempio n. 1
0
 public ActionResult SubmitPO(Model.AttachedDocument model)
 {
     Model.PurchaseOrder po = poService.GetPurchaseOrderById(model.POEntity.Id);
     po.PreparedOn  = DateTime.Now;
     po.PODate      = DateTime.Now;
     po.PreparedBy  = currentStaff.Id;
     po.IsSubmitted = true;
     po.IsApproved  = po.IsRejected = false;
     po.RefNumber   = poService.GenerateUniquNumber(countryProg);
     poService.SaveReviewedPO(po);
     //Send notification
     notificationService.SendToAppropriateApprover(NotificationHelper.poCode, NotificationHelper.approvalCode, po.Id);
     return(ViewPurchaseOrders());
 }
Esempio n. 2
0
 public ActionResult UpdateAttachedDoc(Model.AttachedDocument model)
 {
     if (UserSession.CurrentSession.UploadedDocDetails != null)
     {
         model.FileContent = UserSession.CurrentSession.UploadedDocDetails.FileContent;
         model.FileSize    = UserSession.CurrentSession.UploadedDocDetails.ContentLength;
         model.ContentType = UserSession.CurrentSession.UploadedDocDetails.ContentType;
         model.FileName    = UserSession.CurrentSession.UploadedDocDetails.FileName;
     }
     poService.Update(model);
     UserSession.CurrentSession.UploadedDocDetails = null;
     return(View("LoadAttacheDocs", new AttachedDocument()
     {
         POEntity = poService.GetPurchaseOrderById((Guid)model.DocumentId),
         DocList = poService.GetList((Guid)model.DocumentId, countryProg.Id)
     }));
 }
Esempio n. 3
0
 public ActionResult SaveNewDoc(Model.AttachedDocument model)
 {
     if (UserSession.CurrentSession.UploadedDocDetails == null)
     {
         return(AttachNewDoc((Guid)model.DocumentId));
     }
     model.CountryProgrammeId = countryProg.Id;
     model.AttachedBy         = currentStaff.Id;
     model.AttachedOn         = DateTime.Now;
     model.Id           = Guid.NewGuid();
     model.DocumentType = "PO";
     model.FileContent  = UserSession.CurrentSession.UploadedDocDetails.FileContent;
     model.FileSize     = UserSession.CurrentSession.UploadedDocDetails.ContentLength;
     model.ContentType  = UserSession.CurrentSession.UploadedDocDetails.ContentType;
     model.FileName     = UserSession.CurrentSession.UploadedDocDetails.FileName;
     poService.Save(model);
     UserSession.CurrentSession.UploadedDocDetails = null;
     return(View("LoadAttacheDocs", new AttachedDocument()
     {
         POEntity = poService.GetPurchaseOrderById((Guid)model.DocumentId),
         DocList = poService.GetList((Guid)model.DocumentId, countryProg.Id)
     }));
 }
Esempio n. 4
0
 public ActionResult GetAttachment(Guid docId)
 {
     Model.AttachedDocument doc = poService.GetAttachedDocumentById(docId);
     return(File(doc.FileContent, doc.ContentType, doc.FileName));
 }