Example #1
0
        public override void MapFromList(ListItem item, bool includeChildren = false)
        {
            base.MapFromList(item);

            this.Agency = SharePointHelper.ToStringNullSafe(item["Agency"]);
            this.BranchUnitAndAddress        = SharePointHelper.ToStringNullSafe(item["BranchUnitAndAddress"]);
            this.CommentsOfReviewingOfficial = SharePointHelper.ToStringNullSafe(item["CommentsOfReviewingOfficial"]);
            this.DateOfAppointment           = SharePointHelper.ToDateTimeNullIfMin(Convert.ToDateTime(item["DateOfAppointment"]));
            this.DateOfEmployeeSignature     = SharePointHelper.ToDateTimeNullIfMin(Convert.ToDateTime(item["DateOfEmployeeSignature"]));
            this.DateOfReviewerSignature     = SharePointHelper.ToDateTimeNullIfMin(Convert.ToDateTime(item["DateOfReviewerSignature"]));
            this.DateOfSubstantiveReview     = SharePointHelper.ToDateTimeNullIfMin(Convert.ToDateTime(item["DateOfSubstantiveReview"]));
            this.DateReceivedByAgency        = SharePointHelper.ToDateTimeNullIfMin(Convert.ToDateTime(item["DateReceivedByAgency"]));
            this.EmployeeSignature           = SharePointHelper.ToStringNullSafe(item["EmployeeSignature"]);
            this.EmailAddress  = SharePointHelper.ToStringNullSafe(item["EmailAddress"]);
            this.EmployeesName = SharePointHelper.ToStringNullSafe(item["EmployeesName"]);
            this.Grade         = SharePointHelper.ToStringNullSafe(item["Grade"]);
            this.HasAgreementsOrArrangements    = SharePointHelper.ToStringNullSafe(item["HasAgreementsOrArrangements"]) == "True";
            this.HasAssetsOrIncome              = SharePointHelper.ToStringNullSafe(item["HasAssetsOrIncome"]) == "True";
            this.HasGiftsOrTravelReimbursements = SharePointHelper.ToStringNullSafe(item["HasGiftsOrTravelReimbursements"]) == "True";
            this.HasLiabilities              = SharePointHelper.ToStringNullSafe(item["HasLiabilities"]) == "True";
            this.HasOutsidePositions         = SharePointHelper.ToStringNullSafe(item["HasOutsidePositions"]) == "True";
            this.IsSpecialGovernmentEmployee = SharePointHelper.ToStringNullSafe(item["IsSpecialGovernmentEmployee"]) == "True";
            this.MailingAddress              = SharePointHelper.ToStringNullSafe(item["MailingAddress"]);
            this.PositionTitle              = SharePointHelper.ToStringNullSafe(item["PositionTitle"]);
            this.ReportingStatus            = SharePointHelper.ToStringNullSafe(item["ReportingStatus"]);
            this.ReviewingOfficialSignature = SharePointHelper.ToStringNullSafe(item["ReviewingOfficialSignature"]);
            this.SubstantiveReviewer        = SharePointHelper.ToStringNullSafe(item["SubstantiveReviewer"]);
            this.FormStatus         = SharePointHelper.ToStringNullSafe(item["FormStatus"]);
            this.WorkPhone          = SharePointHelper.ToStringNullSafe(item["WorkPhone"]);
            this.Year               = Convert.ToInt32(item["Year"]);
            this.Filer              = ((FieldUserValue)item["Filer"]).LookupValue;
            this.DueDate            = Convert.ToDateTime(item["DueDate"]);
            this.DaysExtended       = Convert.ToInt32(item["DaysExtended"]);
            this.ExtendedText       = this.DaysExtended > 0 ? "Yes (" + this.DaysExtended.ToString() + ")" : "No";
            this.SubmittedPaperCopy = Convert.ToBoolean(item["SubmittedPaperCopy"]);
            this.IsUnchanged        = SharePointHelper.ToStringNullSafe(item["IsUnchanged"]) == "True";
            this.ReSubmittedDate    = Convert.ToDateTime(item["ResubmittedDate"]);

            this.FormFlags = GetFormFlags();


            if (includeChildren)
            {
                this.ReportableInformationList = ReportableInformation.GetAllBy(ListName + "Id", Id, this.Year);
            }
        }
Example #2
0
        public static OGEForm450 GetPreviousFormByUser(string accountName, Settings settings = null)
        {
            if (settings == null)
            {
                settings = Settings.GetAll().FirstOrDefault();
            }

            var        forms    = OGEForm450.GetAllBy("Filer", accountName);
            OGEForm450 prevForm = null;

            if (forms != null)
            {
                prevForm = forms.Where(x => x.Year == settings.CurrentFilingYear - 1 && x.FormStatus != Constants.FormStatus.CANCELED).OrderByDescending(x => x.DueDate).FirstOrDefault();

                if (prevForm != null)
                {
                    prevForm.ReportableInformationList = ReportableInformation.GetAllBy(prevForm.ListName + "Id", prevForm.Id, prevForm.Year);
                }
            }

            return(prevForm);
        }