Ejemplo n.º 1
0
        private void cbxLoaiPhong_SelectedIndexChanged(object sender, EventArgs e)
        {
            string     loaiPhong = cbxLoaiPhong.GetItemText(cbxLoaiPhong.SelectedItem);
            RoomAccess data      = new RoomAccess();
            DataTable  dt        = new DataTable();

            dt = data.loadIDCost(loaiPhong);
            cbxMaPhong.DisplayMember   = "roomno";
            cbxMaPhong.DataSource      = dt;
            cbxtienPhong.DisplayMember = "price";
            cbxtienPhong.DataSource    = dt;
            txtCostPerDay.Text         = cbxtienPhong.GetItemText(cbxtienPhong.SelectedItem);
            cost = float.Parse(txtCostPerDay.Text);
            caculteMoney();
        }