public void ShoeData() { using (DBtestWEBDataContext ctx = new DBtestWEBDataContext()) try { UserN objCourse = new UserN(); objCourse.Name = txt_Name.Text; objCourse.Email = txt_Email.Text; objCourse.Telephon = txt_Tel.Text; objCourse.Team_id = ddl_City.Text.FirstOrDefault(); objCourse.City_id = ddl_City.Text.FirstOrDefault(); objCourse.Position_id = ddl_Position.Text.FirstOrDefault(); objCourse.Date = DateTime.Now; ctx.GetTable <UserN>().InsertOnSubmit(objCourse); ctx.SubmitChanges(); } catch (Exception e) { Console.WriteLine(e.Message); } }
private void LodIn(object sender, RoutedEventArgs e) { try { if (bl1.FindUser(Password1.Password, UserN.Text)) { LineDisplay lineDisplay = new LineDisplay(bl1); lineDisplay.Show(); Close(); } } catch (BO.BOExceptionUser ex) { _ = MessageBox.Show("One of the details you entered is incorrect!!! try again" + ex); UserN.ClearValue(TextBox.TextProperty); } }