Beispiel #1
0
    protected void NoticeBtn_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();

        Notices_tbl nt = new Notices_tbl {
            Notice = NoticeMsg.Text, NoticeType = NoticTypeList.SelectedItem.ToString()
        };

        db.addNotice(nt);
        Response.Redirect("AddNotices.aspx");
    }
 public void addNotice(Notices_tbl nttable)
 {
     using (db = new CollegeERPDBEntities())
     {
         db.Notices_tbl.Add(nttable);
         db.SaveChanges();
     }
 }
    protected void NoticeBtn_Click(object sender, EventArgs e)
    {
        DBFunctions db = new DBFunctions();

        Notices_tbl nt = new Notices_tbl { Notice = NoticeMsg.Text, NoticeType = NoticTypeList.SelectedItem.ToString() };
        db.addNotice(nt);
        Response.Redirect("AddNotices.aspx");
    }