public List <RoleMasterPagingOutPut> InsertPagingQuery(RoleMasterPaging roleMasterPaging, ref string totalcount) { try { List <RoleMasterPagingOutPut> objoutput = new List <RoleMasterPagingOutPut>(); DataSet ds = new DataSet(); using (OracleConnection con = new OracleConnection(MyConnectionString)) { string query = "pkg_api_integration.PROC_VSEC_ROLEMASTER_VW"; con.Open(); OracleCommand cmd = new OracleCommand(query, con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("P_ROLEID", OracleDbType.Int32, roleMasterPaging.id, ParameterDirection.Input); cmd.Parameters.Add("P_ROLESNAME", OracleDbType.Varchar2, roleMasterPaging.rolesname, ParameterDirection.Input); cmd.Parameters.Add("P_DISPLAYNAME", OracleDbType.Varchar2, roleMasterPaging.displayname, ParameterDirection.Input); cmd.Parameters.Add("P_ACTIVEFLAG", OracleDbType.Varchar2, roleMasterPaging.activeflag, ParameterDirection.Input); cmd.Parameters.Add("P_SORTCOL", OracleDbType.Varchar2, roleMasterPaging.sortCol, ParameterDirection.Input); cmd.Parameters.Add("P_SORTORDER", OracleDbType.Varchar2, roleMasterPaging.sortOrder, ParameterDirection.Input); cmd.Parameters.Add("P_PAGENO", OracleDbType.Int32, roleMasterPaging.page, ParameterDirection.Input); cmd.Parameters.Add("P_PAGESIZE", OracleDbType.Int32, roleMasterPaging.limit, ParameterDirection.Input); cmd.Parameters.Add("P_DATA", OracleDbType.RefCursor, ParameterDirection.Output); cmd.Parameters.Add("p_TotalCount", OracleDbType.Int32, ParameterDirection.Output); cmd.Parameters.Add("P_ERROR", OracleDbType.Varchar2, 2000, "", ParameterDirection.Output); OracleDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { RoleMasterPagingOutPut output = new RoleMasterPagingOutPut(); output.id = Convert.ToInt32(dr["id"].ToString()); // output. = dr["PARENTROLEID"].ToString(); output.rolesname = dr["rolesname"].ToString(); output.displayname = dr["displayname"].ToString(); output.activeflag = dr["activeflag"].ToString(); objoutput.Add(output); } totalcount = Convert.ToString(cmd.Parameters["p_TotalCount"].Value); } return(objoutput); } catch (Exception ex) { throw ex; } }
public IActionResult PagingQuery([FromQuery] RoleMasterPaging roleMasterPaging) { string totalRecords = string.Empty; var res = _roleMasterRepository.InsertPagingQuery(roleMasterPaging, ref totalRecords); if (res != null) { responsemessage = new ResponseMessage("success", "", res, totalRecords.ToString()); } else { responsemessage = new ResponseMessage("failure", "", res, totalRecords.ToString()); } return(Ok(responsemessage)); }
public List <RoleMasterPagingOutPut> InsertPagingQuery(RoleMasterPaging roleMasterPaging, ref string totalcount) { return(roleMasterDAL.InsertPagingQuery(roleMasterPaging, ref totalcount)); }