예제 #1
0
 public string AddRecipeShawarma([Bind(Include = "ShawarmaName,CookingTime")] Shawarma shawarma)
 {
     return(DatabaseQueries.AddRecipe(shawarma.ShawarmaName,
                                      (Session["ShawarmaRecipes"] as IEnumerable <IngradientWeight>)?.ToArray(), shawarma.CookingTime)
         ? "Success"
         : "Error");
 }
        public void Create(DalShawarma e)
        {
            var Shawarma = new Shawarma()
            {
                ShawarmaID   = e.Id,
                ShawarmaName = e.ShawarmaName,
                CookingTime  = e.CookingTime
            };

            Context.Set <Shawarma>().Add(Shawarma);
        }
        public void Update(DalShawarma e)
        {
            var Shawarma = new Shawarma()
            {
                ShawarmaID   = e.Id,
                ShawarmaName = e.ShawarmaName,
                CookingTime  = e.CookingTime
            };

            Shawarma = Context.Set <Shawarma>().Single(i => i.ShawarmaID == e.Id);

            Shawarma.ShawarmaName = e.ShawarmaName;
            Shawarma.CookingTime  = e.CookingTime;
        }
        // GET: Shawarmas/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Shawarma shawarma = await db.Shawarmas.FindAsync(id);

            if (shawarma == null)
            {
                return(HttpNotFound());
            }
            return(View(shawarma));
        }
예제 #5
0
 public string ShawarmaSelling([Bind(Include = "ShawarmaName")] Shawarma shawarma)
 {
     return(DatabaseQueries.ShawarmaSelling(shawarma.ShawarmaName) ? "Success" : "Error");
 }