public ObligationItemDetailViewData(FirmaSession currentFirmaSession,
                                            ProjectFirmaModels.Models.ObligationItem obligationItem) : base(currentFirmaSession)
        {
            PageTitle  = $"{FieldDefinitionEnum.ObligationItem.ToType().FieldDefinitionDisplayName}: {obligationItem.GetDisplayName()}";
            EntityName = $"{FieldDefinitionEnum.ObligationItem.ToType().FieldDefinitionDisplayName} Detail";

            ObligationItem         = obligationItem;
            ObligationItemIndexUrl = SitkaRoute <ObligationItemController> .BuildUrlFromExpression(c => c.ObligationItemIndex());

            ContractualInvoiceGridName    = "contractualInvoiceGrid";
            ContractualInvoiceGridSpec    = new ContractualInvoiceGridSpec(currentFirmaSession);
            ContractualInvoiceGridDataUrl = SitkaRoute <ObligationController> .BuildUrlFromExpression(oc => oc.ContractualObligationByObligationItemGridJsonData(ObligationItem));
        }
 /// <summary>
 /// Constructor for building a new object with MinimalConstructor required fields, using objects whenever possible
 /// </summary>
 public WbsElementObligationItemBudget(WbsElement wbsElement, ObligationItem obligationItem, CostAuthority costAuthority, FundingSource fundingSource) : this()
 {
     // Mark this as a new object by setting primary key with special value
     this.WbsElementObligationItemBudgetID = ModelObjectHelpers.MakeNextUnsavedPrimaryKeyValue();
     this.WbsElementID = wbsElement.WbsElementID;
     this.WbsElement   = wbsElement;
     wbsElement.WbsElementObligationItemBudgets.Add(this);
     this.ObligationItemID = obligationItem.ObligationItemID;
     this.ObligationItem   = obligationItem;
     obligationItem.WbsElementObligationItemBudgets.Add(this);
     this.CostAuthorityID = costAuthority.CostAuthorityID;
     this.CostAuthority   = costAuthority;
     costAuthority.WbsElementObligationItemBudgets.Add(this);
     this.FundingSourceID = fundingSource.FundingSourceID;
     this.FundingSource   = fundingSource;
     fundingSource.WbsElementObligationItemBudgets.Add(this);
 }
 /// <summary>
 /// Creates a "blank" object of this type and populates primitives with defaults
 /// </summary>
 public static WbsElementObligationItemBudget CreateNewBlank(WbsElement wbsElement, ObligationItem obligationItem, CostAuthority costAuthority, FundingSource fundingSource)
 {
     return(new WbsElementObligationItemBudget(wbsElement, obligationItem, costAuthority, fundingSource));
 }
예제 #4
0
 public static void DeleteObligationItem(this IQueryable <ObligationItem> obligationItems, ObligationItem obligationItemToDelete)
 {
     DeleteObligationItem(obligationItems, new List <ObligationItem> {
         obligationItemToDelete
     });
 }