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

            frm.THEM    = true;
            frm.MAMH    = DEM2.ToString();
            frm.SOLUONG = "0";
            frm.ShowDialog();
            LoadData();
        }
Beispiel #2
0
        private void tsbsua_Click(object sender, EventArgs e)
        {
            MatHang1 frm = new MatHang1();

            frm.THEM = false;
            if (DEM1 == 0)
            {
                MessageBox.Show("Bạn chưa chọn mặt hàng để cập nhật thông tin mới.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("MAMH")) != null)
                {
                    frm.MAMH = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("MAMH")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("SOLUONG")) != null)
                {
                    frm.SOLUONG = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("SOLUONG")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("DONVITINH")) != null)
                {
                    frm.DONVITINH = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("DONVITINH")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("TENMH")) != null)
                {
                    frm.TENMH = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("TENMH")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("HANGSX")) != null)
                {
                    frm.HANGSX = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("HANGSX")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("MAKM")) != null)
                {
                    frm.KHUYENMAI = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("MAKM")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("DACDIEM")) != null)
                {
                    frm.DACDIEM = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("DACDIEM")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("GIAMUA")) != null)
                {
                    frm.GIAMUA = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("GIAMUA")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("GIABAN")) != null)
                {
                    frm.GIABAN = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("GIABAN")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("LOAIMH")) != null)
                {
                    frm.LOAIMH = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("LOAIMH")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("GHICHU")) != null)
                {
                    frm.GHICHU = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("GHICHU")).ToString();
                }
                if (gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("BAOHANH")) != null)
                {
                    frm.BAOHANH = int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, ("BAOHANH")).ToString());
                }

                frm.ShowDialog();
            }
            LoadData();
        }