public void DeleteHabit(int id)
        {
            var db    = new MyDatabaseEntities();
            var habit = db.Routines.Find(id);

            db.Routines.Remove(habit);
            db.SaveChanges();
            db.Dispose();
        }
        public void DeleteSpecEvent(int id)
        {
            var db      = new MyDatabaseEntities();
            var specEve = db.SpecEvents.Find(id);

            db.SpecEvents.Remove(specEve);
            db.SaveChanges();
            db.Dispose();
        }
        public void DeleteTask(int id)
        {
            var db   = new MyDatabaseEntities();
            var task = db.Tasks.Find(id);

            db.Tasks.Remove(task);
            db.SaveChanges();
            db.Dispose();
        }
        public void EditPrioEvent(int id, bool prio)
        {
            var db       = new MyDatabaseEntities();
            var speEvent = db.SpecEvents.Find(id);

            speEvent.Prio = prio;

            db.Entry(speEvent).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            db.Dispose();
        }
        public void EditPrioHabit(int id, bool prio)
        {
            var db    = new MyDatabaseEntities();
            var habit = db.Routines.Find(id);

            habit.Prio = prio;

            db.Entry(habit).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            db.Dispose();
        }
        public void EditPrioTask(int id, bool prio)
        {
            var db   = new MyDatabaseEntities();
            var task = db.Tasks.Find(id);

            task.Prio = prio;

            db.Entry(task).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            db.Dispose();
        }
        public void EditHabit(int id, string title, string detail)
        {
            var db    = new MyDatabaseEntities();
            var habit = db.Routines.Find(id);

            habit.Title   = title;
            habit.Details = detail;

            db.Entry(habit).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            db.Dispose();
        }
        public void EditTask(int id, string title, string detail)
        {
            var db   = new MyDatabaseEntities();
            var task = db.Tasks.Find(id);

            task.Title   = title;
            task.Details = detail;

            db.Entry(task).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            db.Dispose();
        }
        public void CreateHabit(string title, string detail, bool prio, bool status)
        {
            var habit = new Routine();

            habit.Title   = title;
            habit.Details = detail;
            habit.Prio    = prio;
            habit.Status  = status;

            var db = new MyDatabaseEntities();

            db.Routines.Add(habit);
            db.SaveChanges();
            db.Dispose();
        }
Esempio n. 10
0
        public void EditSpecEvent(int id, string title, string detail, string location, string start, string end)
        {
            var db      = new MyDatabaseEntities();
            var specEve = db.SpecEvents.Find(id);

            specEve.Title    = title;
            specEve.Location = location;
            specEve.Start    = start;
            specEve.EndTime  = end;
            specEve.Details  = detail;

            db.Entry(specEve).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();
            db.Dispose();
        }
Esempio n. 11
0
        public void CreateTask(DateTime datetime, string title, string detail, bool prio, bool status)
        {
            var task = new Task();

            task.DateTime = datetime;
            task.Title    = title;
            task.Details  = detail;
            task.Prio     = prio;
            task.Status   = status;

            var db = new MyDatabaseEntities();

            db.Tasks.Add(task);
            db.SaveChanges();
            db.Dispose();
        }
Esempio n. 12
0
        public void CreateSpecEvent(DateTime datetime, string title, string location, string start, string end, string detail, bool prio, bool status)
        {
            var specEve = new SpecEvent();

            specEve.DateTime = datetime;
            specEve.Title    = title;
            specEve.Location = location;
            specEve.Start    = start;
            specEve.EndTime  = end;
            specEve.Details  = detail;
            specEve.Prio     = prio;
            specEve.Status   = status;

            var db = new MyDatabaseEntities();

            db.SpecEvents.Add(specEve);
            db.SaveChanges();
            db.Dispose();
        }