Exemple #1
0
        public ActionResult Index(string sort, string sortdir, int?page = 1)
        {
            var list  = EmployeeDataSource.CreateEmployees();
            var model = new RptViewModel {
                EmployeesList = list
            };

            return(View(model));
        }
Exemple #2
0
        [HttpPost] //for IE-8
        public ActionResult SearchEmployeeInfo(string data)
        {
            if (!Request.IsAjaxRequest())
            {
                return(Content(string.Empty));
            }

            if (string.IsNullOrWhiteSpace(data))
            {
                return(Content(string.Empty));
            }

            var employeesList = EmployeeDataSource.CreateEmployees();
            var list          = employeesList.Where(x => x.Name.Contains(data)).ToList();

            if (list == null || !list.Any())
            {
                return(Content(string.Empty));
            }

            return(PartialView(viewName: "_SearchEmployeeInfo", model: list));
        }
Exemple #3
0
        [HttpPost] //for IE-8
        public ActionResult EmployeeInfoData(int?id)
        {
            if (!Request.IsAjaxRequest())
            {
                return(Json(false));
            }

            if (!id.HasValue)
            {
                return(Json(false));
            }

            var list = EmployeeDataSource.CreateEmployees();
            var data = list.Where(x => x.Id == id.Value).FirstOrDefault();

            if (data == null)
            {
                return(Json(false));
            }

            return(Json(data));
        }
Exemple #4
0
        [HttpPost] //for IE-8
        public ActionResult EmployeeInfo(int?id)
        {
            if (!Request.IsAjaxRequest())
            {
                return(View("Error"));
            }

            if (!id.HasValue)
            {
                return(View("Error"));
            }

            var list = EmployeeDataSource.CreateEmployees();
            var data = list.Where(x => x.Id == id.Value).FirstOrDefault();

            if (data == null)
            {
                return(View("Error"));
            }

            return(PartialView(viewName: "_EmployeeInfo", model: data));
        }
        public ActionResult Index(string sort, string sortdir, int?page = 1)
        {
            var list = EmployeeDataSource.CreateEmployees();

            return(View(list));
        }