protected void populateTableEnabledModules()
        {
            int lecturerID = Convert.ToInt32(Session["lecturerID"]);
            litAlert.Text = "";
            //generate a table to list all modules
            ModuleHandler moduleHandler = new ModuleHandler();

            int moduleID = 0;
            string htmlOutput = "";

            List<Module> listModules = moduleHandler.GetModuleList(lecturerID);

            //Check to make sure there is modules in the system assigned to the lecturer
            if (listModules == null)
                litAlert.Text = "<div class='alert alert-warning'>There are currently no modules enabled on the system</div>";
            else
            {
                htmlOutput = "<thead><tr><th>Module code <i class='fa fa-sort'></i></th><th>Start month & year <i class='fa fa-sort'></i></th><th>Student list</th><th>Disable module</th></tr></thead>";
                //add modules to table as it is generated
                for (int i = 0; i < listModules.Count; i++)
                {
                    moduleID = listModules[i].ModuleID;
                    htmlOutput += "<tr><td>" + listModules[i].ModuleCode + "</td><td>" + listModules[i].Date.ToString("MM / yyyy") + " </td><td><a href=\"ViewStudents.aspx?module=" + listModules[i].ModuleID + "\">View</a></td><td><a href=\"DisableModule.aspx?id=" + listModules[i].ModuleID + "\"/>Disable</a></td></tr>\n";
                }
            }
            litModuleList.Text = htmlOutput;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //display list of modules linked to the lecturer
            int lecturerID = Convert.ToInt32(Session["LecturerID"]);
            ModuleHandler moduleHandler = new ModuleHandler();

            if (!Page.IsPostBack)
            {
                dlModules.DataSource = moduleHandler.GetModuleList(lecturerID);
                dlModules.DataTextField = "ModuleCode";
                dlModules.DataValueField = "ModuleID";
                dlModules.DataBind();
            }
        }
        //get module roll calls
        // GET api/mobile/1
        public List<TempModule> Get(string lecturer)
        {
            int lecturerID = Convert.ToInt32(lecturer);

            //generate a table to list all modules
            ModuleHandler moduleHandler = new ModuleHandler();

            List<Module> listModules = moduleHandler.GetModuleList(lecturerID);
            List<TempModule> newTempModules = new List<TempModule>();
            TempModule tempModule;
            //add modules to table as it is generated
            for (int i = 0; i < listModules.Count; i++)
            {
                tempModule = new TempModule();
                tempModule.ModuleID = listModules[i].ModuleID;
                tempModule.ModuleCode = listModules[i].ModuleCode;
                newTempModules.Add(tempModule);
                //moduleID = listModules[i].ModuleID;
                //htmlOutput += "<tr><td>" + listModules[i].ModuleCode + "</td><td>" + listModules[i].Date.ToString("MM / yyyy") + " </td><td><a href=\"ViewStudents.aspx?module=" + listModules[i].ModuleID + "\">View</a></td><td><a href=\"DisableModule.aspx?id=" + listModules[i].ModuleID + "\"/>Disable</a></td></tr>\n";
            }

            return newTempModules;
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     int lecturerID = Convert.ToInt32(Session["LecturerID"]);
     ModuleHandler moduleHandler = new ModuleHandler();
     //litAutoDisable.Text = "<input id='txtTime' runat='server' class='form - control required - field' placeholder='Minutes' type='time' required='required'/> <input id = 'txtDate' runat = 'server' class='form - control required - field' placeholder='Date' type='date' required='required'/><br /><br />";
     if (!Page.IsPostBack)
     {
         dlModules.DataSource = moduleHandler.GetModuleList(lecturerID);
         dlModules.DataTextField = "ModuleCode";
         dlModules.DataValueField = "ModuleID";
         dlModules.DataBind();
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            //get list of modules to select from
            int lecturerID = Convert.ToInt32(Session["LecturerID"]);
            ModuleHandler moduleHandler = new ModuleHandler();

            if (!Page.IsPostBack)
            {
                dlModules.DataSource = moduleHandler.GetModuleList(lecturerID);
                dlModules.DataTextField = "ModuleCode";
                dlModules.DataValueField = "ModuleID";
                dlModules.DataBind();

                dlModules_SelectedIndexChanged(null, null);
            }
        }