Example #1
0
        public GroupPageReturnModel GetDataAll(GroupPageModelParameter model)
        {
            string msgError = "";

            try
            {
                var dt = _dbHelper.ExecuteSProcedureReturnDataTable(out msgError, "sp_page_group_search",
                                                                    "@page_index", model.Page?.PageIndex,
                                                                    "@page_size", model.Page?.PageSize,
                                                                    "@tenpr", model.Data.GroupPage_Name);
                var result = new GroupPageReturnModel();
                if (!string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(msgError);
                }
                else
                {
                    result.Data     = dt.ConvertTo <GroupPageModel>().ToList();
                    result.TotalRow = int.Parse(dt.Rows[0].ItemArray[dt.Rows[0].ItemArray.Length - 1].ToString());
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
        public async Task <IActionResult> Index()
        {
            var grouppageModelParamater = new GroupPageModelParameter();
            GroupPageReturnModel data   = await ApiProvider.PostAsync <GroupPageReturnModel>(url, ApiConstant.GetDataAllGroupPage, grouppageModelParamater);

            ViewData["GroupPage"] = data.Data;
            return(View());
        }
Example #3
0
        public GroupPageReturnModel GetAll(GroupPageModelParameter model)
        {
            string msgError = "abc";

            try
            {
                var dt     = _dbHelper.ExecuteSProcedureReturnDataTable(out msgError, "sp_Page_Group_getall");
                var result = new GroupPageReturnModel();
                if (!string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(msgError);
                }
                else
                {
                    result.Data = dt.ConvertTo <GroupPageModel>().ToList();
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #4
0
        public async Task <IActionResult> GetData(RequestDataModel request)
        {
            var grouppageModelParamater = new GroupPageModelParameter();
            var settings     = new JsonSerializerSettings();
            var searchObject = new GroupPageModel
            {
            };

            settings.DateFormatString = "dd/MM/yyyy";
            searchObject = JsonConvert.DeserializeObject <GroupPageModel>(request.model, settings);
            var page = new PageParameter
            {
                PageIndex = request.start,
                PageSize  = request.length
            };

            grouppageModelParamater.Page = page;
            grouppageModelParamater.Data = searchObject;
            var hostAPI = url;
            var data    = await ApiProvider.PostAsync <GroupPageReturnModel>(hostAPI, ApiConstant.GetAllGroupPage, grouppageModelParamater);

            return(Json(data));
        }
Example #5
0
 public GroupPageReturnModel GetAll(GroupPageModelParameter model)
 {
     return(_res.GetAll(model));
 }
Example #6
0
 public GroupPageReturnModel GetDataAll(GroupPageModelParameter model)
 {
     return(_bus.GetDataAll(model));
 }