Ejemplo n.º 1
0
        public ActionResult GetUserInputs()
        {
            //Get param from REQUEST
            var nextPage = Request["currentPage"] == "" ? 0 : Int32.Parse(Request["currentPage"]);
            var pageSize = Request["pageItems"] == "" ? 5 : Int32.Parse(Request["pageItems"]);
            var orderBy = Request["orderBy"] == "" ? "Id" : Request["orderBy"];
            var orderByReverse = Request["orderByReverse"] == "" ? "true" : Request["orderByReverse"];
            var searchText = Request["searchText"];

            PagingModel paging = new PagingModel();
            paging.PageSize = pageSize;
            paging.PageIndex = nextPage;
            paging.SortOn = orderBy;
            paging.SortReversed = orderByReverse;
            paging.SearchString = searchText;

            //Call class from business layer to handle the business. Controller only servers as an coordinator
            var data = new UserInputBL().GetUserInputs(paging);

            return Json(new
            {
                userInputs = data.Result,
                total = data.TotalSize
            }, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 2
0
        public ActionResult DeleteUserInput()
        {
            //Get param from REQUEST
            var uId = Request["uId"] == "" ? 0 : Int32.Parse(Request["uId"]);

            //Call class from business layer to handle the business. Controller only servers as an coordinator
            var result = new UserInputBL().DeleteUserInput(uId);

            return Json(result, JsonRequestBehavior.AllowGet);
        }
Ejemplo n.º 3
0
        public ActionResult AddUserInput()
        {
            //Get param from REQUEST
            var expression = Request["expression"].ToString();
            var expressionResult = Request["expessionResult"].ToString();

            //Call class from business layer to handle the business. Controller only servers as an coordinator
            var result = new UserInputBL().AddUserInput(expression, expressionResult);
            return Json(result, JsonRequestBehavior.AllowGet);
        }