Exemple #1
0
        public MenTorReturnModel GetDataAll(MenTorModelParameter model)
        {
            string msgError = "";

            try
            {
                var dt = _dbHelper.ExecuteSProcedureReturnDataTable(out msgError, "sp_mentor_search",
                                                                    "@page_index", model.Page?.PageIndex,
                                                                    "@page_size", model.Page?.PageSize,
                                                                    "@tenmentor", model.Data.Mentor_Name);
                var result = new MenTorReturnModel();
                if (!string.IsNullOrEmpty(msgError))
                {
                    throw new Exception(msgError);
                }
                else
                {
                    result.Data     = dt.ConvertTo <MentorModel>().ToList();
                    result.TotalRow = int.Parse(dt.Rows[0].ItemArray[dt.Rows[0].ItemArray.Length - 1].ToString());
                }
                return(result);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public async Task <IActionResult> GetData(RequestDataModel request)
        {
            var mentorModelParamater = new MenTorModelParameter();
            var settings             = new JsonSerializerSettings();
            var searchObject         = new MentorModel
            {
            };

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

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

            return(Json(data));
        }
Exemple #3
0
 public MenTorReturnModel GetDataAll(MenTorModelParameter model)
 {
     return(_res.GetDataAll(model));
 }