public static bool InsertNewUsertoEmailList(tblEmail user)
 {
     var dc = new AlsiWebDataContext();
     var insert = (!dc.tblEmails.Any(z => z.Email == user.Email));
     if (insert)
     {
         user.Active = true;
         dc.tblEmails.InsertOnSubmit(user);
         dc.SubmitChanges();
         GetEmailList();
     }
     return insert;
 }
Esempio n. 2
0
 partial void DeletetblEmail(tblEmail instance);
Esempio n. 3
0
 partial void UpdatetblEmail(tblEmail instance);
Esempio n. 4
0
 partial void InserttblEmail(tblEmail instance);
        private void addEmailButton_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            var contat = new tblEmail ()
            {
                Name = name_EmailTextBox.Text.Trim(),
                Email = emailTextBox.Text.Trim(),
            };

            if (WebUpdate.InsertNewUsertoEmailList(contat))
            {
                PopulateEmailTab();
                emailTextBox.Clear();
                name_EmailTextBox.Clear();
                addEmailButton.Enabled = true;
            }
            else
            {
                MessageBox.Show("Email Already Exist");
            }
            Cursor = Cursors.Default;
        }
 partial void DeletetblEmail(tblEmail instance);
 partial void UpdatetblEmail(tblEmail instance);
 partial void InserttblEmail(tblEmail instance);