Esempio n. 1
0
    private void SaveToDB_Update(Guid eventId)
    {
        using (var context = new WoodlandLifeEntities())
        {
            var _event = context.Events.First(e => e.EventID == eventId);
            _event.Date    = oDate.Date.Value.Value;
            _event.Title   = oTitle.Text;
            _event.Content = oContentHtml.Text;

            context.SaveChanges();
        }
    }
Esempio n. 2
0
    protected void oDelete_Click(object sender, EventArgs e)
    {
        if (EventId.HasValue)
        {
            using (var context = new WoodlandLifeEntities())
            {
                context.DeleteObject(context.Events.First(ev => ev.EventID == EventId.Value));
                context.SaveChanges();
            }
        }

        //Reload the page to refresh data.
        ReloadPage();
    }
Esempio n. 3
0
    private void SaveToDB_New()
    {
        using (var context = new WoodlandLifeEntities())
        {
            var _event = new Event();
            _event.EventID = Guid.NewGuid();
            _event.Date    = oDate.Date.Value.Value;
            _event.Title   = oTitle.Text;
            _event.Content = oContentHtml.Text;

            context.AddToEvents(_event);
            context.SaveChanges();
        }
    }
Esempio n. 4
0
    protected void oDelete_Click(object sender, EventArgs e)
    {
        if (EventId.HasValue)
        {
            using (var context = new WoodlandLifeEntities())
            {
                context.DeleteObject(context.Events.First(ev => ev.EventID == EventId.Value));
                context.SaveChanges();
            }
        }

        //Reload the page to refresh data.
        ReloadPage();
    }
Esempio n. 5
0
    private void SaveToDB_New()
    {
        using (var context = new WoodlandLifeEntities())
        {
            var _event = new Event();
            _event.EventID = Guid.NewGuid();
            _event.Date = oDate.Date.Value.Value;
            _event.Title = oTitle.Text;
            _event.Content = oContentHtml.Text;

            context.AddToEvents(_event);
            context.SaveChanges();
        }
    }
Esempio n. 6
0
    private void SaveToDB_Update(Guid eventId)
    {
        using (var context = new WoodlandLifeEntities())
        {
            var _event = context.Events.First(e => e.EventID == eventId);
            _event.Date = oDate.Date.Value.Value;
            _event.Title = oTitle.Text;
            _event.Content = oContentHtml.Text;

            context.SaveChanges();
        }
    }