public List<Note> GetNotes(Roll roll) { string sql = NotesSql(roll); var reader = Data_Context.RunSelectSQLQuery(sql, 30); var notes = new List<Note>(); if (reader.HasRows) { var sReader = new SpecialistsReader(); while (reader.Read()) { string uName = reader["Author"] as string; var spec = sReader.GetSpecialist(uName); string n = reader["Note"] as string; DateTime date = reader.GetDateTime(4); string step = reader["StepTypeID"] as string; var note = new Note(spec, n, date, step); notes.Add(note); } return notes; } else return null; }
public List<History> GetHistories(Roll roll) { string sql = HistorySql(roll); var reader = Data_Context.RunSelectSQLQuery(sql, 30); var histories = new List<History>(); if (reader.HasRows) { var sReader = new SpecialistsReader(); while (reader.Read()) { string uName = reader["UserName"] as string; var spec = sReader.GetSpecialist(uName); string m = reader["Message"] as string; DateTime date = reader.GetDateTime(3); string step = reader["CurrentQueue"] as string; var note = new History(spec, m, date, step); histories.Add(note); } Data_Context.CloseConnection(); return histories; } else return null; }
public List<ImageNote> GetNotes(Roll roll) { string sql = ImageNotesSql(roll); var reader = Data_Context.RunSelectSQLQuery(sql, 30); var imgNotes = new List<ImageNote>(); if (reader.HasRows) { var sReader = new SpecialistsReader(); while (reader.Read()) { string uName = reader["Author"] as string; var spec = sReader.GetSpecialist(uName); string n = reader["Note"] as string; DateTime date = reader.GetDateTime(3); int imgNum = reader.GetInt32(0); if (n.Count() > 16) { if (n.ToLower().Substring(0, 16) != "edited in imageq") { var imgNote = new ImageNote(spec, n, date, imgNum); imgNotes.Add(imgNote); } } else { var imgNote = new ImageNote(spec, n, date, imgNum); imgNotes.Add(imgNote); } } Data_Context.CloseConnection(); return imgNotes; } else return null; }