예제 #1
0
        public IHttpActionResult GetDashBoardData(string empId)
        {
            try
            {
                using (MaxMasterDbEntities db = new MaxMasterDbEntities())
                {
                    var statusSummary    = db.StatusSummary(empId).ToList();
                    var clientSummary    = db.ClientTasksSummary(empId).ToList();
                    var categorySummary  = db.CategoriesSummary(empId).ToList();
                    var employeesSummary = db.EmployeeTasksSummary().ToList();
                    var leadsSummary     = db.LeadsSummary().ToList();

                    return(Content(HttpStatusCode.OK, new { statusSummary, clientSummary, categorySummary, employeesSummary, leadsSummary }));
                }
            }
            catch (Exception ex)
            {
                new Error().logAPIError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), ex.StackTrace);
                return(Content(HttpStatusCode.InternalServerError, "An error occured,please try again later"));
            }
        }