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;
 }
示例#2
0
 partial void DeletetblEmail(tblEmail instance);
示例#3
0
 partial void UpdatetblEmail(tblEmail instance);
示例#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);