public Student GetStudentDataByUser(User user) { Student student = StudentData.IsThereStudent(user.facultyNumber); if (student == null) { throw new NoStudentFoundException(user.facultyNumber); } return(student); }
static void Main(string[] args) { Console.WriteLine("Enter faculty number"); string fn = Console.ReadLine(); if (StudentData.IsThereStudent(fn)) { Student student = StudentData.TestStudents.Where(s => s.FacultyNumber == fn).First(); string certificate = StudentData.PrepareCertificate(student); StudentData.SaveCertificate(certificate, student.Firstname + " " + student.Lastname + " " + student.FacultyNumber + ".txt"); } }
public static Student GetStudentDataByUser(User user) { if (user.facNumber == null) { Student s = StudentData.IsThereStudent(user.facNumber); if (s != null) { return(s); } } System.Console.WriteLine("No Student found for the user"); return(null); }
static void Main(string[] args) { StudentData.InitTestStudents(); Console.Write("Enter fac number: "); string facNumber = Console.ReadLine(); Student student = StudentData.IsThereStudent(facNumber); string cert = StudentData.PrepareCertificate(student); Console.WriteLine(cert); StudentData.SaveCertificate(cert); }
public static void Main(string[] args) { StudentData obj = new StudentData(); obj.DataFill(); Console.WriteLine("Enter FNumber: "); String fakultetennomer = Console.ReadLine(); Student T = StudentData.IsThereStudent(fakultetennomer); Console.WriteLine(T); Console.Write("Press any key to continue . . . "); Console.ReadKey(true); }
static void Main(string[] args) { String fnom; String cer; Student stud; StudentData.addTestStudents(); Console.WriteLine("StudentRepository"); Console.WriteLine("F.Nom to print"); fnom = Console.ReadLine(); stud = StudentData.IsThereStudent(fnom); cer = StudentData.PrepareCertificate(ref stud); Console.WriteLine(cer); StudentData.SaveCertificate(cer); }
public Student GetStudentDataByUser(User student) { if (string.IsNullOrEmpty(student.FacultyNumber) || student == null) { throw new Exception("User is not found"); } var studentRecord = studentData.IsThereStudent(student.FacultyNumber); if (studentRecord == null) { throw new Exception("User is not found"); } return(studentRecord); }
static void Main(string[] args) { string facultyNum; StudentData.InitTestStudents(); Console.WriteLine("Search user by faculty num"); facultyNum = Console.ReadLine(); Student studentMatching = StudentData.IsThereStudent(facultyNum); if (studentMatching != null) { File.AppendAllText("../../testFacultyNumber.txt", studentMatching.ToString()); } else { Console.WriteLine("No matching student"); } }
public Student GetStudentDataByUser(User user) { if (string.IsNullOrEmpty(user.FacNumber) || user == null) { _errorFunc("User is not found"); return(null); } var studentRecord = studentData.IsThereStudent(user.FacNumber); if (studentRecord == null) { _errorFunc("User is not found"); return(null); } return(studentRecord); }
static void Main(string[] args) { StudentData data = new StudentData(); Console.WriteLine("Enter faculty number:"); string facNumber = Console.ReadLine(); var result = data.IsThereStudent(facNumber); if (result != null) { Console.WriteLine(result.FirstName); Console.WriteLine(result.LastName); Console.WriteLine(result.Course); } else { Console.WriteLine("No such user"); } }