public async Task <IHttpActionResult> ResetPasswordAdmin([FromBody] admin form)
        {
            try
            {
                var identity = (ClaimsIdentity)User.Identity;
                var username = identity.Claims.Where(a => a.Type == ClaimTypes.Name).Select(c => c.Value).FirstOrDefault();
                var admin    = (from a in db.admins where a.username == username select a).FirstOrDefault();
                if (admin != null)
                {
                    admin.password = HashPassword.hashPassword(form.password);
                    int val = await db.SaveChangesAsync();

                    if (val > 0)
                    {
                        return(Ok(await FetchDetailsAdmin.GetDetailsAccount(admin.id)));
                    }
                    else
                    {
                        return(BadRequest("Reset password error."));
                    }
                }
                else
                {
                    return(BadRequest("Not found accounts."));
                }
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
 public async Task <IHttpActionResult> GetAdminInfo()
 {
     try
     {
         var identity = (ClaimsIdentity)User.Identity;
         var username = identity.Claims.Where(a => a.Type == ClaimTypes.Name).Select(c => c.Value).FirstOrDefault();
         //find id account vs username
         var find = db.admins.Where(e => e.username == username).Select(e => e).FirstOrDefault();
         if (find != null)
         {
             return(Ok(await FetchDetailsAdmin.GetDetailsAccount(find.id)));
         }
         else
         {
             return(BadRequest("Not found account."));
         }
     }
     catch (Exception e)
     {
         return(BadRequest("Error fetch my profile."));
     }
 }