private void employeeToolStripMenuItem_Click(object sender, EventArgs e) { EmployeeListForm employeeListForm = new EmployeeListForm(); employeeListForm.MdiParent = this; employeeListForm.Show(); }
private void buttonSav_Click(object sender, EventArgs e) { EmployeeDataLogic employeeDataLogic = new EmployeeDataLogic(); EmployeeName = textBoxName.Text.Trim(); Contact = textBoxCont.Text.Trim(); Email = textBoxGmail.Text.Trim(); RoleId = textBoxID.Text.Trim(); UserName = textBoxUsernam.Text.Trim(); Password = textBoxPass.Text.Trim(); PasswordSalt = textBoxPassSalt.Text.Trim(); CreateDate = textBoxCreateDate.Text.Trim(); string isactive = comboBoxActive.SelectedValue.ToString(); IsActive = isactive == "0" ? false : true; string approval = comboBoxApprove.SelectedValue.ToString(); IsApproved = approval == "0" ? false : true; string isLockedOut = comboBoxLocked.SelectedValue.ToString(); IsLockedOut = isLockedOut == "0" ? false : true; bool result = employeeDataLogic.AddEmployee(EmployeeName, Contact, Email, RoleId, IsActive, UserName, Password, PasswordSalt, CreateDate, IsApproved, IsLockedOut, SystemGenerate); if (result == true) { MessageBox.Show("Success!"); EmployeeListForm employeeListForm = new EmployeeListForm(); this.Hide(); employeeListForm.Show(); } else { MessageBox.Show("Error!"); } }