本文整理汇总了C#中DataAccessAdapterBase类的典型用法代码示例。如果您正苦于以下问题:C# DataAccessAdapterBase类的具体用法?C# DataAccessAdapterBase怎么用?C# DataAccessAdapterBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataAccessAdapterBase类属于命名空间,在下文中一共展示了DataAccessAdapterBase类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: UserViewModel
public UserViewModel(DataAccessAdapterBase adapter, long? userId)
{
if (userId.HasValue)
{
this.User = UserEntity.FetchUser(adapter, null, userId.Value);
}
else
{
this.User = new UserEntity();
}
}
开发者ID:malininja,项目名称:NinjaSoftware.Enio,代码行数:11,代码来源:UserViewModel.cs
示例17: SudionikViewModel
public SudionikViewModel(DataAccessAdapterBase adapter, long? sudionikId)
{
if (sudionikId.HasValue)
{
this.Sudionik = SudionikEntity.FetchSudionik(adapter, null, sudionikId.Value);
}
else
{
this.Sudionik = new SudionikEntity();
}
}
开发者ID:vjerch,项目名称:TN,代码行数:11,代码来源:SudionikViewModel.cs
示例18: FetchTrgovanjeGlavaHnbCollection
public static EntityCollection<TrgovanjeGlavaHnbEntity> FetchTrgovanjeGlavaHnbCollection(DataAccessAdapterBase adapter,
DateTime startDate,
DateTime endDate)
{
RelationPredicateBucket bucket = new RelationPredicateBucket();
bucket.PredicateExpression.Add(PredicateHelper.FilterValidEntities(startDate, endDate, TrgovanjeGlavaHnbFields.Datum));
PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.TrgovanjeGlavaHnbEntity);
prefetchPath.Add(TrgovanjeGlavaHnbEntity.PrefetchPathTrgovanjeStavkaHnbCollection);
return FetchTrgovanjeGlavaHnbCollection(adapter, bucket, prefetchPath);
}
开发者ID:vjerch,项目名称:TN,代码行数:12,代码来源:TrgovanjeGlavaHnbEntity.cs
示例19: FetchTrgovanjeGlavaForGuiDisplay
public static TrgovanjeGlavaEntity FetchTrgovanjeGlavaForGuiDisplay(DataAccessAdapterBase adapter, long trgovanjeGlavaId)
{
PrefetchPath2 prefetchPath = new PrefetchPath2(EntityType.TrgovanjeGlavaEntity);
IPrefetchPathElement2 trgovanjeStavkaPrefetchElement = prefetchPath.Add(TrgovanjeGlavaEntity.PrefetchPathTrgovanjeStavkaCollection);
trgovanjeStavkaPrefetchElement.SubPath.Add(TrgovanjeStavkaEntity.PrefetchPathValuta);
trgovanjeStavkaPrefetchElement.SubPath.Add(TrgovanjeStavkaEntity.PrefetchPathTrgovanjeVrsta);
TrgovanjeGlavaEntity trgovanjeGlava = TrgovanjeGlavaEntity.FetchTrgovanjeGlava(adapter, prefetchPath, trgovanjeGlavaId);
trgovanjeGlava.LoadTrgovanjeGlavaPrethodniDan(adapter);
return trgovanjeGlava;
}
开发者ID:vjerch,项目名称:TN,代码行数:12,代码来源:TrgovanjeGlavaEntity.cs
示例20: TrgovanjeMjesecViewModel
public TrgovanjeMjesecViewModel(DataAccessAdapterBase adapter, int godina, int mjesec, ValutaEnum valutaEnum)
{
this.TrgovanjeGlavaCollection = TrgovanjeGlavaEntity.FetchTrgovanjeGlavaCollection(adapter, godina, mjesec, valutaEnum).OrderBy(tg => tg.Datum);
this.Godina = godina;
this.Mjesec = mjesec;
this.ValutaEnum = valutaEnum;
if (ValutaEnum.Kn == valutaEnum)
{
LoadChartData(this.TrgovanjeGlavaCollection);
}
}
开发者ID:vjerch,项目名称:TN,代码行数:12,代码来源:TrgovanjeMjesecViewModel.cs
注:本文中的DataAccessAdapterBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论