コード例 #1
0
        private void SetContractorSuspensionNotice()
        {
            if (ContractorStatus.ToUpper() != "A" || ContractorId.ToUpper() == "OWNER" || PermitTypeString == "FR")
            {
                return;
            }



            if (ContractorLiabilityInsuranceExpDate < DateTime.Today.Date.AddDays(9))
            {
                ContractorWarning = "The Contractor's Liability Insurance will expire on " +
                                    ContractorLiabilityInsuranceExpDate.ToShortDateString();
                return;
            }
            if (WorkersCompExpirationDate != DateTime.MinValue &&
                WorkersCompExpirationDate < DateTime.Today.Date.AddDays(9))
            {
                ContractorWarning = "The Contractor's Workman's Compensation Insurance will expire on " +
                                    WorkersCompExpirationDate.ToShortDateString();
                return;
            }

            if ((Inspection_Notice == "180+" &&
                 ContractorSuspendGraceDate < DateTime.Today.Date.AddDays(9)) ||
                (ContractorWarning.Length == 0 && Inspection_Notice == "151-180")
                )
            {
                ContractorWarning = @"In danger of privilege suspension based on permit age.";
                return;
            }

            if (ContractorStateCertExpDate < DateTime.Today.AddDays(9) ||
                ContractorCountyLicenseExpDate < DateTime.Today.Date.AddDays(9))
            {
                if (ContractorStateCertExpDate < DateTime.Today.Date.AddDays(9) &&
                    ContractorStateCertExpDate != DateTime.MinValue)
                {
                    ContractorWarning = @"Contractor's State Certification will expire on: " +
                                        ContractorStateCertExpDate.ToShortDateString();
                    return;
                }

                if (ContractorCountyLicenseExpDate < DateTime.Today.Date.AddDays(9) &&
                    ContractorCountyLicenseExpDate != DateTime.MinValue &&
                    ContractorStateCertExpDate < DateTime.Today.Date.AddDays(9) &&
                    ContractorStateCertExpDate != DateTime.MinValue)
                {
                    ContractorWarning = "Contractor's County License will expire on: " +
                                        ContractorCountyLicenseExpDate.ToShortDateString();
                    return;
                }
            }
        }
コード例 #2
0
        private bool ContractorIssues()
        {
            // Contractor Owners do not have any valid data for these fields
            if (this.ContractorId.ToUpper() == "OWNER" || IsVoided)
            {
                return(false);
            }


            if (PermitNo[0] == '6')
            {
                ContractorId = "FIRE";
                return(false);
            }

            if (string.IsNullOrEmpty(this.ContractorId))
            {
                ErrorText = "There is no contractor selected on this permit. Please contact the Building Department if you would like to schedule an inspection.";
            }

            if (!this.PassedFinal() && (this.PermitNo[0] != '6') && this.ContractorStatus != "A")
            {
                ErrorText = "There is an issue with the contractor's status";
                return(true);
            }

            //var maxDate = ExpirationDates;
            if (ContractorLiabilityInsuranceExpDate < DateTime.Today && (this.PermitNo[0] != '6'))
            {
                ErrorText = "The Contractor's Liability Insurance expiration date has passed";
                return(true);
            }
            if (WorkersCompExpirationDate != DateTime.MinValue &&
                WorkersCompExpirationDate < DateTime.Today)
            {
                ErrorText = "The Contractor's Workman's Compensation Insurance expiration date has passed";
                return(true);
            }


            if (ContractorStateCertExpDate < DateTime.Today ||
                ContractorCountyLicenseExpDate < DateTime.Today)
            {
                if (ContractorStateCertExpDate < DateTime.Today && ContractorStateCertExpDate != DateTime.MinValue)
                {
                    ErrorText += "\nState Certification expired on: " + ContractorStateCertExpDate.ToShortDateString() + System.Environment.NewLine;
                    ErrorText += "Please reach out to the Building Department for assistance or if this is in error.";
                }

                if (ContractorCountyLicenseExpDate < DateTime.Today && ContractorCountyLicenseExpDate != DateTime.MinValue && ContractorStateCertExpDate < DateTime.Today && ContractorStateCertExpDate != DateTime.MinValue)
                {
                    ErrorText += "County License expired on: " + ContractorCountyLicenseExpDate.ToShortDateString() + System.Environment.NewLine;
                    ErrorText += "Please reach out to the Building Department for assistance or if this is in error.";
                }



                return(true);
            }


            //"The grace period for this permit has passed."

            //if(ContractorSuspendGraceDate < DateTime.Today && )
            //{
            //  ErrorText += @"Contractor's Grace Period has passed,
            //                 please reach out to the Building Department
            //                 for assistance or if this is in error";
            //}

            return(ErrorText.Length > 0);
        }