コード例 #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Diablog_NCC d = new Diablog_NCC();

            d.ShowDialog();
            View();
        }
コード例 #2
0
        private void DataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string           id;
            NhaCungCapNCCBUS bus = new NhaCungCapNCCBUS();

            if (DataGrid.Columns[e.ColumnIndex].Name == "Sua")
            {
                id = DataGrid.Rows[e.RowIndex].Cells["MaNCC"].Value.ToString();
                //MessageBox.Show(dataGrid.Rows[e.RowIndex].Cells["Id"].Value.ToString());
                Diablog_NCC d = new Diablog_NCC(id);
                d.ShowDialog(this);
                View();
            }
            if (DataGrid.Columns[e.ColumnIndex].Name == "Xoa")
            {
                id = DataGrid.Rows[e.RowIndex].Cells["MaNCC"].Value.ToString();
                bus.Delete(id);
                View();
            }
        }