public IHttpActionResult Get(int id) { COMPANIES_RMAGBL objCompanies_Rmags = new COMPANIES_RMAGBL(); COMPANIES_RMAGDC objResult = new COMPANIES_RMAGDC(); try{ objResult = objCompanies_Rmags.LoadByPrimaryKey(id); return(Ok(new { objResult })); } catch (Exception ex) { return(new TextResult(ex.Message, Request)); } }
public COMPANIES_RMAGDC LoadByPrimaryKey(int COMPANY_RMAG_ID) { DBConnection objConnection = new DBConnection(); COMPANIES_RMAGDA objCOMPANIES_RMAGDA = new COMPANIES_RMAGDA(); COMPANIES_RMAGDC objCOMPANIES_RMAGDC = null; try { objConnection.Open(false); objCOMPANIES_RMAGDC = objCOMPANIES_RMAGDA.LoadByPrimaryKey(objConnection, COMPANY_RMAG_ID); } catch (Exception ex) { throw ex; } finally { objConnection.Close(); } return(objCOMPANIES_RMAGDC); }