public JBIListResponse GetFilterJBIList(int role, string name) { JBIListResponse response = new JBIListResponse(); try { List <JBI> lst = _context.JBIs.ToList(); //List<JBI> lst = _context.JBIs.Where((x) => x.Moneln == idJBI).ToList(); if (lst != null) { foreach (JBI item in lst) { response.JBI.Add(ConvertJBI(item)); } response.rc = 0; response.desc = "_context.JBIs.ToList()"; response.title = "Get list of JBI success"; } else { response.rc = 1; response.title = "List is empty"; } } catch (Exception ex) { var message = ex.Message; response.desc = ex.Message; } return(response); }
public JBIListResponse GetAllJBI() { JBIListResponse response = new JBIListResponse(); try { List <JBI> lst = _context.JBIs.ToList(); if (lst != null) { foreach (JBI item in lst) { response.JBI.Add(ConvertJBI(item)); } response.rc = 0; response.desc = "_context.JBIs.ToList()"; response.title = "Get list of JBI success"; } else { response.rc = 1; response.title = "List is empty"; } } catch (Exception ex) { var message = ex.Message; response.desc = ex.Message; } return(response); }
public JBIListResponse GetFilterJBIlist(int role, string name) { JBIListResponse response = new JBIListResponse(); using (DalJBI context = new DalJBI()) { response = context.GetFilterJBIList(role, name); } return(response); }
public JBIListResponse GetAllJBI() { JBIListResponse response = new JBIListResponse(); using (DalJBI context = new DalJBI()) { response = context.GetAllJBI(); } return(response); }
public JBIListResponse GetFilterJBIList(int role = 0, string name = "") { JBIListResponse response = new JBIListResponse(); try { using (var manager = new JBIManager()) { response = manager.GetFilterJBIlist(role, name); } } catch (Exception ex) { //-----------------------------------------------------------------------------adderror to db--------------------------------------------------------------------------------------------- response.title = "Error in GetFilterJBIlist function"; response.body = ex.Message; response.rc = 99; } return(response); }
// GET: api/JBI public JBIListResponse GetAllJBI() { JBIListResponse response = new JBIListResponse(); try { using (var manager = new JBIManager()) { response = manager.GetAllJBI(); } } catch (Exception ex) { //-----------------------------------------------------------------------------adderror to db--------------------------------------------------------------------------------------------- response.title = "Error in GetAllJBI function"; response.body = ex.Message; response.rc = 99; } return(response); }