コード例 #1
0
ファイル: BinEditVM.cs プロジェクト: modulexcite/BinDays
        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);
        }
コード例 #2
0
 public RubbishBinVM(RubbishBin data)
 {
     Data = data;
 }
コード例 #3
0
 public CollectionDay()
 {
     Date = DateTime.Today;
     Bins = new RubbishBin[0];
 }
コード例 #4
0
ファイル: CollectionDay.cs プロジェクト: modulexcite/BinDays
 public CollectionDay()
 {
     Date = DateTime.Today;
     Bins = new RubbishBin[0];
 }
コード例 #5
0
ファイル: RubbishBinVM.cs プロジェクト: modulexcite/BinDays
 public RubbishBinVM(RubbishBin data)
 {
     Data = data;
 }
コード例 #6
0
ファイル: BinEditVM.cs プロジェクト: modulexcite/BinDays
        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);
        }