private void UempInsert_Click(object sender, RoutedEventArgs e) { Entities1 entity = new Entities1(); try { User t = new User(); t.UserName = txtname.Text; t.FirstName = txtfirstname.Text; t.LastName = txtlastname.Text; t.Pass = txtpassword.Password; Admin_BAL obj = new Admin_BAL(); obj.insert_Employee(t); MessageBoxResult result = MessageBox.Show(this, "Employee " + t.UserName + " Registered Successfully", "Information", MessageBoxButton.OK, MessageBoxImage.Information); loademp(); txtname.Clear(); txtfirstname.Clear(); txtlastname.Clear(); txtpassword.Clear(); } catch (Exception ex) { MessageBoxResult result = MessageBox.Show(this, "" + ex.Message + "", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning); } }
protected void Unnamed9_Click(object sender, EventArgs e) { Entities1 entity = new Entities1(); try { User t = new User(); t.UserName = UserName.Text; t.FirstName = FirstName.Text; t.LastName = LastName.Text; t.Pass = Password.Text; Admin_BAL obj = new Admin_BAL(); obj.insert_Employee(t); Response.Write("<script type = 'text/javascript'>alert('Inserted successfully')</script>"); UserName.Text = ""; FirstName.Text = ""; LastName.Text = ""; Password.Text = ""; } catch (Exception ex) { throw ex; } }