private bool CheckNurErinnerbareAuftraegeEnthalten(List <int> orderItemIds) { var ctx = new ViaducContext(WebHelper.Settings["sqlConnectionString"]); var items = ctx.OrderingFlatItem.Where(i => orderItemIds.Contains(i.ItemId) && (i.Status != (int)OrderStatesInternal.Ausgeliehen || i.OrderingType != (int)OrderType.Lesesaalausleihen)).ToList(); return(!items.Any()); }
public IHttpActionResult Get() { var ctx = new ViaducContext(WebHelper.Settings["sqlConnectionString"]); return(Ok(ctx.UserOverview .OrderBy(u => u.FamilyName) .ThenBy(u => u.FirstName) .AsQueryable())); }
private async Task <OrderingFlatDetailItem> GetOrderingDetailItemInternal(int id, bool nichtSichtbarEinsehen = false) { var ctx = new ViaducContext(WebHelper.Settings["sqlConnectionString"]); var flatItem = ctx.OrderingFlatItem.FirstOrDefault(i => i.ItemId == id); if (flatItem == null) { return(null); } var item = new OrderingFlatDetailItem(); item.FromFlatItem(flatItem); if (flatItem.VeId.HasValue) { var elasticItem = await GetElasticArchiveRecord(flatItem.VeId.Value.ToString()); if (elasticItem != null) { var ancestors = GetAncestors(elasticItem); item.ArchivplanKontext = ancestors; if (nichtSichtbarEinsehen) { var snapshot = OrderHelper.GetOrderingIndexSnapshot(elasticItem); OrderHelper.ApplySnapshotToDetailItem(snapshot, item.Item); } } else { Log.Warning("elasticRecord nicht gefunden "); } var orderHistory = (await orderManagerClient.GetOrderingHistoryForVe(flatItem.VeId.Value)).ToList(); item.OrderingHistory = orderHistory.Take(3); item.HasMoreOrderingHistory = orderHistory.Count > 3; } var statusHistory = await orderManagerClient.GetStatusHistoryForOrderItem(flatItem.ItemId); item.StatusHistory = statusHistory; return(item); }
public IHttpActionResult Get() { var ctx = new ViaducContext(WebHelper.Settings["sqlConnectionString"]); var access = ManagementHelper.GetUserAccess(); var items = ctx.OrderingFlatItem.AsQueryable() .Where(o => o.Status != (int)OrderStatesInternal.ImBestellkorb); if (!access.HasFeature(ApplicationFeature.AuftragsuebersichtEinsichtsgesucheView)) { items = items.Where(i => i.OrderingType != (int)OrderType.Einsichtsgesuch); } if (!access.HasFeature(ApplicationFeature.AuftragsuebersichtAuftraegeView)) { items = items.Where(i => i.OrderingType != (int)OrderType.Digitalisierungsauftrag && i.OrderingType != (int)OrderType.Lesesaalausleihen && i.OrderingType != (int)OrderType.Verwaltungsausleihe); } return(Ok(items)); }
private List <OrderingFlatItem> GetItemsToCheck(int[] orderItemids) { var ctx = new ViaducContext(WebHelper.Settings["sqlConnectionString"]); return(ctx.OrderingFlatItem.Where(i => orderItemids.Contains(i.ItemId)).ToList()); }