当前位置: 首页>>代码示例>>C#>>正文


C# DataAccessAdapterBase类代码示例

本文整理汇总了C#中DataAccessAdapterBase的典型用法代码示例。如果您正苦于以下问题:C# DataAccessAdapterBase类的具体用法?C# DataAccessAdapterBase怎么用?C# DataAccessAdapterBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DataAccessAdapterBase类属于命名空间,在下文中一共展示了DataAccessAdapterBase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateModelFromJson

        public void UpdateModelFromJson(DataAccessAdapterBase adapter, string racunGlavaJson, string racunStavkaCollectionJson)
        {
            JsonSerializerSettings jsonSettings = new JsonSerializerSettings();
            CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentCulture;
            jsonSettings.Culture = currentCulture;

            RacunGlavaEntity racunGlavaDeserialized = JsonConvert.DeserializeObject<RacunGlavaEntity>(racunGlavaJson, jsonSettings);
            this.RacunGlava.UpdateDataFromOtherObject(racunGlavaDeserialized, null, null);

            this.RacunStavkaCollectionToDelete = this.RacunGlava.RacunStavkaCollection.GetEntitiesNotIncludedInJson(racunStavkaCollectionJson);
            foreach (RacunStavkaEntity racunStavka in this.RacunStavkaCollectionToDelete)
            {
                this.RacunGlava.RacunStavkaCollection.Remove(racunStavka);
            }
            
            this.RacunGlava.RacunStavkaCollection.UpdateEntityCollectionFromJson(racunStavkaCollectionJson, RacunStavkaFields.RacunStavkaId, null, null, jsonSettings);

            TarifaEntity tarifa = TarifaEntity.FetchTarifa(adapter, null, this.RacunGlava.TarifaId);

            short counter = 0;
            foreach (RacunStavkaEntity racunStavka in this.RacunStavkaCollection)
            {
                racunStavka.Pozicija = counter++;
                racunStavka.RefreshCalculatedData(tarifa.Stopa);
            }
        }
开发者ID:malininja,项目名称:NinjaSoftware.Enio,代码行数:26,代码来源:RacunViewModel.cs

示例2: AukcijaTrezorskihZapisaPager

        public AukcijaTrezorskihZapisaPager(DataAccessAdapterBase adapter, string baseDirectory)
        {
            this.AukcijaDateDictionary = new Dictionary<DateTime, string>();

            DirectoryInfo directoryInfo = new DirectoryInfo(Path.Combine(baseDirectory, Config.AukcijaTrezorskihZapisaFolderPath()));
            foreach (FileInfo fileInfo in directoryInfo.EnumerateFiles())
            {
                try
                {
                    string[] fileParts = fileInfo.Name.Split('_');
                    int year = Convert.ToInt32(fileParts[3].Replace(".xls", ""));
                    int month = Convert.ToInt32(fileParts[2]);
                    int day = Convert.ToInt32(fileParts[1]);

                    DateTime date = new DateTime(year, month, day);

                    this.AukcijaDateDictionary.Add(date, fileInfo.Name);
                }
                catch (Exception ex)
                {
                    ErrorEntity.LogException(adapter, ex);
                }
            }

            this.AukcijaDateDictionary = this.AukcijaDateDictionary.
                OrderByDescending(ad => ad.Key).
                ToDictionary(ad => ad.Key, ad => ad.Value);
        }
开发者ID:vjerch,项目名称:TN,代码行数:28,代码来源:AukcijaTrezorskihZapisaViewModel.cs

示例3: FetchArtiklCollectionForPaging

		/// <summary>
        /// Efficient pageing for grid.
        /// </summary>
        /// <param name="pageNumber">Must be greater than zero.</param>
        /// <param name="sortDirection">Validne vrijednosti su 'asc' i 'desc'.</param>
        public static EntityCollection<ArtiklEntity> FetchArtiklCollectionForPaging(DataAccessAdapterBase adapter,
			RelationPredicateBucket bucket,
			PrefetchPath2 prefetchPath,
            int pageNumber,
            int pageSize,
            string sortField,
			bool isSortAscending)
        {
			string sortDirection = isSortAscending ? "asc" : "desc";

            Type sortEntityFieldType = typeof(ArtiklFields);
            string sortEntityFieldTypeName = SortHelper.GetEntityFieldTypeNameForSorting(sortField, sortEntityFieldType);
            if (!string.IsNullOrWhiteSpace(sortEntityFieldTypeName))
            {
                sortEntityFieldType = Type.GetType(sortEntityFieldTypeName);
            }

            sortField = SortHelper.GetSortField(sortField);			

			SortExpression sort = SortHelper.GetSortExpression(sortField, sortDirection, sortEntityFieldType);
			
            EntityCollection<ArtiklEntity> toReturn = new EntityCollection<ArtiklEntity>(new ArtiklEntityFactory());
            adapter.FetchEntityCollection(toReturn, bucket, pageSize, sort, prefetchPath, pageNumber, pageSize);

            return toReturn;
        }
开发者ID:malininja,项目名称:NinjaSoftware.Enio,代码行数:31,代码来源:ArtiklEntity.cs

示例4: FetchTrgovanjeGlavaCollection

        public static EntityCollection<TrgovanjeGlavaEntity> FetchTrgovanjeGlavaCollection(DataAccessAdapterBase adapter, int godina, int mjesec, ValutaEnum valutaEnum)
        {
            DateTime startDate = new DateTime(godina, mjesec, 1);
            DateTime endDate = startDate.AddMonths(1);

            return FetchTrgovanjeGlavaCollection(adapter, startDate, endDate, valutaEnum);
        }
开发者ID:vjerch,项目名称:TN,代码行数:7,代码来源:TrgovanjeGlavaEntity.cs

示例5: RepoAukcijaViewModel

        public RepoAukcijaViewModel(DataAccessAdapterBase adapter, DateTime? datumAukcije)
        {
            IEnumerable<DateTime> repoAukcijaDatumList = RepoAukcijaEntity.FetchRepoAukcijaDateCollection(adapter);

            if (datumAukcije.HasValue)
            {
                this.RepoAukcija = RepoAukcijaEntity.FetchRepoAukcija(adapter, null, datumAukcije.Value);
            }

            if (null == this.RepoAukcija)
            {
                this.RepoAukcija = RepoAukcijaEntity.FetchRepoAukcija(adapter, null, repoAukcijaDatumList.Max());
            }

            this.DatumAukcijeSelectList = new List<SelectListItem>();

            foreach (DateTime date in repoAukcijaDatumList)
            {
                SelectListItem selectListItem = new SelectListItem()
                {
                    Value = date.ToShortDateString(),
                    Text = date.ToShortDateString(),
                    Selected = date == this.RepoAukcija.DatumAukcije
                };

                this.DatumAukcijeSelectList.Add(selectListItem);
            }
        }
开发者ID:vjerch,项目名称:TN,代码行数:28,代码来源:RepoAukcijaViewModel.cs

示例6: FetchRepoAukcija

        public static RepoAukcijaEntity FetchRepoAukcija(DataAccessAdapterBase adapter, PrefetchPath2 prefetchPath, DateTime datumAukcije)
        {
            RelationPredicateBucket bucket = new RelationPredicateBucket();
            bucket.PredicateExpression.Add(RepoAukcijaFields.DatumAukcije == datumAukcije);

            return FetchRepoAukcijaCollection(adapter, bucket, prefetchPath).SingleOrDefault();
        }
开发者ID:vjerch,项目名称:TN,代码行数:7,代码来源:RepoAukcijaEntity.cs

示例7: TrgovanjeGodinaViewModel

        public TrgovanjeGodinaViewModel(DataAccessAdapterBase adapter, int godina)
        {
            this.TrgovanjeMjesecList = TrgovanjeMjesec.GetTrgovanjeMjesecCollection(adapter, godina);
            this.Godina = godina;
            LoadChartData(this.TrgovanjeMjesecList);

            this.GodinaSelectList = Helper.CreateTrgovanjeGlavaGodinaSelectList(adapter, godina);
        }
开发者ID:vjerch,项目名称:TN,代码行数:8,代码来源:TrgovanjeGodinaViewModel.cs

示例8: FetchUser

        public static UserEntity FetchUser(DataAccessAdapterBase adapter, string userName, string passwordHash)
        {
            RelationPredicateBucket bucket = new RelationPredicateBucket();
            bucket.PredicateExpression.Add(UserFields.Username == userName);
            bucket.PredicateExpression.Add(UserFields.Password == passwordHash);

            return FetchUserCollection(adapter, bucket, null).SingleOrDefault();
        }
开发者ID:vjerch,项目名称:TN,代码行数:8,代码来源:UserEntity.cs

示例9: GodinaTrgovanjaCollection

        public static List<int> GodinaTrgovanjaCollection(DataAccessAdapterBase adapter)
        {
            if (null == _godinaTrgovanjaCollection)
            {
                LoadTrgovanjeGodinaList(adapter);
            }

            return _godinaTrgovanjaCollection;
        }
开发者ID:vjerch,项目名称:TN,代码行数:9,代码来源:TrgovanjeGlavaHnbEntity.cs

示例10: LoadViewSpecificData

        public void LoadViewSpecificData(DataAccessAdapterBase adapter)
        {
            PrefetchPath2 prefetchPathArtikl = new PrefetchPath2(EntityType.ArtiklEntity);
            prefetchPathArtikl.Add(ArtiklEntity.PrefetchPathPdv);
            this.ArtiklCollection = ArtiklEntity.FetchArtiklCollection(adapter, null, prefetchPathArtikl).OrderBy(a => a.Naziv);

            this.PartnerCollection = PartnerEntity.FetchPartnerCollection(adapter, null, null).OrderBy(p => p.Naziv);
            this.TarifaCollection = TarifaEntity.FetchTarifaCollection(adapter, null, null).OrderBy(t => t.Naziv);
            this.StatusCollection = StatusRoEntity.FetchStatusRoCollection(adapter, null, null).OrderBy(s => s.Name);
        }
开发者ID:malininja,项目名称:NinjaSoftware.Enio,代码行数:10,代码来源:RacunViewModel.cs

示例11: TrgovanjeMjesecRokHnbViewModel

        public TrgovanjeMjesecRokHnbViewModel(DataAccessAdapterBase adapter, int godina, int mjesec)
            : base(adapter, godina, mjesec)
        {
            this.TrgovanjeGlavaHnbCollection = TrgovanjeGlavaHnbEntity.FetchTrgovanjeGlavaHnbCollection(adapter, godina, mjesec).OrderBy(tg => tg.Datum);

            //foreach (TrgovanjeGlavaEntity trgovanjeGlava in this.TrgovanjeGlavaCollection)
            //{
            //    trgovanjeGlava.LoadTrgovanjeGlavaPrethodniDan(adapter);
            //}
        }
开发者ID:vjerch,项目名称:TN,代码行数:10,代码来源:TrgovanjeMjesecRokHnbViewModel.cs

示例12: SetDataSource

        protected override void SetDataSource(DataAccessAdapterBase adapter, int pageNumber, int pageSize, string sortField, bool isSortAscending)
        {
            PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.ArtiklEntity);
            prefetchPath.Add(ArtiklEntity.PrefetchPathPdv);

            IEnumerable<ArtiklEntity> artiklCollection =
                ArtiklEntity.FetchArtiklCollectionForPaging(adapter, null, prefetchPath, pageNumber, pageSize, sortField, isSortAscending);
            this.DataSource = artiklCollection;
            this.NoOfRecords = ArtiklEntity.GetNumberOfEntities(adapter, null);
        }
开发者ID:malininja,项目名称:NinjaSoftware.Enio,代码行数:10,代码来源:ArtiklPager.cs

示例13: SetDataSource

        protected override void SetDataSource(DataAccessAdapterBase adapter, int pageNumber, int pageSize, string sortField, bool isSortAscending)
        {
            PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.RacunGlavaEntity);
            prefetchPath.Add(RacunGlavaEntity.PrefetchPathPartner);
            prefetchPath.Add(RacunGlavaEntity.PrefetchPathStatus);
            prefetchPath.Add(RacunGlavaEntity.PrefetchPathRacunStavkaCollection);

            this.DataSource = RacunGlavaEntity.FetchRacunGlavaCollectionForPaging(adapter, null, prefetchPath, pageNumber, pageSize, sortField, isSortAscending);
            this.NoOfRecords = RacunGlavaEntity.GetNumberOfEntities(adapter, null);
        }
开发者ID:malininja,项目名称:NinjaSoftware.Enio,代码行数:10,代码来源:RacunGlavaPager.cs

示例14: GetHtmlPage

 private HtmlPageEntity GetHtmlPage(DataAccessAdapterBase adapter, long? htmlPageId)
 {
     if (htmlPageId.HasValue && htmlPageId.Value > 0)
     {
         return HtmlPageEntity.FetchHtmlPage(adapter, null, htmlPageId.Value);
     }
     else
     {
         return new HtmlPageEntity();
     }
 }
开发者ID:vjerch,项目名称:TN,代码行数:11,代码来源:AdminController.cs

示例15: TrgovanjeGodinaRokViewModelBase

        public TrgovanjeGodinaRokViewModelBase(DataAccessAdapterBase adapter, int godina)
        {
            this.Godina = godina;

            this.TrgovanjeVrstaList = new List<TrgovanjeVrstaRoEntity>();
            foreach (TrgovanjeVrstaEnum trgovanjeVrstaEnum in Helper.TrgovanjeVrstaEnumArrayZaPrikaz)
            {
                TrgovanjeVrstaRoEntity trgovanjeVrsta = TrgovanjeVrstaRoEntity.FetchTrgovanjeVrstaRo(adapter, null, (long)trgovanjeVrstaEnum);
                this.TrgovanjeVrstaList.Add(trgovanjeVrsta);
            }
        }
开发者ID:vjerch,项目名称:TN,代码行数:11,代码来源:TrgovanjeGodinaRokViewModelBase.cs


注:本文中的DataAccessAdapterBase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。