private void btnInhoadon_Click(object sender, EventArgs e)
        {
            if (dataGridView2.SelectedRows.Count == 0)
            {
                return;
            }
            string        maHD = dataGridView2.Rows[dataGridView2.CurrentCell.RowIndex].Cells[1].Value.ToString();
            fBaoCaoHoaDon fm   = new fBaoCaoHoaDon();

            if (dataGridView2.SelectedRows.Count == 1)
            {
                fm.funData = maHD;
            }
            else
            {
                List <string> lst = new List <string>();
                foreach (DataGridViewRow item in dataGridView2.Rows)
                {
                    if (item.Selected)
                    {
                        lst.Add(item.Cells[1].Value.ToString());
                    }
                }
                fm.LISTMAHD = lst;
            }
            fm.ShowDialog();
            fm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
            fm.EnableInhoadon(true);
        }
Exemple #2
0
        private void Nut_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Clicks == 2)
            {
                fBaoCaoHoaDon fm = new fBaoCaoHoaDon();
                fm.MaPH = ((sender as Button).Tag as Phong).MA;

                fm.ShowDialog();
                LoadDanhSach();
            }
        }
        private void dataGridView2_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                return;
            }

            string        maHD = dataGridView2.Rows[e.RowIndex].Cells[1].Value.ToString();
            fBaoCaoHoaDon fm   = new fBaoCaoHoaDon();

            fm.funData = maHD;

            fm.ShowDialog();
        }