Ejemplo n.º 1
0
        public IHttpActionResult PostAccount_Holder(ChangeTransPassword changeTransPassword)
        {
            var result = db.Account_Holder.Where(a => a.account_no == changeTransPassword.account_no && a.trans_pass == changeTransPassword.trans_pass).FirstOrDefault();

            if (result != null)
            {
                db.change_trans_password(changeTransPassword.account_no, changeTransPassword.new_trans_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);
        }