Beispiel #1
0
        private void tsbThem_Click_1(object sender, EventArgs e)
        {
            Baohanh1 frm = new Baohanh1();

            frm.THEM = true;
            frm.MABH = DEM2.ToString();
            frm.ShowDialog();
            LoadDataTP();
        }
Beispiel #2
0
        private void tsbsua_Click_1(object sender, EventArgs e)
        {
            Baohanh1 frm = new Baohanh1();

            frm.THEM = false;
            if (DEM1 == 0)
            {
                MessageBox.Show("Bạn chưa chọn bao hành để cập nhật thông tin", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                frm.MABH = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MABAOHANH").ToString();
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "TENKH") != null)
                {
                    frm.TENKH = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "TENKH").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "NGAYNHAN") != null)
                {
                    frm.NGAYNHAN = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "NGAYNHAN").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "NGAYTRADK") != null)
                {
                    frm.NGAYTRA = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "NGAYTRADK").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "YECAU") != null)
                {
                    frm.YEUCAU = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "YECAU").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "GHICHU") != null)
                {
                    frm.GHICHHU = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "GHICHU").ToString();
                }
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "DIENTHOAI") != null)
                {
                    frm.DIENTHOAI = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "DIENTHOAI").ToString();
                }
                frm.MAMH = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MAMH").ToString();
                frm.MANV = gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "MANV").ToString();
                if (gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "DATRA") != null)
                {
                    frm.DATRA = bool.Parse(gridView2.GetRowCellValue(gridView2.FocusedRowHandle, "DATRA").ToString());
                }
                frm.ShowDialog();
            }
            LoadDataTP();
        }