public void btnRegister_Click(object sender, EventArgs e) { HEWDataContext context = new HEWDataContext(); if (context.Newsletters.Any(i => i.Email == txtMail.Text.Trim())) { return; } Newsletter newsletter = new Newsletter{Email = txtMail.Text.Trim()}; context.Newsletters.InsertOnSubmit(newsletter); context.SubmitChanges(); txtMail.Text = string.Empty; }
partial void UpdateNewsletter(Newsletter instance);
partial void DeleteNewsletter(Newsletter instance);
partial void InsertNewsletter(Newsletter instance);