private void empsave_Click(object sender, RoutedEventArgs e) { // INSERT : CODE try { if (firstt.Text == "" || lastt.Text == "" || nationalityt.Text == "" || addresst.Text == "" || emailt.Text == "" || departt.Text == "" || positiont.Text == "" || feildt.Text == "" || mobilet.Text == "0") { MessageBox.Show("Don't Leave Any TextBox Empty !"); } else { var d = new airlinqDataContext(); var c = new employeedb(); c.first = firstt.Text; c.last = lastt.Text; c.gender = gendercombo.SelectedValue.ToString(); c.nationality = nationalityt.Text; c.joining = datet.SelectedDate; c.mobile = mobilet.Text; c.address = addresst.Text; c.email = emailt.Text; c.department = departt.Text; c.position = positiont.Text; c.field = feildt.Text; d.employeedbs.InsertOnSubmit(c); d.SubmitChanges(); firstt.Text = ""; lastt.Text = ""; nationalityt.Text = ""; addresst.Text = ""; emailt.Text = ""; departt.Text = ""; positiont.Text = ""; feildt.Text = ""; mobilet.Text = "0"; MessageBox.Show("Inserted Successfully"); } // else closing } catch { MessageBox.Show("Issue With Database Handling ! Contact Database Administrator"); } }
partial void Updateemployeedb(employeedb instance);
partial void Deleteemployeedb(employeedb instance);
partial void Insertemployeedb(employeedb instance);