Exemplo n.º 1
0
 //Lưu thực đơn khách hàng
 public bool InsertMenu(Book_Food bf)
 {
     try
     {
         db.Book_Food.Add(bf);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 //Lưu thông tin khách hàng đặt bàn
 public bool Insert(OrderTable or)
 {
     try
     {
         db.OrderTable.Add(or);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemplo n.º 3
0
        public bool AddFood(Food entity)
        {
            try
            {
                var fod = new Food();
                fod.Name        = entity.Name;
                fod.Image       = entity.Image;
                fod.Ingredient  = entity.Ingredient;
                fod.CreatedDate = DateTime.Now;
                fod.MetaTitle   = Str_Metatitle(entity.Name);
                fod.Description = entity.Description;
                fod.Price       = entity.Price;
                fod.Status      = true;

                db.Food.Add(fod);
                db.SaveChanges();
                return(true);
            }catch (Exception e)
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public bool addSlide(Banner entity)
        {
            try
            {
                var banner = new Banner();
                banner.Name        = entity.Name;
                banner.MetaTitle   = Str_Metatitle(entity.Name);
                banner.Ingredient  = entity.Ingredient;
                banner.Image       = entity.Image;
                banner.CreatedDate = DateTime.Now;
                banner.Description = entity.Description;
                banner.Price       = entity.Price;
                banner.Status      = true;

                db.Banner.Add(banner);
                db.SaveChanges();
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }