public JBISpecificResponse GetSpecificJBI(int idJBI) { JBISpecificResponse response = new JBISpecificResponse(); try { JBI one = _context.JBIs.Where((x) => x.Moneln == idJBI).FirstOrDefault(); if (one != null) { response.JBI = ConvertJBI(one); response.rc = 0; response.title = "Get one JBI success"; } else { response.rc = 1; response.title = "Id is not found"; } } catch (Exception ex) { var message = ex.Message; response.desc = ex.Message; } return(response); }
public JBISpecificResponse GetSpecificJBI(int idJBI) { JBISpecificResponse response = new JBISpecificResponse(); using (DalJBI context = new DalJBI()) { response = context.GetSpecificJBI(idJBI); } return(response); }
// GET: api/JBI/5 public JBISpecificResponse GetSpecificJBI(int idJBI) { JBISpecificResponse response = new JBISpecificResponse(); try { using (var manager = new JBIManager()) { response = manager.GetSpecificJBI(idJBI); } } catch (Exception ex) { //-----------------------------------------------------------------------------adderror to db--------------------------------------------------------------------------------------------- response.title = "Error in GetSpecificJBI function"; response.body = ex.Message; response.rc = 99; } return(response); }