本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
}
示例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();
}
示例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);
}
示例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();
}
示例9: GodinaTrgovanjaCollection
public static List<int> GodinaTrgovanjaCollection(DataAccessAdapterBase adapter)
{
if (null == _godinaTrgovanjaCollection)
{
LoadTrgovanjeGodinaList(adapter);
}
return _godinaTrgovanjaCollection;
}
示例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);
}
示例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);
//}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
}