Ejemplo n.º 1
0
        public IHttpActionResult PuttblAYDSUserInformation(int id, tblAYDSUserInformation tblAYDSUserInformation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetUserProfile(int id)
        {
            tblAYDSUserInformation tblAYDSUserInformation = dal.GetUserProfile(id);

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

            return(Ok(tblAYDSUserInformation));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// GET: api/User/rahul,abcd
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        public IHttpActionResult GetUserInformation(string userName, string password)
        {
            tblAYDSUserInformation tblAYDSUserInformation = dal.ValidateUser(userName, password);

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

            return(Ok(tblAYDSUserInformation));
        }
Ejemplo n.º 4
0
        public IHttpActionResult PosttblAYDSUserInformation(tblAYDSUserInformation tblAYDSUserInformation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.tblAYDSUserInformations.Add(tblAYDSUserInformation);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = tblAYDSUserInformation.Id }, tblAYDSUserInformation));
        }
Ejemplo n.º 5
0
        public IHttpActionResult PostUpdateUserDetails(tblAYDSUserInformation tblAYDSUserInformation)
        {
            tblAYDSUserInformation userDetails = new tblAYDSUserInformation();

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            userDetails = dal.UpdateUserDetails(tblAYDSUserInformation);

            return(CreatedAtRoute("DefaultApi", new { id = userDetails.Id }, userDetails));
        }
Ejemplo n.º 6
0
        public IHttpActionResult DeletetblAYDSUserInformation(int id)
        {
            tblAYDSUserInformation tblAYDSUserInformation = db.tblAYDSUserInformations.Find(id);

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

            db.tblAYDSUserInformations.Remove(tblAYDSUserInformation);
            db.SaveChanges();

            return(Ok(tblAYDSUserInformation));
        }