Ejemplo n.º 1
0
        public IHttpActionResult PostAccount_Holder1(ForgotTranspassword forgotTransPassword)
        {
            decimal?a = db.fetchtotp().FirstOrDefault();

            if (forgotTransPassword.otp == a)
            {
                SendTranspassword(forgotTransPassword.email_id, db.fetchtranspassword(forgotTransPassword.account_no).FirstOrDefault());
                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);
        }