//for Catagory drp
        public void GetStudentForDrp()
        {
            StudentParticularsBL studentParticularsBL = new StudentParticularsBL();
            List<StudentParticularsEntities> pocoList = new List<StudentParticularsEntities>();

            pocoList = studentParticularsBL.GetStudentForDrp();

            List<StudentParticularsEntities> itmasterList = new List<StudentParticularsEntities>();

            foreach (StudentParticularsEntities up in pocoList)
            {
                StudentParticularsEntities unt = new StudentParticularsEntities();
                unt.StudentID = up.StudentID;
                unt.StudentName = up.StudentName;

                itmasterList.Add(unt);
            }

            ViewBag.StudentParticulars = itmasterList.Select(x =>
                                            new SelectListItem()
                                            {
                                                Text = x.StudentName,
                                                Value = x.StudentID.ToString()
                                            });

        }
Esempio n. 2
0
        public JsonResult LoadData(string searchvalue)
        {
            int draw, start, length;
            int pageIndex = 0;

            if (null != Request.Form.GetValues("draw"))
            {
                draw   = int.Parse(Request.Form.GetValues("draw").FirstOrDefault().ToString());
                start  = int.Parse(Request.Form.GetValues("start").FirstOrDefault().ToString());
                length = int.Parse(Request.Form.GetValues("length").FirstOrDefault().ToString());
            }
            else
            {
                draw   = 1;
                start  = 0;
                length = 50;
            }

            if (start == 0)
            {
                pageIndex = 1;
            }
            else
            {
                pageIndex = (start / length) + 1;
            }

            StudentParticularsBL studentParticularsBL = new StudentParticularsBL();
            int totalrecords = 0;

            List <StudentParticularsEntities> studentParticularsEntitiesList = new List <StudentParticularsEntities>();

            studentParticularsEntitiesList = studentParticularsBL.GetStudentSearchByNamePageWise(pageIndex, ref totalrecords, length, searchvalue);

            var data = studentParticularsEntitiesList;

            return(Json(new { draw = draw, recordsFiltered = totalrecords, recordsTotal = totalrecords, data = data }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult GetStudentParticularsByID(int ID)
        {
            StudentParticularsBL studentParticularsBL = new StudentParticularsBL();

            return(Json(studentParticularsBL.GetStudentParticularsByID(ID), JsonRequestBehavior.AllowGet));
        }
        public JsonResult Add(StudentParticularsEntities studentParticularsEntities)
        {
            StudentParticularsBL studentParticularsBL = new StudentParticularsBL();

            return(Json(studentParticularsBL.SaveStudentParticulars(studentParticularsEntities), JsonRequestBehavior.AllowGet));
        }