protected void buttonLogin_Click(object sender, EventArgs e) { this.lectors = new LambdaLecturers(HttpUtility.HtmlEncode(this.textboxUsername.Text), HttpUtility.HtmlEncode(this.textboxPassword.Text)); if (this.lectors.GetCheckLectorInfo()) { HttpContext.Current.Session.Add(SessionEnum.SessionNames.LecturorsID.ToString(), this.lectors.GetCheckLecturersInfo_DatabaseFields().ID); int accessLvl = int.Parse(this.lectors.GetCheckLecturersInfo_DatabaseFields().Access.ToString()); Session.Add(SessionEnum.SessionNames.AccessLvl.ToString(), accessLvl); if (accessLvl == 2) { Response.Redirect("AdminMain.aspx"); } else { LambdaCampus lambdaCampus = new LambdaCampus(); HttpContext.Current.Session.Add(SessionEnum.SessionNames.CampusName.ToString(), lambdaCampus.Entity.DB_Campus.ToList().First().Place); Response.Redirect(NEXT_PAGE); } } else { this.ErrorLabel.Visible = true; this.textboxPassword.Text = ""; this.textboxUsername.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { try { if (HttpContext.Current.Session[SessionEnum.SessionNames.LecturorsID.ToString()].Equals(string.Empty)) HttpContext.Current.Response.Redirect(NEXT_PAGE); } catch { HttpContext.Current.Response.Redirect(NEXT_PAGE); } this.entity = new Entity(); int aantal_buttons = this.entity.DB_Slots.Count; this.buttons = new ButtonGenerator(aantal_buttons); //MessageBox.Show(HttpContext.Current.Session[SessionEnum.SessionNames.CampusName.ToString()].ToString()); this.lambdaCampus = new LambdaCampus(HttpContext.Current.Session[SessionEnum.SessionNames.CampusName.ToString()].ToString()); TableAP table = new TableAP(this.lambdaCampus.GetFilterToCampus()); for (int i = 0; i < table.List.Count; i++) { table.Index = i; this.tableDatum.Rows.Add(table.GetTableDate()); this.tableBegin.Rows.Add(table.GetTableDateBegin()); this.tableEind.Rows.Add(table.GetTableDateEnd()); this.tableDigitaal.Rows.Add(table.GetTableDigital()); this.tableDuur.Rows.Add(table.GetTableDuration()); this.tableLocatie.Rows.Add(table.GetTableLocation()); this.tableBeschikbaar.Rows.Add(table.GetTableAvailibility()); this.tableCapaciteit.Rows.Add(table.GetTableCapacity()); Panel1.Controls.Add(buttons.WriteButton(i, table.List.ElementAt(i).ID.ToString())); this.buttons.ClickSlots(i); } lblCampus.Text = lambdaCampus.CampusName; }
public System.Web.UI.WebControls.Button WriteButton(int x, string stringID) { this.entity = new Entity(); this.lambdaCampus = new LambdaCampus(HttpContext.Current.Session[SessionEnum.SessionNames.CampusName.ToString()].ToString()); this.lambdaSlots = new LambdaSlots(this.lambdaCampus.GetFilterToCampus().ElementAt(x).ID); this.lambdaReservations = new LambdaReservations(this.lambdaSlots.ID); this.Bord[x] = new System.Web.UI.WebControls.Button(); this.Bord[x].Width = GROTEBUTTON_X; this.Bord[x].Height = GROTEBUTTON_Y; this.Bord[x].CommandName = stringID; if (!lambdaSlots.GetControlAvailibe() && !this.lambdaReservations.GetCheckReservationBySlotID()) this.Bord[x].Text = "V"; else { this.Bord[x].Text = "X"; this.Bord[x].Enabled = false; } return this.Bord[x]; }
protected void btnCampus_Click(object sender, EventArgs e) { this.lambdaCampus = new LambdaCampus(this.txtboxCampusPlaats.Text); this.lambdaCampus.SetCampusInsert(); Response.Redirect("AdminCampus.aspx"); }