Beispiel #1
0
 public void addFoodItem(FoodItem fi)
 {
     using (var _dcm = new DatabaseConnectionManager())
     {
         _dcm.Add(fi);
         _dcm.SaveChanges();
     }
 }
Beispiel #2
0
 public void removeFoodItem(long id)
 {
     using (var _dcm = new DatabaseConnectionManager())
     {
         var foodItem = _dcm.FoodItems.Find(id);
         _dcm.FoodItems.Remove(foodItem);
         _dcm.SaveChanges();
     }
 }
Beispiel #3
0
 public void editConsDate(long id, DateTime?consDate)
 {
     using (var _dcm = new DatabaseConnectionManager())
     {
         var foodItem = _dcm.FoodItems.Find(id);
         foodItem.ConsDate = consDate;
         _dcm.FoodItems.Update(foodItem);
         _dcm.SaveChanges();
     }
 }
Beispiel #4
0
        public bool command()
        {
            bool res = false;

            using (var _dcm = new DatabaseConnectionManager())
            {
                _dcm.Add(fi);
                _dcm.SaveChanges();
                res = true;
            }
            return(res);
        }
Beispiel #5
0
 public void UpdateMarked(List <FoodItem> foodItems)
 {
     using (var _dcm = new DatabaseConnectionManager())
     {
         foreach (FoodItem fi in foodItems)
         {
             FoodItem nfi = _dcm.FoodItems.Where(x => x.Id == fi.Id).FirstOrDefault();
             nfi.Marked = true;
             _dcm.FoodItems.Update(nfi);
             _dcm.SaveChanges();
         }
     }
 }
        public bool command()
        {
            bool res = false;

            using (var _dcm = new DatabaseConnectionManager())
            {
                var foodItem = _dcm.FoodItems.Find(id);
                _dcm.FoodItems.Remove(foodItem);
                _dcm.SaveChanges();
                res = true;
            }
            return(res);
        }
        public bool command()
        {
            bool res = false;

            using (var _dcm = new DatabaseConnectionManager())
            {
                var user = _dcm.Users.Find(uid);
                user.LastSent = date;
                _dcm.Users.Update(user);
                _dcm.SaveChanges();
                res = true;
            }
            return(res);
        }
        public bool command()
        {
            bool res = false;

            using (var _dcm = new DatabaseConnectionManager())
            {
                foreach (FoodItem fi in foodItems)
                {
                    FoodItem nfi = _dcm.FoodItems.Where(x => x.Id == fi.Id).FirstOrDefault();
                    nfi.Marked = true;
                    _dcm.FoodItems.Update(nfi);
                    _dcm.SaveChanges();
                }
                res = true;
            }
            return(res);
        }