private void StartAnnualFiling() { var settings = Settings.GetAll().FirstOrDefault(); var expiredForms = OGEForm450.GetAllBy("Year", settings.CurrentFilingYear); expiredForms = expiredForms.Where(x => x.FormStatus != Constants.FormStatus.CERTIFIED && x.FormStatus != Constants.FormStatus.CANCELED).ToList(); // Any incomplete filing for settings.currentFilingYear filing year will be marked as 'expired' foreach (OGEForm450 form in expiredForms) { form.FormStatus = form.FormStatus + " - " + Constants.FormStatus.EXPIRED; form.Save(); } // The filing year will move to settings.currentFilingYear + 1 settings.CurrentFilingYear += 1; settings.AnnualDueDate = settings.AnnualDueDate.AddYears(1); settings.Save(); // All employees with a filer type of '450 Filer' who are not 'On Leave' or 'On Detail' will be assigned a new 'Annual' OGE Form 450 // New forms will be a copy of the previous filing year's form if applicable var emps = Employee.GetAllBy("FilerType", "450 Filer"); emps = emps.Where(x => x.EmployeeStatus != Constants.EmployeeStatus.ON_DETAIL && x.EmployeeStatus != Constants.EmployeeStatus.ON_LEAVE && x.Inactive == false).ToList(); foreach (Employee emp in emps) { if (emp.ReportingStatus != Constants.ReportingStatus.ANNUAL) { emp.ReportingStatus = Constants.ReportingStatus.ANNUAL; emp.Save(); } CreateFormForEmployee(emp, settings); } var email = new Notifications(); email.Title = "Annual Filing Complete"; email.Subject = "OGE Form 450: Annual Filing Initialization - COMPLETE"; email.Body = "The OGE Form 450 Annual Filing Initiation process has completed. Access to the application has been restored."; email.Recipient = settings.CcEmail; email.Status = "Pending"; email.Application = "OGE450"; email.Save(); Settings.IN_MAINTENANCE_MODE = false; }
private IHttpActionResult GetOGE450ChartData() { var data = new OGE450ChartData(); data.Labels = new List <string>(new string[] { "Not-Started", "Draft", "Missing Information", "Overdue", "Submitted", "Certified" }); var settings = Settings.GetAll().FirstOrDefault(); var forms = OGEForm450.GetAllBy("Year", settings.CurrentFilingYear); var notStarted = forms.Where(x => x.FormStatus == Constants.FormStatus.NOT_STARTED).Count(); var draft = forms.Where(x => x.FormStatus == Constants.FormStatus.DRAFT).Count(); var missingInfo = forms.Where(x => x.FormStatus == Constants.FormStatus.MISSING_INFORMATION).Count(); var overdue = forms.Where(x => x.IsOverdue == true).Count(); var submitted = forms.Where(x => x.FormStatus == Constants.FormStatus.SUBMITTED || x.FormStatus == Constants.FormStatus.RE_SUBMITTED).Count(); var certified = forms.Where(x => x.FormStatus == Constants.FormStatus.CERTIFIED).Count(); data.Data = new List <int>(new int[] { notStarted, draft, missingInfo, overdue, submitted, certified }); return(Json(data, CamelCase)); }