Exemple #1
0
        public static List <FoodNavigateTableModel> GetLastOrderFoods(int siparisID)
        {
            List <FoodNavigateTableModel> fntl = new List <FoodNavigateTableModel>();

            var f = FoodNavigateDAL.GetLastOrderFoods(siparisID);

            foreach (var item in f)
            {
                fntl.Add(item);
            }
            return(fntl);
        }
Exemple #2
0
        public static Tuple <bool, string> AddFoodNavigateTable(int siparisID, int yemekID, string adet)
        {
            string mesaj = "";
            bool   sonuc = true;
            var    y     = FoodBLL.GetFoodByID(yemekID);

            if (y.YemekMevcutAdet > 0)
            {
                var donen = GetFoodNavigateTableToAdd(siparisID, yemekID, adet);
                if (donen.Item2)
                {
                    for (int i = 0; i < int.Parse(adet); i++)
                    {
                        sonuc = FoodNavigateDAL.CRUD(donen.Item1.ConvertToYemekAraTablo(), System.Data.Entity.EntityState.Added);

                        if (sonuc)
                        {
                            mesaj = "Yemek eklendi.";
                        }
                        else
                        {
                            mesaj = "Yemek eklenirken hata oluştu.";
                        }
                    }
                    //Yemek stoğunu güncelle.
                    FoodBLL.UpdateFood(yemekID, y.YemekAdi, y.YemekMaliyeti.ToString(), y.YemekFiyati.ToString(), y.YemekKategorisi, (y.YemekMevcutAdet - int.Parse(adet)).ToString(), y.YemekResmi);
                }
                else
                {
                    sonuc = false;
                    mesaj = "Lütfen adet değerine sayı girin.";
                }
            }
            else
            {
                sonuc = false;
                mesaj = "Bu yemekten kalmamıştır.";
            }



            return(new Tuple <bool, string>(sonuc, mesaj));
        }
Exemple #3
0
 public static List <FoodNavigateTableModel> GetFoodNavigates(int siparisID)
 {
     return(FoodNavigateDAL.GetFoodNavigates(siparisID));
 }
Exemple #4
0
 public static List <FoodNavigateTableModel> GetAllFoodNavigates()
 {
     return(FoodNavigateDAL.GetAllFoodNavigates());
 }
Exemple #5
0
 public static FoodNavigateTableModel GetFoodNavigateByID(int kayitID)
 {
     return(FoodNavigateDAL.GetFoodNavigateByID(kayitID));
 }
Exemple #6
0
        public static bool DeleteFromFoodNavigate(int kayitID)
        {
            var silinecek = FoodNavigateDAL.GetFoodNavigateByID(kayitID);

            return(FoodNavigateDAL.CRUD(silinecek.ConvertToYemekAraTablo(), System.Data.Entity.EntityState.Deleted));
        }