public BinEditVM() { Status = new AppStatus { AutoRemove = true }; BinType = new BinTypeVM(BinDays.BinType.GeneralWaste); OriginDate = DateTime.Today; WeekInterval = 1; EditType = "NEW"; Id = -1; }
public BinEditVM(int id) : this() { using (var store = new DataStoreContext()) { var bin = store.RubbishBins.First(x => x.Id == id); BinType = new BinTypeVM(bin.BinType); OriginDate = bin.OriginDate; WeekInterval = bin.Interval / 7; } EditType = "EDIT"; Id = id; }