Beispiel #1
0
        public KpiTableEntity GetUserDashboardTileData(int userId, int tilePosition)
        {
            var storageTable = new KpiScheduledTaskStorageTable();
            var tableQuery = storageTable.Table.CreateQuery<KpiTableEntity>();

            return tableQuery.Where(i => i.UserId == userId && i.TilePosition == tilePosition).SingleOrDefault();
        }
Beispiel #2
0
        public List<KpiTableEntity> UserDashboardDataList(int userId)
        {
            var storageTable = new KpiScheduledTaskStorageTable();
            var tableQuery = storageTable.Table.CreateQuery<KpiTableEntity>();

            return tableQuery.Where(i => i.UserId == userId).ToList();
        }
        public void DeleteUserDashboardAllocation()
        {
            CloudCoreDB.Context.Cloudcore_DashboardUserAllocationDelete(UserId, TilePosition);
            var storageTable = new KpiScheduledTaskStorageTable();
            var tableQuery = storageTable.Table.CreateQuery<KpiTableEntity>();

            var kpiItems = tableQuery.Where(i => i.UserId == UserId && i.TilePosition == TilePosition).ToList();

            kpiItems.ForEach(storageTable.Delete);
        }
        public static void UpdateDashboard(string dashboardGuid )
        {
            var storageTable = new KpiScheduledTaskStorageTable();

            var tableQuery = storageTable.Table.CreateQuery<KpiTableEntity>();

            var guid = Guid.Parse(dashboardGuid);

            var kpiItems = tableQuery.Where(i => i.DashboardGuid == guid).ToList();

            kpiItems.ForEach(i =>
            {
                if (!CloudCoreDB.Context.Cloudcore_VwUserDashboard.Select(udi => udi.DashboardGuid == i.DashboardGuid && udi.UserId == i.UserId).Any())
                {
                    storageTable.Delete(i);
                    kpiItems.Remove(i);
                }
            });

            Instance.NotifyOfChanges(kpiItems);
        }
Beispiel #5
0
 private void SaveToTableStorage(IEnumerable<KpiTableEntity> kpiBatchData)
 {
     try
     {
         var storageTable = new KpiScheduledTaskStorageTable();
         var list = kpiBatchData.ToList();
         storageTable.UpdateBatch(list);
     }
     catch (Exception ex)
     {
         ex.Data.Add(Guid.NewGuid().ToString(), "Failed trying to save to table storage.");
         throw;
     }
 }