public List <Department> Get() { try { return(_repository.Get()); } catch (Exception) { throw new ArgumentException(_errorMessage); } }
public JsonResult GetEmployeeRepo() { try { var _bu = lIMEmployees.ToModel(lIBusinessUnits.Get()); var _de = lIMEmployees.ToModel(lIDepartments.Get()); var _po = lIMEmployees.ToModel(lIPositions.Get()); return(Json(new { success = true, data = new { BUNT = _bu, DPRT = _de, PSTN = _po } }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { success = false, message = ex.Message }, JsonRequestBehavior.AllowGet)); } }