/// <summary> /// Tab==0:thêm KTKL /// Tab==1:thêm KTKL cho NV /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btadd_Click(object sender, EventArgs e) { if (tabc.SelectedTab == tabc.TabPages[0]) { rad = new AddRAD(); rad.ShowDialog(); createtableKTKL(); } else { DataTable dtb = (DataTable)dtgKTKL.DataSource; radNV = new RADEmp(dtb); radNV.ShowDialog(); createNVKTKL(); } }
/// <summary> /// Sửa KTKL /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btedit_Click(object sender, EventArgs e) { KTKLDTO KT = new KTKLDTO(); DataGridViewRow row = dtgKTKL.CurrentRow; if (row != null) { KT.ID = Int32.Parse(row.Cells["ID KTKL"].Value.ToString()); KT.Money = Int32.Parse(row.Cells["Số tiền"].Value.ToString()); KT.Name = row.Cells["Tên KTKL"].Value.ToString(); KT.HT = row.Cells["Hình thức"].Value.ToString(); rad = new AddRAD(); rad.KTKL = KT; rad.ShowDialog(); createtableKTKL(); } }