protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         LambdaSlots lambdaSlots = new LambdaSlots(int.Parse(txtboxID.Text));
         lambdaSlots.SetDeleteSlotRowById();
         HttpContext.Current.Response.Redirect("AdminMain.aspx");
     }
     catch (Exception)
     {
         LblError.Visible = true;
         txtboxID.Text = "";
     }
 }
        // Reserved is weg, dus deze code aanpassen!
        protected void btnAddSlot_Click(object sender, EventArgs e)
        {
            try
              {
              this.lambdaSlots = new LambdaSlots(this.txtboxDate.Text, this.txtboxStart.Text, this.txtboxEnd.Text, this.txtboxDuration.Text, int.Parse(this.txtboxCapacity.Text), this.RadioButtonList1.SelectedIndex, this.DropDownList1.SelectedItem.Value);
              this.lambdaSlots.SetDataInsert();
              Response.Redirect("AdminSlots.aspx");

              }
              catch (Exception)
              {
              errorLbl.Visible = true;
              }
        }
        // For Deleting Slots In Reservation Page.
        public void ClickReservationsDelete(int x)
        {
            this.Bord[x].Click += delegate(object s, EventArgs e)
            {
                this.lambdaReservations = new LambdaReservations(Convert.ToInt32(this.Bord[x].CommandName));
                this.lambdaSlots = new LambdaSlots(this.lambdaReservations.Id);
                HttpContext.Current.Session.Add(SessionEnum.SessionNames.SlotsID.ToString(), Convert.ToInt32(this.Bord[x].CommandName));

                while (lambdaReservations.GetCheckReservationId())
                {
                    lambdaReservations.SetDeleteReservationRowById();
                    this.lambdaSlots.SetSlotsUpdateDataCountUp();
                }
                HttpContext.Current.Response.Redirect(RESERVATION_PAGE);
            };
        }
 public void ClickSlots(int x)
 {
     this.Bord[x].Click += delegate(object s, EventArgs ex)
     {
         try
         {
             HttpContext.Current.Session.Add(SessionEnum.SessionNames.SlotsID.ToString(), Convert.ToInt32(this.Bord[x].CommandName));
             lambdaSlots = new LambdaSlots(Convert.ToInt32(this.Bord[x].CommandName));
             lambdaSlots.SetSlotsUpdateDataCountDown();
             lambdaReservations = new LambdaReservations();
             lambdaReservations.SetReservationInsertData();
             HttpContext.Current.Response.Redirect(SLOT_PAGE);
         }
         catch (Exception e)
         { }
     };
 }
Beispiel #5
0
        public System.Web.UI.WebControls.Button WriteButton(int x, string stringID)
        {
            this.entity = new Entity();
            lambdaSlots = new LambdaSlots(entity.DB_Slots.ElementAt(x).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.GetControlCapatity())
                this.Bord[x].Text = "V";
            else
            {
                this.Bord[x].Text = "x";
                this.Bord[x].Enabled = false;
            }

            return this.Bord[x];
        }
        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];
        }
        public System.Web.UI.WebControls.Button WriteButton(int x, string stringID)
        {
            this.entity = new Entity();
            this.lambdaSlots = new LambdaSlots(entity.DB_Slots.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 = stringID;
            else
            {
                this.Bord[x].Text = "x";
                this.Bord[x].Enabled = false;
            }
            return this.Bord[x];
        }
 protected void btnAddSlot_Click(object sender, EventArgs e)
 {
     this.lambdaSlots = new LambdaSlots(this.txtboxDate.Text, this.txtboxStart.Text, this.txtboxEnd.Text, this.txtboxDuration.Text, int.Parse(this.txtboxCapacity.Text), int.Parse(this.txtboxReserved.Text), byte.Parse(this.RadioButtonList1.SelectedItem.Value, System.Globalization.NumberStyles.AllowDecimalPoint),this.DropDownList1.SelectedItem.Value);
     this.lambdaSlots.SetDataInsert();
     Response.Redirect("AdminSlots.aspx");
 }