public async Task <IActionResult> PutUsers(int id, Users users)
        {
            if (id != users.Id)
            {
                return(BadRequest());
            }

            users.Password = BC.HashPassword(users.Password);
            _context.Entry(users).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UsersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #2
0
        public async Task <IActionResult> PutNews(int id, News news)
        {
            if (id != news.Id)
            {
                return(BadRequest());
            }

            _context.Entry(news).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NewsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #3
0
 public ActionResult Edit([Bind(Include = "Id,Name,Type,SaleStarts,SaleEnds,Status")] Event @event)
 {
     if (ModelState.IsValid)
     {
         db.Entry(@event).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(@event));
 }
Exemple #4
0
 public ActionResult Edit(Medications medications)
 {
     if (ModelState.IsValid)
     {
         db.Entry(medications).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(medications));
 }
 public ActionResult Edit(WeeklyDietEntry weeklydietentry)
 {
     if (ModelState.IsValid)
     {
         db.Entry(weeklydietentry).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(weeklydietentry));
 }
 public ActionResult EditWorkout(WorkoutDescription workouts)
 {
     if (ModelState.IsValid)
     {
         wdb.Entry(workouts).State = EntityState.Modified;
         wdb.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(workouts));
 }
 public ActionResult Edit(Appointments appointments)
 {
     if (ModelState.IsValid)
     {
         appDb.Entry(appointments).State = EntityState.Modified;
         appDb.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(appointments));
 }
Exemple #8
0
 public ActionResult Edit([Bind(Include = "UserId,EventId")] UserFavorite userFavorite)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userFavorite).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(userFavorite));
 }
 public ActionResult DailyEntryEdit(DailyDietEntry dailydietentry)
 {
     if (ModelState.IsValid)
     {
         ddeb.Entry(dailydietentry).State = EntityState.Modified;
         ddeb.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dailydietentry));
 }
Exemple #10
0
 public ActionResult Edit(Doctor doctor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doctor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(doctor));
 }