예제 #1
0
        public ActionResult Index(string u = "")
        {
            ViewBag.InstituteAvailable = "No";
            try
            {
                string InstituteID = StringCipher.Decrypt(u);
                InstituteRepository _objRepository = new InstituteRepository();
                DataSet             _dsInstituteListForGeneration = _objRepository.Select_Institute_By_InstituteID(InstituteID);
                if (_dsInstituteListForGeneration != null)
                {
                    if (_dsInstituteListForGeneration.Tables[0].Rows.Count > 0)
                    {
                        foreach (DataRow _dr in _dsInstituteListForGeneration.Tables[0].Rows)
                        {
                            ViewBag.ID            = _dr["ID"].ToString();
                            ViewBag.InstituteID   = _dr["InstituteID"].ToString();
                            ViewBag.InstituteName = _dr["InstituteName"].ToString();

                            ViewBag.InstituteAvailable = "Yes";
                        }
                    }
                }
            }
            catch (Exception)
            {
                ViewBag.InstituteAvailable = "No";
            }
            return(View());
        }
예제 #2
0
        public ActionResult ViewNicheDetails(string instituteid = "", string For = "", string Category = null, string NicheCourseId = null)
        {
            if (instituteid == "")
            {
                TempData["instituteid"] = "";
            }
            else
            {
                TempData["instituteid"] = instituteid;
            }
            if (NicheCourseId == "")
            {
                TempData["NicheCourseId"] = "";
            }
            else
            {
                TempData["NicheCourseId"] = NicheCourseId;
            }
            TempData.Keep("NicheCourseId");
            InstituteRepository _objRepository = new InstituteRepository();
            DataSet             _ds            = _objRepository.Select_Institute_By_InstituteID(instituteid);
            string InstituteName = "[Institute Name]";
            string TotalCourses  = "0";
            string TotalSeats    = "0";
            string IsNICHECourse = "0";

            if (_ds != null)
            {
                if (_ds.Tables[0].Rows.Count > 0)
                {
                    DataRow _dr = _ds.Tables[0].Rows[0];
                    InstituteName = _dr["InstituteName"].ToString() + ", " + _dr["City"].ToString().Trim();
                    IsNICHECourse = _dr["IsNicheAllowed"].ToString().Trim();
                }
                if (_ds.Tables[1].Rows.Count > 0)
                {
                    DataRow _dr = _ds.Tables[1].Rows[0];
                    TotalCourses = _dr["TotalCourses"].ToString();
                    TotalSeats   = _dr["TotalSeats"].ToString();
                }
            }
            ViewBag.InstituteName     = InstituteName;
            TempData["TotalCourses"]  = TotalCourses;
            TempData["TotalSeats"]    = TotalSeats;
            TempData["IsNICHECourse"] = IsNICHECourse;
            TempData.Keep("instituteid");
            ViewBag.DetailsFor = For;
            if (Category == "")
            {
                TempData["Category"] = "";
            }
            else
            {
                TempData["Category"] = Category;
            }
            return(View());
        }