Exemplo n.º 1
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public GrantAllocationAwardTravelLineItem(GrantAllocationAward grantAllocationAward, string grantAllocationAwardTravelLineItemTarOrMonth, DateTime grantAllocationAwardTravelLineItemDate, GrantAllocationAwardTravelLineItemType grantAllocationAwardTravelLineItemType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.GrantAllocationAwardTravelLineItemID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.GrantAllocationAwardID = grantAllocationAward.GrantAllocationAwardID;
     this.GrantAllocationAward   = grantAllocationAward;
     grantAllocationAward.GrantAllocationAwardTravelLineItems.Add(this);
     this.GrantAllocationAwardTravelLineItemTarOrMonth = grantAllocationAwardTravelLineItemTarOrMonth;
     this.GrantAllocationAwardTravelLineItemDate       = grantAllocationAwardTravelLineItemDate;
     this.GrantAllocationAwardTravelLineItemTypeID     = grantAllocationAwardTravelLineItemType.GrantAllocationAwardTravelLineItemTypeID;
 }
Exemplo n.º 2
0
        public static decimal GetTotalInvoicedToDate(this GrantAllocationAward grantAllocationAward)
        {
            decimal totalInvoicedToDate = 0;

            foreach (var costType in CostType.GetLineItemCostTypes())
            {
                totalInvoicedToDate += grantAllocationAward.GetInvoicedToDateByCostType(costType);
            }

            return(totalInvoicedToDate);
        }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public GrantAllocationAwardContractorInvoice(GrantAllocationAward grantAllocationAward, string grantAllocationAwardContractorInvoiceDescription, string grantAllocationAwardContractorInvoiceNumber, DateTime grantAllocationAwardContractorInvoiceDate, GrantAllocationAwardContractorInvoiceType grantAllocationAwardContractorInvoiceType) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.GrantAllocationAwardContractorInvoiceID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.GrantAllocationAwardID = grantAllocationAward.GrantAllocationAwardID;
     this.GrantAllocationAward   = grantAllocationAward;
     grantAllocationAward.GrantAllocationAwardContractorInvoices.Add(this);
     this.GrantAllocationAwardContractorInvoiceDescription = grantAllocationAwardContractorInvoiceDescription;
     this.GrantAllocationAwardContractorInvoiceNumber      = grantAllocationAwardContractorInvoiceNumber;
     this.GrantAllocationAwardContractorInvoiceDate        = grantAllocationAwardContractorInvoiceDate;
     this.GrantAllocationAwardContractorInvoiceTypeID      = grantAllocationAwardContractorInvoiceType.GrantAllocationAwardContractorInvoiceTypeID;
 }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public GrantAllocationAwardSuppliesLineItem(GrantAllocationAward grantAllocationAward, string grantAllocationAwardSuppliesLineItemDescription, string grantAllocationAwardSuppliesLineItemTarOrMonth, DateTime grantAllocationAwardSuppliesLineItemDate, decimal grantAllocationAwardSuppliesLineItemAmount) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.GrantAllocationAwardSuppliesLineItemID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.GrantAllocationAwardID = grantAllocationAward.GrantAllocationAwardID;
     this.GrantAllocationAward   = grantAllocationAward;
     grantAllocationAward.GrantAllocationAwardSuppliesLineItems.Add(this);
     this.GrantAllocationAwardSuppliesLineItemDescription = grantAllocationAwardSuppliesLineItemDescription;
     this.GrantAllocationAwardSuppliesLineItemTarOrMonth  = grantAllocationAwardSuppliesLineItemTarOrMonth;
     this.GrantAllocationAwardSuppliesLineItemDate        = grantAllocationAwardSuppliesLineItemDate;
     this.GrantAllocationAwardSuppliesLineItemAmount      = grantAllocationAwardSuppliesLineItemAmount;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public GrantAllocationAwardPersonnelAndBenefitsLineItem(GrantAllocationAward grantAllocationAward, string grantAllocationAwardPersonnelAndBenefitsLineItemTarOrMonth, DateTime grantAllocationAwardPersonnelAndBenefitsLineItemDate, int grantAllocationAwardPersonnelAndBenefitsLineItemTarHours, decimal grantAllocationAwardPersonnelAndBenefitsLineItemHourlyRate, decimal grantAllocationAwardPersonnelAndBenefitsLineItemFringeRate) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.GrantAllocationAwardPersonnelAndBenefitsLineItemID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.GrantAllocationAwardID = grantAllocationAward.GrantAllocationAwardID;
     this.GrantAllocationAward   = grantAllocationAward;
     grantAllocationAward.GrantAllocationAwardPersonnelAndBenefitsLineItems.Add(this);
     this.GrantAllocationAwardPersonnelAndBenefitsLineItemTarOrMonth = grantAllocationAwardPersonnelAndBenefitsLineItemTarOrMonth;
     this.GrantAllocationAwardPersonnelAndBenefitsLineItemDate       = grantAllocationAwardPersonnelAndBenefitsLineItemDate;
     this.GrantAllocationAwardPersonnelAndBenefitsLineItemTarHours   = grantAllocationAwardPersonnelAndBenefitsLineItemTarHours;
     this.GrantAllocationAwardPersonnelAndBenefitsLineItemHourlyRate = grantAllocationAwardPersonnelAndBenefitsLineItemHourlyRate;
     this.GrantAllocationAwardPersonnelAndBenefitsLineItemFringeRate = grantAllocationAwardPersonnelAndBenefitsLineItemFringeRate;
 }
Exemplo n.º 6
0
        public static decimal GetInvoicedToDateByCostType(this GrantAllocationAward grantAllocationAward, CostType costType)
        {
            decimal invoicedToDate = 0;

            switch (costType.CostTypeID)
            {
            case (int)CostTypeEnum.Contractual:
                invoicedToDate = grantAllocationAward.ContractualLineItemSum;
                break;

            case (int)CostTypeEnum.IndirectCosts:
                invoicedToDate = grantAllocationAward.IndirectCostTotal;
                break;

            case (int)CostTypeEnum.Supplies:
                invoicedToDate = grantAllocationAward.SuppliesLineItemAmountSum;
                break;

            case (int)CostTypeEnum.Travel:
                invoicedToDate = grantAllocationAward.TravelLineItemSum;
                break;

            case (int)CostTypeEnum.Personnel:
                invoicedToDate = grantAllocationAward.GrantAllocationAwardPersonnelAndBenefitsLineItems.Sum(pb => pb.GrantAllocationAwardPersonnelAndBenefitsLineItemHourlyTotal);
                break;

            case (int)CostTypeEnum.Benefits:
                invoicedToDate = grantAllocationAward.GrantAllocationAwardPersonnelAndBenefitsLineItems.Sum(pb => pb.GrantAllocationAwardPersonnelAndBenefitsLineItemFringeTotal);
                break;

            case (int)CostTypeEnum.Equipment:
            case (int)CostTypeEnum.Other:
                break;

            default:
                throw new Exception($"Unhandled CostTypeID {costType.CostTypeID} when trying to get the invoiced to date dollar amount for said cost type.");
            }

            return(invoicedToDate);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static GrantAllocationAwardTravelLineItem CreateNewBlank(GrantAllocationAward grantAllocationAward, GrantAllocationAwardTravelLineItemType grantAllocationAwardTravelLineItemType)
 {
     return(new GrantAllocationAwardTravelLineItem(grantAllocationAward, default(string), default(DateTime), grantAllocationAwardTravelLineItemType));
 }
Exemplo n.º 8
0
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static GrantAllocationAwardPersonnelAndBenefitsLineItem CreateNewBlank(GrantAllocationAward grantAllocationAward)
 {
     return(new GrantAllocationAwardPersonnelAndBenefitsLineItem(grantAllocationAward, default(string), default(DateTime), default(int), default(decimal), default(decimal)));
 }
Exemplo n.º 9
0
 public static void DeleteGrantAllocationAward(this IQueryable <GrantAllocationAward> grantAllocationAwards, GrantAllocationAward grantAllocationAwardToDelete)
 {
     DeleteGrantAllocationAward(grantAllocationAwards, new List <GrantAllocationAward> {
         grantAllocationAwardToDelete
     });
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static GrantAllocationAwardContractorInvoice CreateNewBlank(GrantAllocationAward grantAllocationAward, GrantAllocationAwardContractorInvoiceType grantAllocationAwardContractorInvoiceType)
 {
     return(new GrantAllocationAwardContractorInvoice(grantAllocationAward, default(string), default(string), default(DateTime), grantAllocationAwardContractorInvoiceType));
 }
Exemplo n.º 11
0
 public static bool CanGrantAllocationAwardBeDeleted(this GrantAllocationAward grantAllocationAward)
 {
     return(!grantAllocationAward.HasDependentObjects());
 }
Exemplo n.º 12
0
 public static string GetDeleteUrl(this GrantAllocationAward grantAllocationAward)
 {
     return(DeleteUrlTemplate.ParameterReplace(grantAllocationAward.GrantAllocationAwardID));
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static GrantAllocationAwardSuppliesLineItem CreateNewBlank(GrantAllocationAward grantAllocationAward)
 {
     return(new GrantAllocationAwardSuppliesLineItem(grantAllocationAward, default(string), default(string), default(DateTime), default(decimal)));
 }