Пример #1
0
 public ActionResult SubmitCC(Guid id)
 {
     Model.CompletionCertificate CC = ccService.GetCCById(id);
     CC.IsRejected  = false;
     CC.IsSubmitted = true;
     CC.PreparedBy  = currentStaff.Id;
     CC.PreparedOn  = DateTime.Now;
     CC.RefNumber   = ccService.GenerateUniquNumber(countryProg);
     ccService.UpdateCC(CC);
     notificationService.SendToAppropriateApprover(NotificationHelper.ccCode, NotificationHelper.approvalCode, CC.Id);
     return(ViewCC());
 }
Пример #2
0
 public static ViewCC PrepareCC(Guid CCid, ICompletionCertificateService ccService)
 {
     using (var db = new SCMSEntities())
     {
         var item  = ccService.GetCCById(CCid);
         var model = new ViewCC()
         {
             EntityCC    = item,
             PreparedBy  = db.VStaffDetails.FirstOrDefault(p => p.StaffID == item.PreparedBy),
             ComfirmedBy = db.VStaffDetails.FirstOrDefault(p => p.StaffID == item.ConfirmedBy),
             AprovedBy   = db.VStaffDetails.FirstOrDefault(p => p.StaffID == item.ApprovedBy)
         };
         return(model);
     }
 }