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); } }