Example #1
0
 public async Task <IActionResult> ReportUpload(int id)
 {
     try
     {
         using (BillingReportContext context = new BillingReportContext())
         {
             var report         = context.TblReportSummery.Where(i => i.ReportId == id).FirstOrDefault();
             var reportSummmary = new ReportSummery
             {
                 clientName  = report.ClientName,
                 projectName = report.ProjectName,
                 projectType = report.ProjectType
             };
             var mail = report.CreatedByEmail + ";" + _managerSettings.Value.ManagerEmail;
             if (report.ProjectType == "Week")
             {
                 EmailHelper.ReportUploaded(mail, emailSender, "", reportSummmary);
             }
             else
             {
                 EmailHelper.ReportSubmitted(mail, emailSender, "", reportSummmary);
             }
             await context.SaveChangesAsync();
         }
         return(Ok());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #2
0
 public async Task <IActionResult> ChangeStatusReport([FromRoute] int id)
 {
     using (BillingReportContext context = new BillingReportContext())
     {
         var report = context.TblReportSummery.Where(i => i.ReportId == id).FirstOrDefault();
         report.ReportStatus = Convert.ToInt32(ReportStatus.Uploaded);
         context.TblReportSummery.Update(report);
         await context.SaveChangesAsync();
     }
     return(Ok());
 }
Example #3
0
 public async Task <IActionResult> RejectReport([FromRoute] int id, [FromRoute] string remark)
 {
     using (BillingReportContext context = new BillingReportContext())
     {
         var report = context.TblReportSummery.Where(i => i.ReportId == id).FirstOrDefault();
         report.ReportStatus = Convert.ToInt32(ReportStatus.Rejected);
         report.Remark       = remark;
         context.TblReportSummery.Update(report);
         var mail = report.CreatedByEmail + ";" + _managerSettings.Value.ManagerEmail;
         EmailHelper.ReportRejected(mail, emailSender, "", remark, report);
         await context.SaveChangesAsync();
     }
     return(Ok());
 }