Implementing the Desktop Application
This marks the start of the “Register” form used by administrators to add new users:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Data.SqlClient;
using System.Security.Cryptography;
namespace csNEA
{
public partial class Register : Form
{
public static SqlConnectionStringBuilder builder { get; set; }
public static UnicodeEncoding ByteConverter = new UnicodeEncoding();
public static RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
public static byte[] plaintext;
public static byte[] encryptedtext;
public Register()
{
InitializeComponent();
}The below procedure hides the registration form and returns the user to the administrator form:
The below procedure sets the database information to the form’s temporary SQL builder variable:
The below procedure adds the user to the database:
This marks the start of the “RegisterStudent” form used by administrators to add new students:
The below procedure sets the database information to the form’s temporary SQL builder variable:
The below procedure adds the student to the database:
The below procedure is run when the form is displayed. It gets the groups from the database and fills a ComboBox so that the user can select which group the student will be a member of:
The below procedure hides the student registration form and returns the user to the administrator form:
This marks the start of the “Login” form used to log into the desktop application:
The below procedure is run when the form is displayed. It fetches the information stored in the application’s settings if, on the previous run the user has chosen to store the database information:
The below procedure fetches the users from the database and checks them with the credentials entered by the user. It then responds accordingly, based on the role (access rights) of the user detected:
The below procedure adds a user to the list of users. Its parameters are passed from what the reader above fetches from the database:
What follows is the administrator, or main form implemented in C#:
The below procedure sets the database information to the form’s temporary SQL builder variable:
The below procedure returns the user to the LogIn Form:
The below procedure runs when the form is displayed and updates the initial ListBoxes:
The below procedure does not allow secretaries to view specific tabs in the desktop application:
The below procedure posts an update to the feed:
The below procedure uploads a user’s schedule:
The below procedure removes any teachings information from the database from a user before the new one is uploaded:
The below procedure removes all users from the listBox and fetches them again from the database:
The below procedure removes all lessons from the listBox and fetches them again from the database:
The below procedure validates and adds a new lesson to the database:
The below procedure removes the selected lesson and all records associated with it such as teaching records from the database:
The below procedure is used to change a user’s password:
The below procedure validates and adds a group to the database:
The below procedure removes all groups from the relevant listBoxes and comboBoxes and fetches them again from the database:
The below procedure sets a user as the ‘head’, or mentor of a group:
The below procedure adds all students found in a flat file:
The below procedure displays the RegisterStudent form where students can be added manually:
The below procedure displays all students in a given group:
The below procedure displays all students:
The below procedure updates the group of students (transfers them) to another group:
The below procedure adds a semester and dates to the database:
The below procedure removes all semesters from the listBox and fetches them again from the database:
The below procedure removes all dates and semester from the database:
The below procedure displays all students absent from a given group for the date/period chosen:
The below procedure generates a flat file of all students absent (from a given group) for the date/period chosen:
The below procedure removes a user and all their associated records from the database:
The below procedure is used to execute an SQL command:
The below procedure removes a student and their associated attendance records from the database:
The below procedure removes a group and its associated student, attendance and teaching records from the database:
Last updated