示例#1
0
        public IActionResult PostPizza(Pizza newPizza)
        {
            _context.Pizza.Add(newPizza);
            _context.SaveChanges();

            return(StatusCode(201, newPizza));
        }
示例#2
0
        public IActionResult PostDodatek(Dodatek newDodatek)
        {
            _context.Dodatek.Add(newDodatek);
            _context.SaveChanges();

            return(StatusCode(201, newDodatek));
        }
示例#3
0
        public IActionResult PostPlatnosc(Platnosc newPlatnosc)
        {
            _context.Platnosc.Add(newPlatnosc);
            _context.SaveChanges();

            return(StatusCode(201, newPlatnosc));
        }
        public async Task <IActionResult> ForgottenPassword(OsobaForgottenPassword oFP)
        {
            var Message = "";

            if (ModelState.IsValid)
            {
                using (s16693Context dc = new s16693Context())
                {
                    var v = await dc.Osoba.Where(e => e.AdresEmail == oFP.AdresEmail).FirstOrDefaultAsync();

                    if (v != null)
                    {
                        oFP.Haslo = Hash(oFP.Haslo);
                        v.Haslo   = oFP.Haslo;
                        dc.Update(v);
                        dc.SaveChanges();
                        Message = "Hasło zostało zaktualizowane pomyślnie";
                        return(RedirectToAction("Login", "Home"));
                    }
                }
            }
            else
            {
                Message = "Nieprawidłowe żądanie";
            }
            ViewBag.Message = Message;

            return(View(oFP));
        }