public ActionResult AjaxGetProfileById(int Id)
        {
            UserProfileModel       objProfile    = UserProfileMap.Map(_repoUserProfile.GetSingle(x => x.Id == Id));
            List <DisciplineModel> lstDiscipline = new List <DisciplineModel>();

            lstDiscipline = DisciplineMap.Map(_repoDiscipline.GetList(x => x.CategoryId == objProfile.CategoryId).ToList());
            List <ProvinceModel> lstProvince = new List <ProvinceModel>();

            lstProvince = ProvinceMap.Map(_repoProvince.GetList(x => x.Country == objProfile.CountryName).ToList());
            return(Json(new { status = "success", profile = objProfile, lstDiscipline = lstDiscipline.ToArray(), lstProvince = lstProvince.ToArray() }));
        }
        public ActionResult AjaxGetDisciplines(int id)
        {
            DisciplineModel[] arrDisciplines = DisciplineMap.Map(_repDiscipline.GetList(x => x.CategoryId == id && x.LanguageId == CurrentLanguage.Id).ToList()).ToArray();

            if (arrDisciplines != null)
            {
                return(Json(new { status = "success", disciplineList = arrDisciplines }));
            }
            else
            {
                return(Json(new { status = "error" }));
            }
        }
        private void PopulateViewBags()
        {
            //Countries and Provinces
            List <CountryModel> lstCountries = new List <CountryModel>();

            lstCountries.Add(new CountryModel
            {
                Id   = 1111,
                Name = "Country"
            }
                             );


            lstCountries.AddRange(CountryMap.Map(_repoCountry.GetList().ToList()));

            ViewBag.Countries = new SelectList(lstCountries, "Name", "Name");

            List <ProvinceModel> lstProvinces = new List <ProvinceModel>();

            lstProvinces.Add(new ProvinceModel
            {
                Id   = 0,
                Name = "State"
            });

            ViewBag.Provinces = new SelectList(lstProvinces, "Id", "Name");

            List <YearModel> lstYears = new List <YearModel>();


            List <DisciplineModel> lstDisciplines = new List <DisciplineModel>();

            lstDisciplines.Add(new DisciplineModel
            {
                Id             = 1111,
                DisciplineName = "Discipline",
                LanguageId     = CurrentLanguage.Id
            });

            lstDisciplines.AddRange(DisciplineMap.Map(_repoDiscipline.GetList(x => x.LanguageId == CurrentLanguage.Id).ToList()));

            ViewBag.Disciplines = new SelectList(lstDisciplines, "Id", "DisciplineName");

            List <SortByModel> lstSort = new List <SortByModel>();

            lstSort.Add(new SortByModel
            {
                Id      = 0,
                OrderBy = "Sort By"
            }

                        );

            lstSort.Add(new SortByModel
            {
                Id      = 1,
                OrderBy = "Ascending"
            });

            lstSort.Add(new SortByModel
            {
                Id      = 2,
                OrderBy = "Descending"
            });

            ViewBag.SortBy = new SelectList(lstSort, "Id", "OrderBy");
        }