Пример #1
0
        public RacunReport(DataAccessAdapterBase adapter, long racunGlavaId)
        {
            RacunGlavaEntity racunGlava = RacunGlavaEntity.FetchRacunGlavaForReport(adapter, racunGlavaId);

            RelationPredicateBucket configBucket = new RelationPredicateBucket(ConfigFields.FirmaId == racunGlava.FirmaId);
            ConfigEntity            config       = ConfigEntity.FetchConfigCollection(adapter, configBucket, null).Single();

            CreateObject(racunGlava, config);
        }
Пример #2
0
        public ActionResult GetConfig()
        {
            using (DataAccessAdapterBase adapter = Helper.GetDataAccessAdapter())
            {
                long firmaId = UserEntity.GetFirmaId(adapter, User.Identity.Name);
                RelationPredicateBucket bucket = new RelationPredicateBucket(ConfigFields.FirmaId == firmaId);

                ConfigEntity config = ConfigEntity.FetchConfigCollection(adapter, bucket, null).SingleOrDefault();
                return(CreateJsonResponse(config));
            }
        }
Пример #3
0
        public static IEnumerable <RacunReport> GetRacunReportCollection(DataAccessAdapterBase adapter, RelationPredicateBucket bucket, long firmaId)
        {
            IEnumerable <RacunGlavaEntity> racunGlavaCollection = RacunGlavaEntity.FetchRacunGlavaCollectionForReport(adapter, bucket);

            RelationPredicateBucket configBucket = new RelationPredicateBucket(ConfigFields.FirmaId == firmaId);
            ConfigEntity            config       = ConfigEntity.FetchConfigCollection(adapter, configBucket, null).Single();

            foreach (RacunGlavaEntity racunGlava in racunGlavaCollection)
            {
                yield return(new RacunReport(racunGlava, config));
            }
        }