public IHttpActionResult PuttblvelogUser(int id, tblvelogUser tblvelogUser)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != tblvelogUser.Id)
            {
                return(BadRequest());
            }

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            tblvelogUser tblvelogUser = db.tblvelogUsers.Find(id);

            db.tblvelogUsers.Remove(tblvelogUser);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,Username,Password,Role")] tblvelogUser tblvelogUser)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tblvelogUser).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tblvelogUser));
 }
        public ActionResult Create([Bind(Include = "Id,Username,Password,Role")] tblvelogUser tblvelogUser)
        {
            if (ModelState.IsValid)
            {
                db.tblvelogUsers.Add(tblvelogUser);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tblvelogUser));
        }
        public IHttpActionResult GettblvelogUser(int id)
        {
            tblvelogUser tblvelogUser = db.tblvelogUsers.Find(id);

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

            return(Ok(tblvelogUser));
        }
        public IHttpActionResult PosttblvelogUser(tblvelogUser tblvelogUser)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tblvelogUsers.Add(tblvelogUser);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tblvelogUser.Id }, tblvelogUser));
        }
        // GET: Users/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tblvelogUser tblvelogUser = db.tblvelogUsers.Find(id);

            if (tblvelogUser == null)
            {
                return(HttpNotFound());
            }
            return(View(tblvelogUser));
        }
        public IHttpActionResult DeletetblvelogUser(int id)
        {
            tblvelogUser tblvelogUser = db.tblvelogUsers.Find(id);

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

            db.tblvelogUsers.Remove(tblvelogUser);
            db.SaveChanges();

            return(Ok(tblvelogUser));
        }