Beispiel #1
0
        public WebLinkReturnModel GetDataAll(WebLinkModelParameter model)
        {
            string msgError = "";

            try
            {
                var dt = _dbHelper.ExecuteSProcedureReturnDataTable(out msgError, "sp_weblink_search",
                                                                    "@page_index", model.Page?.PageIndex,
                                                                    "@page_size", model.Page?.PageSize,
                                                                    "@tenweblink", model.Data.Link_Name);
                //var dt = _dbHelper.ExecuteSProcedureReturnDataTable(out msgError, "get_all_weblink");
                var result = new WebLinkReturnModel();
                if (!string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(msgError);
                }
                else
                {
                    result.Data     = dt.ConvertTo <WebLinkModel>().ToList();
                    result.TotalRow = int.Parse(dt.Rows[0].ItemArray[dt.Rows[0].ItemArray.Length - 1].ToString());
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public async Task <IActionResult> GetData(RequestDataModel request)
        {
            var webLinkModelParamater = new WebLinkModelParameter();
            var settings     = new JsonSerializerSettings();
            var searchObject = new WebLinkModel
            {
            };

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

            webLinkModelParamater.Page = page;
            webLinkModelParamater.Data = searchObject;
            var hostAPI = "https://localhost:44322";
            var data    = await ApiProvider.PostAsync <WebLinkReturnModel>(hostAPI, ApiConstant.GetAllWebLink, webLinkModelParamater);

            return(Json(data));
        }
Beispiel #3
0
 public WebLinkReturnModel GetDataAll([FromBody] WebLinkModelParameter model)
 {
     return(_bus.GetDataAll(model));
 }
Beispiel #4
0
 public WebLinkReturnModel GetDataAll(WebLinkModelParameter model)
 {
     return(_res.GetDataAll(model));
 }