예제 #1
0
        public bool POST([FromBody] User user)
        {
            try
            {
                bool respuesta = false;
                using (DrogadiccionEntities context = new DrogadiccionEntities())
                {
                    //context.Configuration.ProxyCreationEnabled = false;
                    var data = context.Usuarios.Where(x => x.Usuario == user.Name).Select(s => new { s.Contrseña, s.Usuario }).ToList();

                    if (data.Count > 0)
                    {
                        foreach (var item in data)
                        {
                            if (user.password == item.Contrseña)
                            {
                                respuesta = true;
                            }
                        }
                    }
                    return(respuesta);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
예제 #2
0
        public ActionResult Sigin(Usuario User)
        {
            try
            {
                using (DrogadiccionEntities context = new DrogadiccionEntities())
                {
                    var user = context.Usuario.Where(x => x.email == User.email);

                    return(Redirect("Home/Index"));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }