public IHttpActionResult PutUserAccountAndLogin(int id, UserAccountAndLogin userAccountAndLogin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != userAccountAndLogin.AccountID)
            {
                return(BadRequest());
            }

            db.Entry(userAccountAndLogin).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!UserAccountAndLoginExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            UserAccountAndLogin userAccountAndLogin = db.UserAccountAndLogins.Find(id);

            db.UserAccountAndLogins.Remove(userAccountAndLogin);
            db.SaveChanges();
            return(RedirectToAction("UserAccountAndLogin", "Home"));
        }
 public ActionResult Edit([Bind(Include = "AccountID,UserName,Password,EmailAddress,FirstName,LastName,MailingAddress,ContactNumber")] UserAccountAndLogin userAccountAndLogin)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userAccountAndLogin).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("UserAccountAndLogin", "Home"));
     }
     return(View(userAccountAndLogin));
 }
        public IHttpActionResult GetUserAccountAndLogin(int id)
        {
            UserAccountAndLogin userAccountAndLogin = db.UserAccountAndLogins.Find(id);

            if (userAccountAndLogin == null)
            {
                return(NotFound());
            }

            return(Ok(userAccountAndLogin));
        }
        public IHttpActionResult PostUserAccountAndLogin(UserAccountAndLogin userAccountAndLogin)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.UserAccountAndLogins.Add(userAccountAndLogin);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = userAccountAndLogin.AccountID }, userAccountAndLogin));
        }
        public IHttpActionResult DeleteUserAccountAndLogin(int id)
        {
            UserAccountAndLogin userAccountAndLogin = db.UserAccountAndLogins.Find(id);

            if (userAccountAndLogin == null)
            {
                return(NotFound());
            }

            db.UserAccountAndLogins.Remove(userAccountAndLogin);
            db.SaveChanges();

            return(Ok(userAccountAndLogin));
        }
        // GET: UserAccountAndLogins/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UserAccountAndLogin userAccountAndLogin = db.UserAccountAndLogins.Find(id);

            if (userAccountAndLogin == null)
            {
                return(HttpNotFound());
            }
            return(View(userAccountAndLogin));
        }