public List <SurveyStatus> GetEmployeeList() { SurveyPeriod surveyPeriodInfoObject = new SurveyPeriod(); surveyPeriodInfoObject.Type = "Annually"; surveyPeriodInfoObject.Period = "2016"; try { var empList = new Surveys().getAllSurveysListStatus(surveyPeriodInfoObject).Distinct().ToList(); List <SurveyStatus> employeeSurveyList = new List <SurveyStatus>(); foreach (var employeeInfo in empList) { if (!(employeeSurveyList.Where(c => c.Survey_For == employeeInfo.Survey_For).Count() > 0)) { employeeSurveyList.Add(employeeInfo); } } return(employeeSurveyList.Where(c => c.Completed == true).ToList()); } catch (Exception ex) { throw new Exception(ex.Message); } }
public IHttpActionResult GetEmployeesWithSurveyAllPerBusinessUnit(string businessUnit) { SurveyPeriod surveyPeriodInfoObject = new SurveyPeriod(); surveyPeriodInfoObject.Type = "Annually"; surveyPeriodInfoObject.Period = "2016"; try { var empList = new Surveys().getAllSurveysListStatus(surveyPeriodInfoObject).Distinct().ToList(); empList = empList.Where(c => c.Team_Desc == businessUnit.Replace("and", "&")).Distinct().ToList(); var employeeSurveyList = new List <SurveyStatus>(); foreach (var employeeInfo in empList) { if (!(employeeSurveyList.Where(c => c.Survey_For == employeeInfo.Survey_For).Count() > 0)) { employeeSurveyList.Add(employeeInfo); } } return(Ok(employeeSurveyList)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public IHttpActionResult GetSurveyCompletionStatusReportBySelectedRater(string rater) { var surveyPeriodObject = new SurveyPeriod(); surveyPeriodObject.Type = "Annually"; surveyPeriodObject.Period = "2016"; var surveyCompletionStatusReport = new Surveys().getRaterOuststanding(surveyPeriodObject); return(Ok(surveyCompletionStatusReport.Where(c => c.Rater == rater).ToList())); }
public IHttpActionResult GetSurveyCompletionStatusReportBySelectedbusinessUnit(string businessUnit) { var surveyPeriodObject = new SurveyPeriod(); surveyPeriodObject.Type = "Annually"; surveyPeriodObject.Period = "2016"; var surveyCompletionStatusReport = new Surveys().getRaterOuststanding(surveyPeriodObject); return(Ok(surveyCompletionStatusReport.Where(c => c.Team.ToLower() == businessUnit.ToLower() && c.No_of_Surveys > 0).ToList())); }
public IHttpActionResult GetAllEmployeeStatusSurveyReport() { SurveyPeriod raterSurveyObject = new SurveyPeriod(); raterSurveyObject.Type = "Annually"; raterSurveyObject.Period = "2016"; var surveyList = new Surveys().getSurveyCompletionStatusPeriod(raterSurveyObject); return(Ok(surveyList)); }
public IHttpActionResult GetAllEmployeeStatusSurveyReportPerBusinessUnit(string businessUnit) { SurveyPeriod survePeriodObject = new SurveyPeriod(); SurveyTeam teamObject = new SurveyTeam(); teamObject.Team = businessUnit; survePeriodObject.Type = "Annually"; survePeriodObject.Period = "2016"; var surveyList = new Surveys().getSurveyCompletionStatusBU(survePeriodObject, teamObject); return(Ok(surveyList)); }
public IHttpActionResult GetSurveyCompletionStatusList() { SurveyPeriod surveyPeriodObject = new SurveyPeriod(); surveyPeriodObject.Type = "Annually"; surveyPeriodObject.Period = "2016"; try { var surveyList = new Surveys().getSurveyCompletionRaters(surveyPeriodObject); return(Ok(surveyList)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public IHttpActionResult GetSurveyCompletionStatusReportPerRater(string filter, bool showEmployeesAssigned) { var surveyPeriodObject = new SurveyPeriod(); surveyPeriodObject.Type = "Annually"; surveyPeriodObject.Period = "2016"; if (!showEmployeesAssigned) { var surveyCompletionStatusReport = new Surveys().getRaterOuststanding(surveyPeriodObject); return(Ok(surveyCompletionStatusReport.Where(c => c.No_of_Surveys > 0))); } else { var surveyCompletionStatusReport = new Surveys().getRaterOuststanding(surveyPeriodObject); return(Ok(surveyCompletionStatusReport.OrderByDescending(c => c.No_of_Surveys).ToList())); } }
//Action Result method that returns rating comparison report public List <RatingComparisonResportModel> ViewRatingComparison() { var uniqueQuestionList = new List <Question>(); List <RatingComparisonResportModel> ratingComparisonReportPerRater = new List <RatingComparisonResportModel>(); var surveyPeriodObject = new SurveyPeriod(); surveyPeriodObject.Type = "Annually"; surveyPeriodObject.Period = "2016"; var rater = new Surveys().getSurveyTeamEmployeeList().Where(c => c.AD_User_Name.ToLower() == Generic.GetCurrentLogonUserName().ToLower()).First().Employee; //Get all the questions var ratingComparisonReportData = new Surveys().getDuplicateQuestion(surveyPeriodObject).Where(c => c.Rater == rater).ToList(); ////Get surveys for a logged in rater var raterCounter = 0; foreach (var ratingInformation in ratingComparisonReportData) { var questionRaterList = new List <DisplayData>(); var ratingFiguresList = new List <DisplayData>(); var ratingCommentList = new List <DisplayData>(); var question = string.Empty; var questionID = 0; if (!(uniqueQuestionList.Where(c => c.QuestionDescription == ratingInformation.Question_Desc).Count() > 0)) { question = ratingInformation.Question_Desc; questionID = ratingInformation.Question_ID; uniqueQuestionList.Add(new Question() { QuestionDescription = question, QuestionID = questionID }); // Get comparison report information var questionDetails = ratingComparisonReportData.Where(c => c.Question_Desc.ToLower() == uniqueQuestionList[raterCounter].QuestionDescription.ToLower()).ToList(); foreach (var item in questionDetails) { questionRaterList.Add(new DisplayData() { Text = item.Survey_For }); ratingFiguresList.Add(new DisplayData() { Value = item.Rating.ToString(), RatingComment = item.Rater_Comment }); } raterCounter++; ratingComparisonReportPerRater.Add(new RatingComparisonResportModel() { Question = question, QuestionID = questionID, SurveryForList = questionRaterList, Ratings = ratingFiguresList, Comments = ratingCommentList }); } } return(ratingComparisonReportPerRater); }