Beispiel #1
0
 public TimeSheetController(ITimesheetService timesheetService, IAssociateService associateService, IMembershipService membershipService, MomentaRecruitment.Common.Services.ITimesheetAssociateService timesheetAssociateService)
 {
     this.timesheetService = timesheetService;
     this.associateService = associateService;
     this.membershipService = membershipService;
     this.timesheetAssociateService = timesheetAssociateService;
     this.vatRate = Convert.ToDecimal(ConfigurationManager.AppSettings["VatRate"]);
 }
        private string SetContractingDocumentationStatus(MomentaRecruitment.Common.Models.AssociateModel associate)
        {
            var warning = new StringBuilder();

            switch ((BusinessType?)associate.BusinessTypeId)
            {
                case BusinessType.ContractLtdCompany:
                    {
                        var document = associate.Documents.Where(d => d.DocumentType == AssociateDocumentType.CertificateOfIncorporation).OrderByDescending(d => d.CreatedDate).FirstOrDefault();

                        if (document == null)
                        {
                            warning.Append("<li>Certificate Of Incorporation for Ltd/LLP required.</li>");
                        }
                        else if (document.ApprovedDate == null)
                        {
                            warning.Append("<li>Certificate Of Incorporation review for Ltd/LLP needs review and approval.</li>");
                        }

                        document = associate.Documents.Where(d => d.DocumentType == AssociateDocumentType.ProfessionalIndemnity).OrderByDescending(d => d.CreatedDate).FirstOrDefault();
                        if (document == null)
                        {
                            warning.Append("<li>Professional Indemnity document for Ltd/LLP required.</li>");
                        }
                        else if (document.ApprovedDate == null)
                        {
                            warning.Append("<li>Professional Indemnity document for Ltd/LLP needs review and approval.</li>");
                        }
                    }

                    break;
                case BusinessType.Umbrella:
                    {
                        var document = associate.Documents.Where(d => d.DocumentType == AssociateDocumentType.UmbrellaConfirmation).OrderByDescending(d => d.CreatedDate).FirstOrDefault();

                        if (document == null)
                        {
                            warning.Append("<li>Umbrella Company Confirmation required.</li>");
                        }
                        else if (document.ApprovedDate == null)
                        {
                            warning.Append("<li>Umbrella Company Confirmation needs review and approval.</li>");
                        }
                    }

                    break;
            }

            return warning.ToString();
        }