예제 #1
0
        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());
        }
예제 #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());
        }
예제 #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));
 }
예제 #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));
 }
예제 #6
0
 public ActionResult EditWorkout(WorkoutDescription workouts)
 {
     if (ModelState.IsValid)
     {
         wdb.Entry(workouts).State = EntityState.Modified;
         wdb.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(workouts));
 }
예제 #7
0
 public ActionResult Edit(Appointments appointments)
 {
     if (ModelState.IsValid)
     {
         appDb.Entry(appointments).State = EntityState.Modified;
         appDb.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(appointments));
 }
예제 #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));
 }
예제 #9
0
 public ActionResult DailyEntryEdit(DailyDietEntry dailydietentry)
 {
     if (ModelState.IsValid)
     {
         ddeb.Entry(dailydietentry).State = EntityState.Modified;
         ddeb.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(dailydietentry));
 }
예제 #10
0
 public ActionResult Edit(Doctor doctor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doctor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(doctor));
 }