예제 #1
0
    public IQueryable<Mailing_list> getMailing_list()
    {
        mailingListDataContext objmailDC = new mailingListDataContext();
        var allmails = objmailDC.Mailing_lists.Select(x => x);
        return allmails;

    }
예제 #2
0
 public bool commitDelete(int _id)
 {
     mailingListDataContext objmailDC = new mailingListDataContext();
     using (objmailDC)
     {
         var objDelMail = objmailDC.Mailing_lists.Single(x => x.Id == _id);
         objmailDC.Mailing_lists.DeleteOnSubmit(objDelMail);
         objmailDC.SubmitChanges();
         return true;
     }
 }
예제 #3
0
 public bool commitUpdate(int _id, string _fname, string _lname, string _email)
 {
     mailingListDataContext objmailDC = new mailingListDataContext();
     using (objmailDC)
     {
         var objUpMail = objmailDC.Mailing_lists.Single(x => x.Id == _id);
         objUpMail.firstname = _fname;
         objUpMail.lastname = _lname;
         objUpMail.email = _email;
         objmailDC.SubmitChanges();
         return true;
     }
 }
예제 #4
0
    protected void subAddSubscriber(object sender, CommandEventArgs e)
    {
        mailingListDataContext objmailDC = new mailingListDataContext();
        Mailing_list objNewMail = new Mailing_list();
        objNewMail.firstname = txt_fname.Text;
        objNewMail.lastname = txt_lname.Text;
        objNewMail.email = txt_email.Text;

        objmailDC.Mailing_lists.InsertOnSubmit(objNewMail);
        objmailDC.SubmitChanges();
        txt_fname.Text = "";
        txt_lname.Text = "";
        txt_email.Text = "";
        lbl_thankYou.Text = "Thank you for subscribing!";
    }
예제 #5
0
    public bool commitInsert(string _fname, string _lname, string _email)
    {
        mailingListDataContext objmailDC = new mailingListDataContext();
        using (objmailDC)
        {
            Mailing_list objNewMail = new Mailing_list();
            objNewMail.firstname = _fname;
            objNewMail.lastname = _lname;
            objNewMail.email = _email;

            objmailDC.Mailing_lists.InsertOnSubmit(objNewMail);
            objmailDC.SubmitChanges();
            return true;

        }


    }
예제 #6
0
 public IQueryable<Mailing_list> getMailing_listByID(int _id)
 {
     mailingListDataContext objmailDC = new mailingListDataContext();
     var allmails = objmailDC.Mailing_lists.Where(x => x.Id == _id).Select(x => x);
     return allmails;
 }