Exemplo n.º 1
0
        public void Delete()
        {
            using (var store = new DataStoreContext())
            {
                var bin = store.RubbishBins.FirstOrDefault(x => x.Id == Id);
                if (bin != null)
                {
                    store.RubbishBins.DeleteOnSubmit(bin);
                    store.SubmitChanges();
                }
            }

            new LiveTileUpdater().UpdateTile();
            Status.SetAction("Delete successfully.", true);
        }
Exemplo n.º 2
0
        public void Save()
        {
            using (var store = new DataStoreContext())
            {
                var bin = store.RubbishBins.FirstOrDefault(x => x.Id == Id);
                if (bin != null)
                {
                    store.RubbishBins.DeleteOnSubmit(bin);
                    store.SubmitChanges();
                }

                bin = new RubbishBin
                {
                    BinType    = BinType.Key,
                    OriginDate = OriginDate,
                    Interval   = WeekInterval * 7
                };
                store.RubbishBins.InsertOnSubmit(bin);
                store.SubmitChanges();
            }

            new LiveTileUpdater().UpdateTile();
            Status.SetAction("Saved successfully.", true);
        }
Exemplo n.º 3
0
        public void Save()
        {
            using (var store = new DataStoreContext())
            {
                var bin = store.RubbishBins.FirstOrDefault(x => x.Id == Id);
                if (bin != null)
                {
                    store.RubbishBins.DeleteOnSubmit(bin);
                    store.SubmitChanges();
                }

                bin = new RubbishBin
                {
                    BinType    = BinType.Key,
                    OriginDate = OriginDate,
                    Interval   = WeekInterval * 7
                };
                store.RubbishBins.InsertOnSubmit(bin);
                store.SubmitChanges();
            }

            new LiveTileUpdater().UpdateTile();
            Status.SetAction("Saved successfully.", true);
        }
Exemplo n.º 4
0
        public void Delete()
        {
            using (var store = new DataStoreContext())
            {
                var bin = store.RubbishBins.FirstOrDefault(x => x.Id == Id);
                if (bin != null)
                {
                    store.RubbishBins.DeleteOnSubmit(bin);
                    store.SubmitChanges();
                }
            }

            new LiveTileUpdater().UpdateTile();
            Status.SetAction("Delete successfully.", true);
        }