public JsonResult SaveProfile(ProfileManagement _obj)
        {
            string counts = "";

            try
            {
                if (ModelState.IsValid)
                {
                    SIIRepository.Adminservice.DashboardRepository objRepository = new SIIRepository.Adminservice.DashboardRepository();
                    _obj.IP        = Request.ServerVariables["REMOTE_ADDR"].ToString();
                    _obj.updatedBy = Session["User_Name"].ToString();
                    DataSet _ds = objRepository.INSERT_STUDENT_DATA_FOREDIT(_obj);
                    if (_ds != null)
                    {
                        if (_ds.Tables[0].Rows.Count > 0)
                        {
                            counts = (_ds.Tables[0].Rows[0]["counts"].ToString());
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }

            return(Json(new
            {
                count = counts
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
        public JsonResult SELECT_EDITPROFILE()
        {
            SIIRepository.Adminservice.DashboardRepository _objRepository = new SIIRepository.Adminservice.DashboardRepository();
            string IP = "?";

            IP = Request.ServerVariables["REMOTE_ADDR"].ToString();
            DataSet ds = _objRepository.SELECT_STUDENT_DATA_FOREDIT(TempData.Peek("StudentID").ToString());
            List <ProfileManagement> _list = new List <ProfileManagement>();

            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow _dr in ds.Tables[0].Rows)
                    {
                        ProfileManagement _obj = new ProfileManagement();
                        _obj.FirstName   = _dr["FirstName"].ToString();
                        _obj.MiddleName  = _dr["MiddleName"].ToString();
                        _obj.LastName    = _dr["LastName"].ToString();
                        _obj.Email       = _dr["Email"].ToString();
                        _obj.Mobile      = _dr["Mobile"].ToString();
                        _obj.DateOfBirth = _dr["DateOfBirth"].ToString();
                        _obj.StudentID   = _dr["StudentID"].ToString();
                        _obj.Country     = _dr["Country"].ToString();
                        _list.Add(_obj);
                    }
                }
            }
            return(Json(new
            {
                List = _list
            },
                        JsonRequestBehavior.AllowGet
                        ));
        }
        public JsonResult SearchStudent(string SearchString = "", string Captchastr = "")
        {
            bool flagCaptcha = false;
            bool flag        = false;
            List <ProfileManagement> _list = new List <ProfileManagement>();

            if (this.Session["CaptchaImageText"].ToString() == Captchastr)
            {
                flagCaptcha = true;
                string IP = "?";
                IP = Request.ServerVariables["REMOTE_ADDR"].ToString();
                SIIRepository.Adminservice.DashboardRepository _objRepo = new SIIRepository.Adminservice.DashboardRepository();
                DataSet _ds = _objRepo.Search_Student_Data(SearchString, IP);

                if (_ds != null)
                {
                    if (_ds.Tables[0].Rows.Count > 0)
                    {
                        flagCaptcha = true;
                        flag        = true;
                        foreach (DataRow _dr in _ds.Tables[0].Rows)
                        {
                            _list.Add(new ProfileManagement
                            {
                                srno         = _dr["srno"].ToString(),
                                StudentID    = _dr["StudentID"].ToString(),
                                StudentName  = _dr["StudentName"].ToString(),
                                Email        = _dr["Email"].ToString(),
                                Mobile       = _dr["Mobile"].ToString(),
                                Country      = _dr["Country"].ToString(),
                                Nationality  = _dr["Nationality"].ToString(),
                                Gender       = _dr["Gender"].ToString(),
                                DateOfBirth  = _dr["DateOfBirth"].ToString(),
                                Registerdate = _dr["Registerdate"].ToString()
                            });
                        }
                    }
                    else
                    {
                        flag = false;
                    }
                }
            }
            var jsonResult = Json(new {
                flagCaptcha = flagCaptcha,
                flag        = flag,
                List        = _list
            }, JsonRequestBehavior.AllowGet);

            jsonResult.MaxJsonLength = int.MaxValue;
            return(jsonResult);
        }