Exemple #1
0
        private void lvPhong_Click(object sender, EventArgs e)
        {
            Room   data = new Room();
            string kv   = cbKV.SelectedValue.ToString();
            string tp   = lvPhong.SelectedItems[0].Text;
            string sql  = "SELECT MaPhong FROM Phong WHERE TenPhong=N'" + tp + "'AND MaKhuVuc='" + kv + "'";
            var    mp   = data.GetDataPhong(sql);

            PhongBUS listphong = new PhongBUS();
            string   maphong   = mp.Rows[0][0].ToString();
            string   sql1      = "SELECT p.TenPhong, lp.DonGia From Phong p, LoaiPhong lp WHERE p.MaPhong=N'" + maphong + "'AND p.MaLoaiPhong = lp.MaLoaiPhong";
            var      dsphong   = listphong.GetThongTinThuePhong(sql1);
            string   tenphong  = dsphong.Rows[0][0].ToString();
            string   gia       = string.Format("{0:#,##0}", Int32.Parse(dsphong.Rows[0][1].ToString()));

            lbMaPhong.Text  = maphong; lbMaPhong.ForeColor = Color.Red;
            lbTenPhong.Text = tenphong; lbTenPhong.ForeColor = Color.Red;
            lbGia.Text      = gia + " vnd"; lbGia.ForeColor = Color.Red;
        }