Esempio n. 1
0
        public Label CreateLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                label = db.Labels.Add(label);
                db.SaveChanges();

                return(label);
            }
        }
Esempio n. 2
0
        public Area UpdateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                db.Entry(area).State = EntityState.Modified;
                db.SaveChanges();

                return(area);
            }
        }
Esempio n. 3
0
        public Activity CreateActivity(Activity activity)
        {
            using (var db = new CardsDb())
            {
                db.Activities.Add(activity);
                db.SaveChanges();

                return(activity);
            }
        }
Esempio n. 4
0
        public Card CreateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                var result = db.Cards.Add(card);
                db.SaveChanges();

                return(result);
            }
        }
Esempio n. 5
0
        public Card UpdateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                db.Entry(card).State = EntityState.Modified;
                db.SaveChanges();

                return(card);
            }
        }
Esempio n. 6
0
        public Area CreateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                var result = db.Areas.Add(area);
                db.SaveChanges();

                return(result);
            }
        }
Esempio n. 7
0
        public Label CreateLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                label = db.Labels.Add(label);
                db.SaveChanges();

                return label;
            }
        }
Esempio n. 8
0
        public Label DeleteLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                db.Entry(new Label() { ID = label.ID }).State = EntityState.Deleted;
                db.SaveChanges();

                return label;
            }
        }
Esempio n. 9
0
        public Card CreateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                var result = db.Cards.Add(card);
                db.SaveChanges();

                return result;
            }
        }
Esempio n. 10
0
        public Area CreateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                var result = db.Areas.Add(area);
                db.SaveChanges();

                return result;
            }
        }
Esempio n. 11
0
        public Activity CreateActivity(Activity activity)
        {
            using (var db = new CardsDb())
            {
                db.Activities.Add(activity);
                db.SaveChanges();

                return activity;
            }
        }
Esempio n. 12
0
        public Label DeleteLabel(Label label)
        {
            using (var db = new CardsDb())
            {
                db.Entry(new Label()
                {
                    ID = label.ID
                }).State = EntityState.Deleted;
                db.SaveChanges();

                return(label);
            }
        }
Esempio n. 13
0
        public Card UpdateCard(Card card)
        {
            using (var db = new CardsDb())
            {
                db.Entry(card).State = EntityState.Modified;
                db.SaveChanges();

                return card;
            }
        }
Esempio n. 14
0
        public Area UpdateArea(Area area)
        {
            using (var db = new CardsDb())
            {
                db.Entry(area).State = EntityState.Modified;
                db.SaveChanges();

                return area;
            }
        }