//********************************************************************************** //********************************************************************************** //********************************************************************************** //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); }
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); }
/// <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); }
public List <User> GetNewsItems() { DataSet ds = WikiDBAdapter.GetDataSet("GetNewsItems"); List <User> newsItems = new List <User>(); if (ds != null && ds.Tables.Count > 0) { DataTable myTable = ds.Tables[0]; if (myTable != null && myTable.Rows.Count > 0) { var dsm = new DataSetMapper <User>(); newsItems = dsm.ConvertFromBackend <List <User> >(myTable); } } return(newsItems); }
public List <DifficultyLevel> GetDifficultyLevel() { DataSet ds = WikiDBAdapter.GetDataSet("GetDifficultyLevel"); List <DifficultyLevel> difficultyLevels = new List <DifficultyLevel>(); if (ds != null && ds.Tables.Count > 0) { DataTable myTable = ds.Tables[0]; if (myTable != null && myTable.Rows.Count > 0) { var dsm = new DataSetMapper <DifficultyLevel>(); difficultyLevels = dsm.ConvertFromBackend <List <DifficultyLevel> >(myTable); } } return(difficultyLevels); }
public List <Topic> GetTopics() { DataSet ds = WikiDBAdapter.GetDataSet("GetTopics"); List <Topic> topics = new List <Topic>(); if (ds != null && ds.Tables.Count > 0) { DataTable myTable = ds.Tables[0]; if (myTable != null && myTable.Rows.Count > 0) { var dsm = new DataSetMapper <Topic>(); topics = dsm.ConvertFromBackend <List <Topic> >(myTable); } } return(topics); }
/// <summary> /// Retornna todos los post relacionados a un subtopic /// </summary> /// <param name="subTopic">Sub topic del cual se quieren obtener los post</param> /// <returns></returns> public List <Post> GetPostBySubTopicId(SubTopic subTopic) { DataSet ds = WikiDBAdapter.GetDataSet("GetPostBySubTopicId", new DataAccessParameter("@SubTopicId", subTopic.SubTopicId, typeof(int), null, ParameterDirection.Input)); List <Post> postResult = new List <Post>(); if (ds != null && ds.Tables.Count > 0) { DataTable myTable = ds.Tables[0]; if (myTable != null && myTable.Rows.Count > 0) { var dsm = new DataSetMapper <Post>(); postResult = dsm.ConvertFromBackend <List <Post> >(myTable); } } return(postResult); }
public List <SubTopic> GetSubTopicsByTopicId(Topic topic) { DataSet ds = WikiDBAdapter.GetDataSet("GetSubTopicsByTopicId", new DataAccessParameter("@TopicId", topic.TopicId, typeof(int), null, ParameterDirection.Input)); List <SubTopic> subTopics = new List <SubTopic>(); if (ds != null && ds.Tables.Count > 0) { DataTable myTable = ds.Tables[0]; if (myTable != null && myTable.Rows.Count > 0) { var dsm = new DataSetMapper <SubTopic>(); subTopics = dsm.ConvertFromBackend <List <SubTopic> >(myTable); } } return(subTopics); }
internal BaseTreeIterator(DataSetMapper mapper) { this.mapper = mapper; }
internal BaseTreeIterator( DataSetMapper mapper ) { this.mapper = mapper; }
public void Setup() { dataSetMapper = new DataSetMapper(new PropertyMapper()); }