コード例 #1
0
        private void barButtonItemAddGiaoDich_ItemClick(object sender, ItemClickEventArgs e)
        {
            int indexMaGiaoDich = GetNewCode(6, "MAGD");
            RibbonFormAddGiaoDich addGiaoDich = new RibbonFormAddGiaoDich(false, addDataSetGiaoDich, editDataSet, quanLiTiemNet.Tables[6].NewRow(), ref gridView7, indexMaGiaoDich, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);

            addGiaoDich.Show();
        }
コード例 #2
0
        private void editDataSet(GridView gridView)
        {
            int rowHandle = gridView.FocusedRowHandle;

            if (gridView == gridView1)
            {
                RibbonFormAddNhanVien editNhanVien = new RibbonFormAddNhanVien(true, addDataSetNhanVien, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, barButtonItemDelete_ItemClick, GetNewDataRow);
                editNhanVien.Show();
                //SaveDatabase(ref gridView);
            }
            else if (gridView == gridView2)
            {
                int indexMaNguoiDung = (int)gridView.GetDataRow(gridView.GetSelectedRows()[0])["MANGUOIDUNG"];
                RibbonFormAddNguoiDung editNguoiDung = new RibbonFormAddNguoiDung(true, addDataSetNguoiDung, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, indexMaNguoiDung, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);
                editNguoiDung.Show();
                //SaveDatabase(ref gridView);
            }
            else if (gridView == gridView3)
            {
                int indexMaTaiKhoan = (int)gridView.GetDataRow(gridView.GetSelectedRows()[0])["MATK"];
                RibbonFormAddTaiKhoan editTaiKhoan = new RibbonFormAddTaiKhoan(true, addDataSetTaiKhoan, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, indexMaTaiKhoan, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);
                editTaiKhoan.Show();
                //SaveDatabase(ref gridView);
            }
            else if (gridView == gridView4)
            {
                int indexMaMay           = (int)gridView.GetDataRow(gridView.GetSelectedRows()[0])["MAMAY"];
                RibbonFormAddMay editMay = new RibbonFormAddMay(true, addDataSetMay, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, indexMaMay, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);
                editMay.Show();
                //SaveDatabase(ref gridView);
            }
            else if (gridView == gridView5)
            {
                int indeThietBi = (int)gridView.GetDataRow(gridView.GetSelectedRows()[0])["MATHIETBI"];
                RibbonFormAddThietBi editThietBi = new RibbonFormAddThietBi(true, addDataSetThietBi, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, indeThietBi, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);
                editThietBi.Show();
                //SaveDatabase(ref gridView);
            }
            else if (gridView == gridView6)
            {
                int indexMaPhong             = (int)gridView.GetDataRow(gridView.GetSelectedRows()[0])["MAPHONG"];
                RibbonFormAddPhong editPhong = new RibbonFormAddPhong(true, addDataSetPhong, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, indexMaPhong, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);
                editPhong.Show();
                //SaveDatabase(ref gridView);
            }
            else if (gridView == gridView7)
            {
                int indexMaGiaoDich = (int)gridView.GetDataRow(gridView.GetSelectedRows()[0])["MAGD"];
                RibbonFormAddGiaoDich editGiaoDich = new RibbonFormAddGiaoDich(true, addDataSetGiaoDich, editDataSet, gridView.GetDataRow(gridView.GetSelectedRows()[0]), ref gridView, indexMaGiaoDich, barButtonItemDelete_ItemClick, GetNewDataRow, GetNewCode);
                editGiaoDich.Show();
                //SaveDatabase(ref gridView);
            }
        }