示例#1
0
 public void DeletePage(int id)
 {
     ModelContainer1 mc = new ModelContainer1();
     var page = (from x in mc.PageSet where x.Id == id select x).First();
     mc.PageSet.DeleteObject(page);
     mc.SaveChanges();
 }
示例#2
0
 public void CreatePage(string name)
 {
     ModelContainer1 mc = new ModelContainer1();
     var newPage = new Page();
     newPage.Name = name;
     newPage.Content = "<li class='editable'>Witaj na nowej stronie!</li>";
     mc.AddToPageSet(newPage);
     mc.SaveChanges();
 }
 public void CreatePage(string name)
 {
     ModelContainer1 mc = new ModelContainer1();
     var newPage = new Page();
     newPage.Name = name;
     newPage.Content = "<li class='editable'>Welcome to the new site!</li><li>&#160;</li>";
     mc.AddToPageSet(newPage);
     mc.SaveChanges();
 }
    public void AddMarker(int siteId, string markerX, string markerY, string comment)
    {
        ModelContainer1 mc = new ModelContainer1();
        var page = (from x in mc.PageSet where x.Id == siteId select x).First();
        page.Marker_x = markerX;
        page.Marker_y = markerY;
        page.Marker_comment = comment;

        mc.SaveChanges();
    }
示例#5
0
 public void UpdatePage(int id, string name)
 {
     ModelContainer1 mc = new ModelContainer1();
     var page = (from x in mc.PageSet where x.Id == id select x).First();
     page.Name = name;
     mc.SaveChanges();
 }
示例#6
0
 public void UpdateLogo(string html)
 {
     ModelContainer1 mc = new ModelContainer1();
     var page = (from x in mc.AllPagesSet select x).First();
     page.Logo = html;
     mc.SaveChanges();
 }
示例#7
0
    public void UpdateColor(int red, int green ,int blue)
    {
        ModelContainer1 mc = new ModelContainer1();
        var page = (from x in mc.AllPagesSet select x).First();
        page.ColorR = red;
        page.ColorG = green;
        page.ColorB = blue;

        mc.SaveChanges();
    }
示例#8
0
 public void SaveContent(string html, int id)
 {
     ModelContainer1 mc = new ModelContainer1();
     var page = (from x in mc.PageSet where x.Id == id select x).First();
     page.Content = html;
     mc.SaveChanges();
 }
    public void DeleteMarker(int siteId)
    {
        ModelContainer1 mc = new ModelContainer1();
        var page = (from x in mc.PageSet where x.Id == siteId select x).First();
        page.Marker_x = null;
        page.Marker_y = null;
        page.Marker_comment = null;

        mc.SaveChanges();
    }