private Storage.Theme duptheme(int themeId) { Storage.Theme theme = sto.getEntityByID <Storage.Theme>(themeId); if (theme == null) { return(null); } Storage.Theme result = sto.addTheme(userId, theme.themeTitle, theme.CSS, Image.FromStream(new MemoryStream(theme.logo.ToArray()))); Storage.Publication pub = sto.getEntityByID <Storage.Publication>(publicationId); if (result != null && pub != null) { this.themeId = result.themeID; pub.themeID = result.themeID; if (sto.commit()) { return(result); } else { return(null); } } else { return(null); } }
private Storage.Theme duptheme(int themeId) { Storage.Theme theme = sto.getEntityByID <Storage.Theme>(themeId); if (theme == null) { return(null); } Storage.Theme result = sto.addTheme(userId, theme.themeTitle, theme.CSS, Image.FromStream(new MemoryStream(theme.logo.ToArray()))); Storage.Model mod = sto.getEntityByID <Storage.Model>(modelId); if (result != null && mod != null) { this.themeId = result.themeID; mod.themeID = result.themeID; if (sto.commit()) { return(result); } else { return(null); } } else { return(null); } }
public Theme GetTheme() { if (!complete) { fillReference(); } // Take current theme Storage.Theme stotheme = sto.getEntityByID <Storage.Theme>(themeId); if (stotheme == null) { return(null); } Security.Theme newtheme = new Theme(stotheme.themeTitle, System.Drawing.Image.FromStream(new MemoryStream(stotheme.logo.ToArray())), stotheme.CSS); return(newtheme); }