Exemplo n.º 1
0
        private void btnDKthue_Click(object sender, EventArgs e)
        {
            string       filePath  = Application.StartupPath + @"/Phong/" + TenPhong + ".txt";
            StreamWriter wr        = new StreamWriter(filePath);
            string       valueFile = "";

            for (int j = 0; j < lvDSDV.Items.Count; j++)
            {
                ListViewItem lvDV = lvDSDV.Items[j];

                valueFile += lvDV.SubItems[2].Text + "|";
            }
            valueFile += "\n";
            for (int i = 0; i < lvDSKH.Items.Count; i++)
            {
                ListViewItem lvItem = lvDSKH.Items[i];

                valueFile += lvItem.SubItems[0].Text + "|";
                valueFile += lvItem.SubItems[1].Text + "|";
                valueFile += lvItem.SubItems[2].Text + "|";
                valueFile += lvItem.SubItems[3].Text + "|";
                valueFile += lvItem.SubItems[4].Text + "|";
                valueFile += lvItem.SubItems[5].Text + "|";
                valueFile += lvItem.SubItems[6].Text + "|";


                wr.WriteLine(valueFile);
            }
            wr.Flush();
            wr.Close();
            DaDangKy(true);
            btnDKthue.Enabled    = false;
            btnThanhToan.Enabled = true;
            frmDangki f = new frmDangki();
        }
        private void btnPhong102_Click(object sender, EventArgs e)
        {
            f = new frmDangki();
            f.Show();
            gttp = new GetTenPhong(f.getTenPhong);
            gttp(btnPhong102.Text);

            TenPhong   = btnPhong102.Text;
            Phong      = btnPhong102;
            f.DaDangKy = DangKyPhong;
        }