/// <summary>
        /// Get all CostManifests for the provided entity
        /// The returned entities are just the basic, unless for the detail view
        /// </summary>
        /// <param name="parentUid"></param>
        /// <returns></returns>
        public static List <CostManifest> GetAll(Guid parentUid)
        {
            List <CostManifest> list = new List <CostManifest>();

            if (parentUid == null)
            {
                return(list);
            }
            CostManifest entity = new CostManifest();

            Entity parent = EntityManager.GetEntity(parentUid);

            LoggingHelper.DoTrace(7, string.Format("Entity_CommonCostManager_GetAll: parentUid:{0} entityId:{1}, e.EntityTypeId:{2}", parentUid, parent.Id, parent.EntityTypeId));

            try
            {
                using (var context = new EntityContext())
                {
                    List <DBEntity> results = context.Entity_CommonCost
                                              .Where(s => s.EntityId == parent.Id)
                                              .OrderBy(s => s.CostManifestId)
                                              .ToList();

                    if (results != null && results.Count > 0)
                    {
                        foreach (DBEntity item in results)
                        {
                            entity = new CostManifest();
                            //
                            //Need all the data for detail page - NA 6/2/2017
                            if (item.CostManifest != null && item.CostManifest.Id > 0 && item.CostManifest.EntityStateId > 2)
                            {
                                entity = CostManifestManager.Get(item.CostManifestId);
                                list.Add(entity);
                            }
                        }
                    }
                    return(list);
                }
            }
            catch (Exception ex)
            {
                LoggingHelper.LogError(ex, thisClassName + ".GetAll");
            }
            return(list);
        }
Exemple #2
0
        public static CostManifest GetBasic(int profileId)
        {
            CostManifest profile = CostManifestManager.GetBasic(profileId);

            return(profile);
        }
Exemple #3
0
        public static CostManifest GetDetail(int profileId, AppUser user)
        {
            CostManifest profile = CostManifestManager.Get(profileId);

            return(profile);
        }