public ResultViewModel <UserTrackViewModel> GetByID(int id) { ResultViewModel <UserTrackViewModel> result = new ResultViewModel <UserTrackViewModel>(); try { var UserTrack = UserTrackService.GetByID(id)?.ToViewModel(); result.Successed = true; result.Data = UserTrack; } catch (Exception ex) { result.Successed = false; result.Message = "Something Went Wrong !!"; } return(result); }
public string Approve(int id) { try { userTrackService.Approve(id); int UserID = userTrackService.GetByID(id).UserID; string TrackName = userTrackService.GetByID(id).Track.Name; Hub.Clients.All.GetApproval(new { UserID, TrackName }); Hub.Clients.All.UpdatePieChart(userTrackService.GetPieChartData()); return("Track Approved Sucessfully"); } catch (Exception e) { return("Error"); } }