private void button9_Click_1(object sender, EventArgs c) { Uri uri = new Uri(textBox3.Text); string host = uri.Host; using (DataClassesMatchDataContext match = new DataClassesMatchDataContext()) { var eUri = match.match_table_xpath.Where(e => e.uri_host == host).FirstOrDefault(); if (eUri == null) { match_table_xpath nUri = new match_table_xpath(); nUri.uri_host = host.ToString(); nUri.max_table_xpath = textBox4.Text; nUri.second_table_xpath = textBox6.Text; nUri.max_table_id_value = textBox7.Text; nUri.second_table_id_value = textBox8.Text; match.match_table_xpath.InsertOnSubmit(nUri); } else { eUri.uri_host = host.ToString(); eUri.max_table_xpath = textBox4.Text; eUri.second_table_xpath = textBox6.Text; eUri.max_table_id_value = textBox7.Text; eUri.second_table_id_value = textBox8.Text; //match.match_table_xpath.InsertOnSubmit(eUri); } match.SubmitChanges(); } MessageBox.Show("OK"); }
partial void Updatematch_table_xpath(match_table_xpath instance);
partial void Deletematch_table_xpath(match_table_xpath instance);
partial void Insertmatch_table_xpath(match_table_xpath instance);