Exemplo n.º 1
0
        //**********************************************************************************
        //**********************************************************************************
        //**********************************************************************************

        //EJEMPLOS


        public User Login()
        {
            DataTable dt   = WikiDBAdapter.GetDataTable("GetNewsConfiguration");
            User      user = new User();

            if (dt != null && dt.Rows.Count > 0)
            {
                var dsm = new DataSetMapper <User>();
                user = dsm.ConvertSingleFromBackend(dt.Rows[0]);
            }
            return(user);
        }
Exemplo n.º 2
0
        public User GetUserByUserName(string userName)
        {
            DataAccessParameter[] parameters = new DataAccessParameter[1];
            parameters[0] = new DataAccessParameter("@UserName", userName, typeof(string), null, ParameterDirection.Input);

            DataTable dt   = WikiDBAdapter.GetDataTable("GetUserByUserName", parameters);
            User      user = new User();

            if (dt != null && dt.Rows.Count > 0)
            {
                var dsm = new DataSetMapper <User>();
                user = dsm.ConvertSingleFromBackend(dt.Rows[0]);
            }
            return(user);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Obtiene la información de un post por id
        /// </summary>
        /// <param name="post">Post con el id</param>
        /// <returns></returns>
        public Post GetPostById(Post post)
        {
            DataAccessParameter[] parameters = new DataAccessParameter[1];
            parameters[0] = new DataAccessParameter("@PostId", post.PostId, typeof(int), null, ParameterDirection.Input);

            DataTable dt     = WikiDBAdapter.GetDataTable("GetPostById", parameters);
            Post      result = new Post();

            if (dt != null && dt.Rows.Count > 0)
            {
                var dsm = new DataSetMapper <Post>();
                result = dsm.ConvertSingleFromBackend(dt.Rows[0]);
            }
            return(result);
        }