Beispiel #1
0
        internal void billStudent(Courses course, int AdmNo)
        {
            int    id   = course.getID();
            double cost = course.getCost();

            this.con.Open();
            SQLiteCommand com = new SQLiteCommand(this.con);

            com.CommandText = "INSERT INTO payments (studentID,courseID,amount,paid) Values ('" + AdmNo + "','" + id + "','" + cost + "',0);";
            com.ExecuteNonQuery();
            this.con.Close();
        }
Beispiel #2
0
 public static void CourseChooser(Courses course, ref Student stud)
 {
     //if course is already registered skip, else register course, then bill.
     if (!stud.payments.CheckRegistered(course.getID()))
     {
         stud.payments.bill(course);
         Console.WriteLine("Course " + course.getName() + " has been registered, KES " + course.getCost() + " has been charged to " + stud.getName() + "'s account");
         Console.WriteLine("KES " + stud.payments.getTotal() + " is now owed to the school by " + stud.getName());
     }
     else
     {
         Console.WriteLine("Course Already Registered");
     }
 }