public FundingSourceBudgetAmount(ProjectFirmaModels.Models.FundingSource fundingSource, decimal?securedAmount, decimal?targetedAmount, string displayCssClass) { FundingSource = fundingSource; SecuredAmount = securedAmount; TargetedAmount = targetedAmount; DisplayCssClass = displayCssClass; }
public void UpdateModel(ProjectFirmaModels.Models.FundingSource fundingSource, FirmaSession currentFirmaSession) { fundingSource.FundingSourceName = FundingSourceName; fundingSource.FundingSourceDescription = FundingSourceDescription; fundingSource.OrganizationID = OrganizationID ?? ModelObjectHelpers.NotYetAssignedID; // should never be null due to Required Validation Attribute fundingSource.IsActive = IsActive ?? false; // should never be null due to Required Validation Attribute fundingSource.FundingSourceAmount = FundingSourceAmount; }
public EditViewModel(ProjectFirmaModels.Models.FundingSource fundingSource) { FundingSourceID = fundingSource.FundingSourceID; FundingSourceName = fundingSource.FundingSourceName; FundingSourceDescription = fundingSource.FundingSourceDescription; OrganizationID = fundingSource.OrganizationID; IsActive = fundingSource.IsActive; FundingSourceAmount = fundingSource.FundingSourceAmount; }
//public ObligationItemBudgetGridSpec ObligationItemBudgetGridSpec { get; } //public string ObligationItemBudgetGridName { get; } //public string ObligationItemBudgetGridDataUrl { get; } public DetailViewData(FirmaSession currentFirmaSession, ProjectFirmaModels.Models.FundingSource fundingSource, ViewGoogleChartViewData viewGoogleChartViewData, GridSpec <ProjectFirmaModels.Models.ProjectFundingSourceBudget> projectFundingSourceBudgetGridSpec, DisplayFundingSourceCustomAttributesViewData displayFundingSourceCustomAttributeTypesViewData) : base(currentFirmaSession) { ViewGoogleChartViewData = viewGoogleChartViewData; FundingSource = fundingSource; PageTitle = fundingSource.GetDisplayName(); EntityName = $"{FieldDefinitionEnum.FundingSource.ToType().GetFieldDefinitionLabel()}"; UserHasFundingSourceManagePermissions = new FundingSourceEditFeature().HasPermission(currentFirmaSession, fundingSource).HasPermission; UserHasFundingSourceCustomAttributeManagePermissions = new FundingSourceCustomAttributeEditFeature().HasPermission(currentFirmaSession, fundingSource).HasPermission; UserHasProjectFundingSourceExpenditureManagePermissions = new FirmaAdminFeature().HasPermissionByFirmaSession(currentFirmaSession); EditFundingSourceUrl = fundingSource.GetEditUrl(); EditFundingSourceCustomAttributesUrl = SitkaRoute <FundingSourceCustomAttributesController> .BuildUrlFromExpression(c => c.EditFundingSourceCustomAttributesForFundingSource(fundingSource)); var projectFundingSourceExpenditures = FundingSource.ProjectFundingSourceExpenditures.ToList(); CalendarYearsForProjectExpenditures = projectFundingSourceExpenditures.CalculateCalendarYearRangeForExpenditures(fundingSource); ProjectCalendarYearExpendituresGridSpec = new ProjectCalendarYearExpendituresGridSpec(CalendarYearsForProjectExpenditures) { ObjectNameSingular = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabel()}", ObjectNamePlural = $"{FieldDefinitionEnum.Project.ToType().GetFieldDefinitionLabelPluralized()}", SaveFiltersInCookie = true }; ProjectCalendarYearExpendituresGridName = "projectsCalendarYearExpendituresFromFundingSourceGrid"; ProjectCalendarYearExpendituresGridDataUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(tc => tc.ProjectCalendarYearExpendituresGridJsonData(fundingSource)); ManageFundingSourcesUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(c => c.Index()); ProjectFundingSourceBudgetGridSpec = projectFundingSourceBudgetGridSpec; ProjectFundingSourceBudgetGridName = "projectsFundingSourceRequestsFromFundingSourceGrid"; ProjectFundingSourceBudgetGridDataUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(tc => tc.ProjectFundingSourceBudgetGridJsonData(fundingSource)); DisplayFundingSourceCustomAttributeTypesViewData = displayFundingSourceCustomAttributeTypesViewData; ContractualInvoiceGridName = "fundingSourceContractualInvoicesGrid"; ContractualInvoiceGridSpec = new ContractualInvoiceGridSpec(currentFirmaSession); ContractualInvoiceGridDataUrl = SitkaRoute <FundingSourceController> .BuildUrlFromExpression(fc => fc.ContractualInvoiceGridOnFundDetailJsonData(fundingSource)); //ObligationItemBudgetGridName = "fundingSourceContractualInvoicesGrid"; //ObligationItemBudgetGridSpec = new ObligationItemBudgetGridSpec(currentFirmaSession); //ObligationItemBudgetGridDataUrl = SitkaRoute<FundingSourceController>.BuildUrlFromExpression(fc => fc.ObligationItemBudgetGridOnFundDetailJsonData(fundingSource)); }
public ProjectRunningBalanceObligationsAndExpendituresRecord(WbsElementPnBudget wbsElementPnBudget) { this.FiscalQuarter = wbsElementPnBudget.FiscalQuarter; this.FiscalYear = wbsElementPnBudget.FiscalYear; this.FiscalMonthPeriod = wbsElementPnBudget.FiscalMonthPeriod; this.Commitments = wbsElementPnBudget.CommittedButNotObligated ?? 0; this.Obligations = wbsElementPnBudget.TotalObligations ?? 0; this.Expenditures = wbsElementPnBudget.TotalExpenditures ?? 0; // Dorothy originally seemed to be telling me this was actually "Unexpended Balances", but that does not appear to be true. // -- SLG 5/29/2020 this.UndeliveredOrders = wbsElementPnBudget.UndeliveredOrders ?? 0; this.CostAuthority = wbsElementPnBudget.CostAuthority; this.BudgetObjectCode = wbsElementPnBudget.BudgetObjectCode; this.FundingSource = wbsElementPnBudget.FundingSource; this.CalendarYear = wbsElementPnBudget.CalendarYear; this.CalendarMonthNumber = wbsElementPnBudget.CalendarMonthNumber; //this.Date = DateTime.Parse($"{wbsElementPnBudget.CalendarYear}{wbsElementPnBudget.CalendarMonthNumber:00}01"); }
public void UpdateModel(ProjectFirmaModels.Models.FundingSource fundingSource, FirmaSession currentFirmaSession) { FundingSourceCustomAttributes?.UpdateModel(fundingSource, currentFirmaSession); }
public EditFundingSourceCustomAttributesViewModel(ProjectFirmaModels.Models.FundingSource fundingSource) { FundingSourceCustomAttributes = new ProjectFirmaModels.Models.FundingSourceCustomAttributes(fundingSource); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static ProjectFundingSourceBudget CreateNewBlank(Project project, FundingSource fundingSource) { return(new ProjectFundingSourceBudget(project, fundingSource)); }
public FundingSourceCalendarYearExpenditure(ProjectFirmaModels.Models.FundingSource fundingSource, Dictionary <int, decimal?> calendarYearExpenditure, string displayCssClass) { FundingSource = fundingSource; CalendarYearExpenditure = calendarYearExpenditure; DisplayCssClass = displayCssClass; }
public ProjectFundingSourceBudgetUpdate(ProjectUpdateBatch projectUpdateBatch, FundingSource fundingSource, int?calendarYear, decimal targetedAmount, int?costTypeID) : this() { ProjectFundingSourceBudgetUpdateID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); ProjectUpdateBatchID = projectUpdateBatch.ProjectUpdateBatchID; ProjectUpdateBatch = projectUpdateBatch; FundingSourceID = fundingSource.FundingSourceID; FundingSource = fundingSource; CalendarYear = calendarYear; ProjectedAmount = targetedAmount; CostTypeID = costTypeID; }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static FundingSourceCustomAttribute CreateNewBlank(FundingSource fundingSource, FundingSourceCustomAttributeType fundingSourceCustomAttributeType) { return(new FundingSourceCustomAttribute(fundingSource, fundingSourceCustomAttributeType)); }
/// <summary> /// Creates a "blank" object of this type and populates primitives with defaults /// </summary> public static ProjectFundingSourceExpenditure CreateNewBlank(Project project, FundingSource fundingSource) { return(new ProjectFundingSourceExpenditure(project, fundingSource, default(int), default(decimal))); }
/// <summary> /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible /// </summary> public ProjectFundingSourceExpenditureUpdate(ProjectUpdateBatch projectUpdateBatch, FundingSource fundingSource, int calendarYear, decimal expenditureAmount) : this() { // Mark this as a new object by setting primary key with special value this.ProjectFundingSourceExpenditureUpdateID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue(); this.ProjectUpdateBatchID = projectUpdateBatch.ProjectUpdateBatchID; this.ProjectUpdateBatch = projectUpdateBatch; projectUpdateBatch.ProjectFundingSourceExpenditureUpdates.Add(this); this.FundingSourceID = fundingSource.FundingSourceID; this.FundingSource = fundingSource; fundingSource.ProjectFundingSourceExpenditureUpdates.Add(this); this.CalendarYear = calendarYear; this.ExpenditureAmount = expenditureAmount; }