public static List<Rating> GetSupervisorRatings(string staffUsername, int? eventId, int? eventDateId) { List<Rating> output = new List<Rating>(); string sql = "SELECT * FROM REQ_SupervisorRatings WHERE UPPER(StaffUsername)='" + staffUsername.ToUpper() + "' AND "; if (eventId.HasValue) sql += "EventID = " + eventId.Value; //13/6/2012 added to carry forward justification if (eventId.HasValue && eventDateId.HasValue) sql += "OR EventDateID = " + eventDateId.Value; else if (eventDateId.HasValue) sql += "EventDateID = " + eventDateId.Value; using (SqlConnection conn = UtilityDb.GetConnectionESS()) { SqlDataReader dr = UtilityDb.GetDataReader(sql, conn); while (dr.Read()) { Rating obj = new Rating(); obj.Value = Convert.ToInt32(dr["Value"]); output.Add(obj); } } return output; }
public List<Rating> GetAll() { List<Rating> output = new List<Rating>(); for (int i = 0; i <= 5; i++) { Rating newRating = new Rating(); newRating.Value = i; output.Add(newRating); } return output; }
public void GetAnswers(ref List<Rating> ratings, ref string staffNotes, ref string supervisorNotes) { staffNotes = ""; supervisorNotes = ""; ratings = new List<Rating>(); foreach (GridViewRow row in gvQuestions.Rows) { TableCell cell = row.Cells[ColumnRatings]; RadioButtonList rblRatings = (RadioButtonList)cell.FindControl("rbRatings"); Rating rating = new Rating(); int indexRating = 0; Int32.TryParse(rblRatings.SelectedValue, out indexRating); rating.Value = indexRating; ratings.Add(rating); } staffNotes = txtStaffNotes.Text; supervisorNotes = txtSupervisorNotes.Text; }