Ejemplo n.º 1
0
        public dynamic Post([FromBody] Adms value)
        {
            var login = _context.Adms.FirstOrDefault(x => x.Nome == value.Nome && x.SenhaOld == value.SenhaOld);

            if (login == null)
            {
                return("Wrong Login!");
            }
            else
            {
                return(true);
            }
        }
Ejemplo n.º 2
0
        public dynamic Put(int id, [FromBody] Adms value)
        {
            Adms alterar = _context.Adms.Find(id);


            var verifyAccount = _context.Adms.FirstOrDefault(x => x.Nome == value.Nome && x.SenhaOld == value.SenhaOld);

            if (verifyAccount != null)
            {
                alterar.SenhaOld = value.SenhaNew;
                _context.SaveChanges();
                return("Salvo");
            }
            return("senhas incorretas!");
        }