private void btn_Delete_EmployeeType_Click(object sender, EventArgs e) { BLEmployeeType blET = new BLEmployeeType(); blET.DeleteEmployeeType(txt_EmployeeType_EmployeeTypeID.Text); dgv_EmployeeType.DataSource = blET.LoadEmployeeType(); dgv_EmployeeType_CellClick(null, null); }
private void btn_Save_EmployeeType_Click(object sender, EventArgs e) { BLEmployeeType blET = new BLEmployeeType(); if (SaveStatus == 1) { blET.CreateEmployeeType(txt_EmployeeType_EmployeeTypeName.Text); } else if (SaveStatus == 2) { blET.UpdateEmployeeType(Convert.ToInt32(txt_EmployeeType_EmployeeTypeID.Text), txt_EmployeeType_EmployeeTypeName.Text); } SaveStatus = 0; dgv_EmployeeType.DataSource = blET.LoadEmployeeType(); dgv_EmployeeType_CellClick(null, null); btn_Update_EmployeeType.Enabled = true; btn_Create_EmployeeType.Enabled = true; btn_Save_EmployeeType.Enabled = false; }
private void btn_EmployeeType_Click(object sender, EventArgs e) { TabControl_Main.TabPages.Clear(); TabControl_Main.TabPages.Add(TabPage_EmployeeType); dgv_EmployeeType.AutoResizeColumns(); BLEmployeeType dbB = new BLEmployeeType(); var data = dbB.LoadEmployeeType(); if (data != null) { dgv_EmployeeType.DataSource = data; } else { dgv_EmployeeType.DataSource = null; } dgv_EmployeeType_CellClick(null, null); txt_EmployeeType_EmployeeTypeID.Enabled = false; }