Ejemplo n.º 1
0
 public static bool RemoveItem(Meals_Menu meals_Menu)
 {
     try
     {
         db.Meals_Menu.Remove(meals_Menu);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
        public static bool UpdateMenu(Meals_Menu meals_Menu)
        {
            var me = db.Meals_Menu.FirstOrDefault(c => c.Meals_Menu_Kod == meals_Menu.Meals_Menu_Kod);

            if (me != null)
            {
                me.Amount         = meals_Menu.Amount;
                me.Food_Type      = meals_Menu.Food_Type;
                me.Meals_Menu_Kod = meals_Menu.Meals_Menu_Kod;

                me.Organization_Kod = meals_Menu.Organization_Kod;

                me.Status      = meals_Menu.Status;
                me.Status_Food = meals_Menu.Status_Food;
                db.SaveChanges();
                return(true);
            }

            else
            {
                return(false);
            }
        }