Beispiel #1
0
        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");
            }
        }
Beispiel #2
0
 partial void Updateemployeedb(employeedb instance);
Beispiel #3
0
 partial void Deleteemployeedb(employeedb instance);
Beispiel #4
0
 partial void Insertemployeedb(employeedb instance);