public void LoadRoom()
        {
            this.label_currentUser.Text = fs.getUsername();
            this.panel_moreInfo.Visible = false;
            flowLayoutPanel1.Controls.OfType <Button>().ToList().ForEach(btn => btn.Dispose());
            FirebaseResponse           response = client.Get("Rooms/");
            IDictionary <string, Room> rList    = JsonConvert.DeserializeObject <IDictionary <string, Room> >(response.Body);

            foreach (var r in rList)
            {
                Button btn = new Button()
                {
                    Width = roomDAO.width, Height = roomDAO.height
                };


                flowLayoutPanel1.Controls.Add(btn);
                btn.Text   = "Phòng " + r.Key.ToString() + "\n\n" + r.Value.status.ToString();
                btn.Click += btn_Click;
                btn.Tag    = r.Key.ToString();
                rID        = btn.Tag.ToString();
                switch (r.Value.status)
                {
                case "Trống":
                    btn.BackColor = Color.Aqua;
                    break;

                case "Đã đặt":
                    btn.BackColor = Color.DarkGray;
                    break;

                default:
                    btn.BackColor = Color.AntiqueWhite;
                    break;
                }
            }
        }
示例#2
0
        private BlackList blackList()
        {
            BlackList listOfBadCustomer = new BlackList()
            {
                IdentityId  = this.textBox_identityId.Text,
                Name        = this.textBox_customerName.Text,
                Address     = this.textBox_address.Text,
                Nationality = this.textBox_nationality.Text,
                PhoneNum    = this.textBox_phoneNumber.Text,
                Note        = this.textBox_note.Text,
                AddedBy     = fs.getUsername()
            };

            return(listOfBadCustomer);
        }