Beispiel #1
0
        public DataTable CarregaLista(HomeEntity entity)
        {
            try
            {
                CriarConexao();
                Abrir();

                SqlDataAdapter Cmd = new SqlDataAdapter("BuscaListaCurtir", con);
                Cmd.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
                Cmd.SelectCommand.Parameters.Add("@EMAIL", SqlDbType.VarChar).Value = entity.Email;
                DataTable lista = new DataTable();
                Cmd.Fill(lista);

                Fechar();

                return lista;

            }
            catch (Exception e)
            {
            }
            finally
            {
                Fechar();
            }
            return null;
        }
Beispiel #2
0
        public DataTable CarregaPerfil(HomeEntity entity)
        {
            try
            {
                CriarConexao();
                Abrir();

                SqlDataAdapter Cmd = new SqlDataAdapter("CarregaPerfil", con);
                Cmd.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure;
                Cmd.SelectCommand.Parameters.Add("@USUARIO", SqlDbType.VarChar).Value = entity.Email;
                DataTable data = new DataTable();
                Cmd.Fill(data);

                Fechar();

                return data;

            }
            catch (Exception e)
            {
            }
            finally
            {
                Fechar();
            }
            return null;
        }
Beispiel #3
0
        public HomeEntity ModelToEntity(HomeModel model)
        {
            HomeEntity entity = new HomeEntity();

            entity.Nome = model.Nome;
            entity.Email = model.Email;
            entity.Apelido = model.Apelido;
            entity.Url_foto = model.Url_foto;

            return entity;
        }