예제 #1
0
        void HienGhe(GiaVeCuaGhe giaVe)
        {
            tlpGhe.Controls.Clear();
            int count = 0;

            for (int i = 0; i < tlpGhe.RowCount; i++)
            {
                for (int j = 0; j < tlpGhe.ColumnCount; j++)
                {
                    Label lbGhe = new Label();

                    lbGhe.AutoSize  = false;
                    lbGhe.Dock      = DockStyle.Fill;
                    lbGhe.TextAlign = ContentAlignment.MiddleCenter;


                    lbGhe.BorderStyle = BorderStyle.FixedSingle;
                    lbGhe.Text        = GiaVeCuaGheList.GetAll(giaVe)[count].GheID;
                    #region Set Mau Ghe
                    if (GiaVeCuaGheList.GetAll(giaVe)[count].TrangThai == "chua")
                    {
                        lbGhe.BackColor = Color.White;
                    }
                    if (GiaVeCuaGheList.GetAll(giaVe)[count].TrangThai == "da")
                    {
                        lbGhe.BackColor = Color.Gray;
                    }
                    #endregion
                    lbGhe.Click += LbGhe_Click;
                    tlpGhe.Controls.Add(lbGhe, j, i);
                    count++;
                }
            }
        }
예제 #2
0
 void GiaTungLoaiGhe(GiaVeCuaGhe giaVe)
 {
     txtPhoThong.Text  = GiaVeCuaGheList.GetAll(giaVe)[0].GiaVe.ToString();
     txtVIP.Text       = GiaVeCuaGheList.GetAll(giaVe)[30].GiaVe.ToString();
     txtDeluxe.Text    = GiaVeCuaGheList.GetAll(giaVe)[60].GiaVe.ToString();
     txtSwitchBox.Text = GiaVeCuaGheList.GetAll(giaVe)[88].GiaVe.ToString();
 }
 protected void HienGiaVe()
 {
     try
     {
         txtPhoThong.Text  = GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[0].GiaVe.ToString();
         txtVIP.Text       = GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[30].GiaVe.ToString();
         txtDeluxe.Text    = GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[60].GiaVe.ToString();
         txtSwitchBox.Text = GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[88].GiaVe.ToString();
     }
     catch (Exception ex) { }
 }
        protected void rbSuat_Load(object sender, EventArgs e)
        {
            try
            {
                if (rbKhanDai.SelectedIndex != -1)
                {
                    int   count   = 0;
                    Table myTable = new Table();
                    for (int r = 0; r < 10; r++)
                    {
                        TableRow tableRow = new TableRow();
                        for (int c = 0; c < 9; c++)
                        {
                            TableCell cell = new TableCell();
                            Button    btn  = new Button();
                            btn.Text      = GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[count].GheID;
                            btn.Click    += new EventHandler(btn_Click);
                            btn.ForeColor = Color.White;
                            btn.Height    = 30;
                            btn.Width     = 30;
                            #region Set Mau Ghe

                            if (GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[count].TrangThai == "da")
                            {
                                btn.BackColor = System.Drawing.Color.Gray;
                                btn.Enabled   = false;
                            }
                            else
                            {
                                int dauSoGhe = Convert.ToInt32(GiaVeCuaGheList.GetAll(rblRap.SelectedValue, rbKhanDai.SelectedValue, cPickDate.SelectedDate, rbSuat.SelectedValue)[count].GheID.Substring(0, 1));
                                if (dauSoGhe < 3)
                                {
                                    btn.BackColor = System.Drawing.Color.FromArgb(64, 86, 141);
                                }
                                else if (dauSoGhe < 6)
                                {
                                    btn.BackColor = System.Drawing.Color.FromArgb(0, 132, 255);
                                }
                                else if (dauSoGhe < 9)
                                {
                                    btn.BackColor = System.Drawing.Color.FromArgb(254, 101, 80);
                                }
                                else if (dauSoGhe == 9)
                                {
                                    btn.BackColor = System.Drawing.Color.FromArgb(208, 67, 35);
                                }
                            }

                            #endregion
                            cell.Controls.Add(btn);
                            //Add the cell to the current row.
                            tableRow.Cells.Add(cell);

                            //    if (c == 5)
                            //    {
                            //        // This is the final column, add the row
                            //
                            //    }
                            count++;
                        }
                        myTable.Rows.Add(tableRow);
                    }
                    Label lbScreen = new Label();
                    lbScreen.Text      = "Screen";
                    lbScreen.BackColor = Color.Gold;
                    lbScreen.ForeColor = Color.White;
                    lbScreen.Width     = 270;
                    pnGhe.Controls.Add(lbScreen);
                    pnGhe.Controls.Add(myTable);
                }
            }
            catch (Exception ex) { }
        }