public JsonResult SearchInstitutes(InstituteSearchPara _obj)
        {
            string localIP = "?";

            localIP               = Request.ServerVariables["REMOTE_ADDR"].ToString();
            _obj.Created_Ip       = localIP;
            _obj.ParticipatedYear = ConfigurationManager.AppSettings["ParticipatedYear"].ToString();
            InstituteSearchRepository _objRepository = new InstituteSearchRepository();
            DataSet _ds = _objRepository.InstituteSearchForWebsite(_obj);
            List <InstituteSearchVM> _list = new List <InstituteSearchVM>();

            if (_ds != null)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow _dr in _ds.Tables[0].Rows)
                    {
                        InstituteSearchVM _objResult = new InstituteSearchVM();
                        _objResult.InstituteID   = _dr["InstituteID"].ToString();
                        _objResult.InstituteName = _dr["InstituteName"].ToString();
                        _objResult.Website       = _dr["Website"].ToString();
                        _objResult.StateName     = _dr["StateName"].ToString();
                        _objResult.City          = _dr["City"].ToString();
                        _objResult.TotalCourse   = _dr["TotalCourse"].ToString();
                        _objResult.TotalSeats    = _dr["TotalSeats"].ToString();
                        _objResult.Photo         = _dr["Photo"].ToString();
                        _objResult.Discipline    = _dr["Discipline"].ToString();
                        _objResult.ProgramLevel  = _dr["ProgramLevel"].ToString();
                        _objResult.Qualification = _dr["Qualification"].ToString();
                        _objResult.CourseOfStudy = _dr["CourseOfStudy"].ToString();
                        _list.Add(_objResult);
                    }
                }
            }
            return(Json(new
            {
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Exemplo n.º 2
0
        public JsonResult SearchCourseList(InstituteSearchPara _obj)
        {
            string localIP = "?";

            localIP               = Request.ServerVariables["REMOTE_ADDR"].ToString();
            _obj.Created_Ip       = localIP;
            _obj.ParticipatedYear = ConfigurationManager.AppSettings["ParticipatedYear"].ToString();
            InstituteSearchRepository _objRepository = new InstituteSearchRepository();
            DataSet _ds = _objRepository.InstituteSearchForWebsite_New(_obj);
            List <InstituteSearchVM>        _list              = new List <InstituteSearchVM>();
            List <InstituteSearchDropdowns> _listCity          = new List <InstituteSearchDropdowns>();
            List <InstituteSearchDropdowns> _listDiscipline    = new List <InstituteSearchDropdowns>();
            List <InstituteSearchDropdowns> _listCourseOfStudy = new List <InstituteSearchDropdowns>();

            if (_ds != null)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow _dr in _ds.Tables[0].Rows)
                    {
                        InstituteSearchVM _objResult = new InstituteSearchVM();
                        _objResult.ID                = _dr["ID"].ToString();
                        _objResult.InstituteID       = _dr["InstituteID"].ToString();
                        _objResult.InstituteName     = _dr["InstituteName"].ToString();
                        _objResult.Website           = _dr["Website"].ToString();
                        _objResult.StateName         = _dr["StateName"].ToString();
                        _objResult.City              = _dr["City"].ToString();
                        _objResult.TotalCourse       = _dr["TotalCourse"].ToString();
                        _objResult.TotalSeats        = _dr["TotalSeats"].ToString();
                        _objResult.Photo             = _dr["Photo"].ToString();
                        _objResult.Discipline        = _dr["Discipline"].ToString();
                        _objResult.ProgramLevel      = _dr["ProgramLevel"].ToString();
                        _objResult.Qualification     = _dr["Qualification"].ToString();
                        _objResult.CourseOfStudy     = _dr["CourseOfStudy"].ToString();
                        _objResult.StartDate         = Convert.ToDateTime(_dr["StartDate"].ToString()).ToString("dd-MM-yyyy");
                        _objResult.EndDate           = Convert.ToDateTime(_dr["EndDate"].ToString()).ToString("dd-MM-yyyy");
                        _objResult.TotalFees         = _dr["TotalFees"].ToString();
                        _objResult.TotalFeesCurrency = _dr["TotalFeesCurrency"].ToString();
                        _objResult.Photo             = _dr["Photo"].ToString();

                        _list.Add(_objResult);
                    }
                }
                if (_ds.Tables[1].Rows.Count > 0)
                {
                    foreach (DataRow _dr in _ds.Tables[1].Rows)
                    {
                        _listCity.Add(new InstituteSearchDropdowns
                        {
                            Id    = _dr["City"].ToString(),
                            Value = _dr["City"].ToString()
                        });
                    }
                }

                if (_ds.Tables[2].Rows.Count > 0)
                {
                    foreach (DataRow _dr in _ds.Tables[2].Rows)
                    {
                        _listDiscipline.Add(new InstituteSearchDropdowns
                        {
                            Id    = _dr["Discipline_ID"].ToString(),
                            Value = _dr["Discipline"].ToString()
                        });
                    }
                }

                if (_ds.Tables[3].Rows.Count > 0)
                {
                    foreach (DataRow _dr in _ds.Tables[3].Rows)
                    {
                        _listCourseOfStudy.Add(new InstituteSearchDropdowns
                        {
                            Id    = _dr["CourseOfStudy_ID"].ToString(),
                            Value = _dr["CourseOfStudy"].ToString()
                        });
                    }
                }
            }
            return(Json(new
            {
                List = _list,
                ListCity = _listCity,
                ListDiscipline = _listDiscipline,
                ListCourseOfStudy = _listCourseOfStudy
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
Exemplo n.º 3
0
        public JsonResult SelectNicheCourse(string ID = "", string Discipline_ID = "", string ProgramLevel_Id = "", string Qualification_ID = "", string Type = "", string CourseOfStudy_ID = "", string InstituteType = "", string InstituteID = "", string Month_id = "", string Year_id = "", string GenderRestrictions = "")
        {
            NICHE objRep = new NICHE();

            DataSet ds = objRep.sp_Select_tbl_InstituteCourse_Niche_Search(ID, Discipline_ID, ProgramLevel_Id, Qualification_ID, "AllNicheCourse", CourseOfStudy_ID, InstituteType, InstituteID, GenderRestrictions, Month_id, Year_id);
            //List<NicheCourse> _list = new List<NicheCourse>();
            List <InstituteSearchVM> _list = new List <InstituteSearchVM>();
            List <Date> _listDT            = new List <Date>();
            List <Date> _listYr            = new List <Date>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow _dr in ds.Tables[0].Rows)
                    {
                        NicheCourse objNicheCourse = new NicheCourse();

                        InstituteSearchVM _objResult = new InstituteSearchVM();
                        _objResult.InstituteID   = _dr["InstituteID"].ToString();
                        _objResult.InstituteName = _dr["InstituteName"].ToString();
                        _objResult.Website       = _dr["Website"].ToString();
                        _objResult.StateName     = _dr["StateName"].ToString();
                        _objResult.City          = _dr["City"].ToString();
                        _objResult.TotalCourse   = _dr["TotalCourse"].ToString();
                        _objResult.TotalSeats    = _dr["TotalSeats"].ToString();
                        _objResult.Photo         = _dr["Photo"].ToString();
                        _objResult.Discipline    = _dr["Discipline"].ToString();
                        _objResult.ProgramLevel  = _dr["ProgramLevel"].ToString();
                        _objResult.Qualification = _dr["Qualification"].ToString();
                        _objResult.CourseOfStudy = _dr["CourseOfStudy"].ToString();
                        _objResult.ID            = _dr["ID"].ToString();
                        _objResult.StartDate     = _dr["StartDate"].ToString();
                        _objResult.EndDate       = _dr["EndDate"].ToString();
                        _list.Add(_objResult);
                    }
                }
                if (ds.Tables[1].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[1].Rows)
                    {
                        Date _obj = new Date();
                        _obj.Month_id = (row["Month_id"].ToString());
                        _obj.Month    = row["Month"].ToString();
                        _listDT.Add(_obj);
                    }
                }
                if (ds.Tables[2].Rows.Count > 0)
                {
                    foreach (DataRow row in ds.Tables[2].Rows)
                    {
                        Date _obj = new Date();
                        _obj.Year_id = (row["Year_id"].ToString());
                        _obj.Year    = row["year"].ToString();
                        _listYr.Add(_obj);
                    }
                }
            }
            return(Json(new
            {
                List = _list,
                ListMonth = _listDT,
                ListYear = _listYr,
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }