private void btn_Save_Employee_Click(object sender, EventArgs e) { BLEmployee blE = new BLEmployee(); if (SaveStatus == 1) { blE.CreateEmployee(txt_Employee_EmployeeName.Text, txt_Employee_EmployeeTypeID.Text, txt_Employee_PhoneNumber.Text, txt_Employee_IdentityCard.Text, txt_Employee_PassWord.Text); } else if (SaveStatus == 2) { blE.UpdateEmployee(Convert.ToInt32(txt_Employee_EmployeeID.Text), txt_Employee_EmployeeName.Text, txt_Employee_EmployeeTypeID.Text, txt_Employee_PhoneNumber.Text, txt_Employee_IdentityCard.Text, txt_Employee_PassWord.Text); } SaveStatus = 0; dgv_Employee.DataSource = blE.LoadEmployee(); dgv_Employee_CellClick(null, null); btn_Update_Employee.Enabled = true; btn_Create_Employee.Enabled = true; btn_Save_Employee.Enabled = false; }
private void btn_Delete_Employee_Click(object sender, EventArgs e) { BLEmployee blE = new BLEmployee(); blE.DeleteEmployee(Convert.ToInt32(txt_Employee_EmployeeID.Text)); dgv_Employee.DataSource = blE.LoadEmployee(); dgv_Employee_CellClick(null, null); }
private void btn_Employee_Click(object sender, EventArgs e) { TabControl_Main.TabPages.Clear(); TabControl_Main.TabPages.Add(TabPage_Employee); dgv_Employee.AutoResizeColumns(); BLEmployee dbE = new BLEmployee(); var data = dbE.LoadEmployee(); if (data != null) { dgv_Employee.DataSource = data; } else { dgv_Employee.DataSource = null; } dgv_Employee_CellClick(null, null); txt_Employee_EmployeeID.Enabled = false; }