public CustomerModel searchCustomer(CustomerInputSearchModel input) { try { SqlParameter[] prms = new SqlParameter[] { new SqlParameter{ ParameterName = "cif", DbType = DbType.String, Value = input.cif == null ? (object)DBNull.Value : input.cif, Size = Int32.MaxValue }, new SqlParameter{ ParameterName = "name", DbType = DbType.String, Value = input.name == null ? (object)DBNull.Value : input.name, Size = Int32.MaxValue }, new SqlParameter{ ParameterName = "pageNumber", DbType = DbType.Int32, Value = input.pageNumber , Size = Int32.MaxValue }, new SqlParameter{ ParameterName = "pageSize", DbType = DbType.Int32, Value = input.pageSize, Size = Int32.MaxValue }, new SqlParameter{ ParameterName = "resultMessage", DbType = DbType.String, Direction= ParameterDirection.Output, Size = Int32.MaxValue }, new SqlParameter{ ParameterName = "resultCode", DbType = DbType.Int32, Direction= ParameterDirection.Output, Size = Int32.MaxValue } }; var result = _Repository.ExecWithStoreProcedureCommand(Store_searchCustomer, prms); if(result.errorCode == 0) { var resultObject = JsonConvert.DeserializeObject<CustomerModel>(result.errorMessage); return resultObject; } return new CustomerModel(); } catch (Exception ex) { HDBH.Log.WriteLog.Error("ModuleService => searchCustomer", ex); return null; } }
public JsonResult searchPopupCustomer(CustomerInputSearchModel input) { var result = new CustomerModel(); result = _customerService.searchCustomer(input); return(Json(new { recordsTotal = result.TotalRecord, recordsFiltered = result.TotalRecord, data = result.resultList })); }