示例#1
0
 public static bool AddMenu(Dal.Meals_Menu m)
 {
     try
     {
         db.Meals_Menu.Add(m);
         db.SaveChanges();
         return(true);
     }
     catch
     {
         return(false);
     }
 }
        public static DTO.Meals_MenuDTO GetMeals_MenuDTO(Dal.Meals_Menu meals_Menu)
        {
            DTO.Meals_MenuDTO meals_MenuDTO = new Meals_MenuDTO();

            meals_MenuDTO.Status = meals_Menu.Status;

            meals_MenuDTO.Organization_Kod = meals_Menu.Organization_Kod;

            meals_MenuDTO.Meals_Menu_Kod = meals_Menu.Meals_Menu_Kod;
            meals_MenuDTO.Food_Type      = meals_Menu.Food_Type;
            meals_MenuDTO.Amount         = meals_Menu.Amount;

            return(meals_MenuDTO);
        }
        public static Dal.Meals_Menu GetMeals_Menu(DTO.Meals_MenuDTO meals_MenuDTO)
        {
            Dal.Meals_Menu meals_Menu = new Dal.Meals_Menu();
            meals_Menu.Amount         = meals_MenuDTO.Amount;
            meals_Menu.Food_Type      = meals_MenuDTO.Food_Type;
            meals_Menu.Meals_Menu_Kod = meals_MenuDTO.Meals_Menu_Kod;

            meals_Menu.Organization_Kod = meals_Menu.Organization_Kod;

            meals_Menu.Status = meals_MenuDTO.Status;


            return(meals_Menu);
        }