예제 #1
0
        internal void paybillStudent(Courses course, int AdmNo)
        {
            int id = course.getID();

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

            com.CommandText = "UPDATE payments SET paid = 1 WHERE studentID = " + AdmNo + " AND courseID = " + id + ";";
            com.ExecuteNonQuery();
            this.con.Close();
        }
예제 #2
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();
        }
예제 #3
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");
     }
 }
예제 #4
0
        internal void updatecost(Courses cs, double newcost)
        {
            String updatecostcom = "UPDATE courses SET cost = " + newcost.ToString() + " WHERE ID = " + cs.getID().ToString() + ";";

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

            com.CommandText = updatecostcom;
            com.ExecuteNonQuery();
            this.con.Close();
        }