public ActionResult Dashboard()
        {
            var objEntity = new UserDashboardViewModel();
            var objStudent2Repository = new Student2Repository();

            #region RecentMembersDashboard

            objEntity.Student2RecentMembersList = objStudent2Repository.Select(StudentFlags.SelectAllByRecentMembers.GetHashCode(), new Student2ViewModel()
            {

                CreatedBy = 1 //Admin UserId or login UserId

            });

            #endregion
            #region RecentActiveMembersDashboard

            objEntity.Student2RecentActiveMembersList = objStudent2Repository.Select(StudentFlags.SelectAllByRecentActiveMembers.GetHashCode(), new Student2ViewModel()
            {

                CreatedBy = 1 //Admin UserId or login UserId

            });

            #endregion

            if (objEntity.Student2RecentMembersList.Count == 0)
            {
                // this.Flash("Warning", string.Format(@"Your search returns {0} result(s)", 0));
                //flash message
            }

            return View(objEntity);
        }
        // GET: Student4
        public ActionResult Index()
        {
            var objStudent2Repository = new Student2Repository();
            List<Student2ViewModel> objEntityList = objStudent2Repository.Select(StudentFlags.SelectAll.GetHashCode(), new Student2ViewModel());
            if (objEntityList.Count == 0)
            {
                this.Flash("Error", "No Students");

            }
            return View(objEntityList);
        }
        public ActionResult ListGalleryTop4Random()
        {
            var objStudent2Repository = new Student2Repository();
            List<Student2ViewModel> objEntityList = objStudent2Repository.Select(StudentFlags.SelectTop4ByRandom.GetHashCode(), new Student2ViewModel());
            if (objEntityList.Count == 0)
            {
                this.Flash("Error", "No Students");

            }

            return PartialView("_PartialListGalleryTop4Random", objEntityList);
        }
        public ActionResult Details(int id)
        {
            Student2Repository objStudent2Repository = new Student2Repository();
            Student2ViewModel objEntity = new Student2ViewModel();

            objEntity = objStudent2Repository.Select(StudentFlags.SelectByID.GetHashCode(), new Student2ViewModel()
            {
                StudentId = id
            }).FirstOrDefault();
            if (objEntity == null)
            {

                return RedirectToAction("Index");
            }

            return View(objEntity);
        }
        public ActionResult Edit(int id)
        {
            Student2Repository objStudent2Repository = new Student2Repository();
            Student2ViewModel objEntity = new Student2ViewModel();
            CountryStateRepository objCountryStateRepository = new CountryStateRepository();

            objEntity = objStudent2Repository.Select(StudentFlags.SelectByID.GetHashCode(), new Student2ViewModel()
            {
                StudentId = id

            }).FirstOrDefault();
            if (objEntity == null)
            {

                return RedirectToAction("Index");
            }
            objEntity.CurrentTimeValue = objEntity.CurrentTime.HasValue ? objEntity.CurrentTime.Value.ToString("hh:mm tt") : string.Empty;

            #region DatabaseDropdown
            var objCourseRepository = new CourseRepository();
            var objCourseViewModelEntity = objCourseRepository.Select(CourseFlags.SelectAll.GetHashCode(), new CourseViewModel());
            objEntity.CourseList = new SelectList(objCourseViewModelEntity.Select(model => new { model.CourseId, model.CourseTitle }), "CourseId", "CourseTitle");
            #endregion

            #region DatabaseOptionGroup

            var objCountryStateEntityList = objCountryStateRepository.Select(CountryStateFlags.SelectAllForOptionGroup.GetHashCode(), new CountryStateViewModel());
            objEntity.SelectCountryList = new SelectList(objCountryStateEntityList, "StateId", "StateName", "CountryName", 1);
            #endregion
            return View(objEntity);
        }
        public ActionResult Delete(int id)
        {
            int result = 0;
            Student2Repository objStudent2Repository = new Student2Repository();

            Student2ViewModel objEntity = new Student2ViewModel();
            CountryStateRepository objCountryStateRepository = new CountryStateRepository();

            objEntity = objStudent2Repository.Select(StudentFlags.SelectByID.GetHashCode(), new Student2ViewModel()
            {
                StudentId = id

            }).FirstOrDefault();
            if (objEntity == null)
            {
                //delete old file

                ApplicationHelpers.DeleteFile(Path.Combine(Server.MapPath(ApplicationConstant.UPLOADED_STUDENT_IMAGE_PATH), objEntity.FileName));
            }

            result = objStudent2Repository.Delete(StudentFlags.DeleteByID.GetHashCode(), new Student2ViewModel()
            {
                StudentId = id,

            });
            if (result == ResultFlags.Success.GetHashCode())
            {
                this.Flash("success", "Student Delete successfully");
                return RedirectToAction("Index");
            }
            else if (result == ResultFlags.Failure.GetHashCode())
            {
                this.Flash("error", "Faild to Delete Student");
                return RedirectToAction("Index");
            }
            return RedirectToAction("Index");
        }