예제 #1
0
 public void ClickReservationsDelete(int x)
 {
     this.Bord[x].Click += delegate(object s, EventArgs e)
     {
         this.lambdaReservations = new LambdaReservations(Convert.ToInt32(this.Bord[x].CommandName));
         if (lambdaReservations.GetCheckDatabaseRowID())
             lambdaReservations.SetDeleteReservationRowById();
     };
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.linqReservations = new LambdaReservations();
     this.linqReservations.GetReservationsByID();
     try
     {
         MessageBox.Show(HttpContext.Current.Session[SessionEnum.SessionNames.LecturorsID.ToString()].ToString());
     }
     catch { }
 }
        // 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)
         { }
     };
 }
        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 WriteReservationButton(int x, string stringID)
        {
            this.entity = new Entity();
            this.lambdaReservations = new LambdaReservations(entity.DB_Reservations.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;
            this.Bord[x].Text = stringID;
            return this.Bord[x];
        }
        public List<Slots.Slots> GetTableReservationsByLecturerID()
        {
            LambdaReservations linqReservations = new LambdaReservations();
            List<Reservations> listReservationByLecturerId = linqReservations.GetReservationsByID();
            List<Slots.Slots> listSlots = new Entity().DB_Slots;

            List<Slots.Slots> list = new List<Slots.Slots>();
            for (int i = 0; i < listReservationByLecturerId.Count; i++)
            {
                for (int j = i; j < listSlots.Count; j++)
                {
                    if (listReservationByLecturerId.ElementAt(i).SlotID.Equals(listSlots.ElementAt(j).ID))
                        list.Add(listSlots.ElementAt(j));
                }
            }
            return list;
        }
        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];
        }