Exemplo n.º 1
0
        public IHttpActionResult PostAccount_Holder(ChangePassword changePassword)
        {
            var result = db.Account_Holder.Where(a => a.account_no == changePassword.account_no && a.login_pass == changePassword.login_pass).FirstOrDefault();

            if (result != null)
            {
                db.change_password(changePassword.account_no, changePassword.new_pass);
                return(Ok("success"));
            }
            else
            {
                return(Ok("fail"));
            }
            //if (!ModelState.IsValid)
            //{
            //    return BadRequest(ModelState);
            //}

            //db.Account_Holder.Add(account_Holder);

            //try
            //{
            //    db.SaveChanges();
            //}
            //catch (DbUpdateException)
            //{
            //    if (Account_HolderExists(account_Holder.account_no))
            //    {
            //        return Conflict();
            //    }
            //    else
            //    {
            //        throw;
            //    }
            //}

            //return CreatedAtRoute("DefaultApi", new { id = account_Holder.account_no }, account_Holder);
        }