コード例 #1
0
        public List <PopulerSearchesViewModel> CategoryJobVacancies()
        {
            DataTable dt = _homeRepositories.CategoryJobVacancies();
            List <PopulerSearchesViewModel> lstCategory = new List <PopulerSearchesViewModel>();

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    PopulerSearchesViewModel category = new PopulerSearchesViewModel
                    {
                        JobIndustryAreaId   = Convert.ToInt32(dt.Rows[i]["JobIndustryAreaId"]),
                        JobIndustryAreaName = Convert.ToString(dt.Rows[i]["JobIndustry"]),
                        TotalCount          = Convert.ToString(dt.Rows[i]["Count"]),
                    };
                    lstCategory.Add(category);
                }
            }
            return(lstCategory);
        }