public static LeadPagesVM SetSubdata(LeadPages model, Guid api) { var data = LeadPagesVM.MToVM(model); data.BackgroundImage = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(model.BackgroundImageID, model.ID, api)); data.MainImage = ImageLinkStorageVM.MToVM(ImageLinkStorageService.GetByID(model.MainImageID, model.ID, api)); data.TemplateDesign = StatusTypesReferencesVM.MToVM(StatusTypesReferencesService.GetByID(model.TemplateDesignID)); return(data); }
public static bool Insert(Guid id, string title, string desc, Guid oid, Guid bgid, Guid mid, Guid tdid) { try { using (var context = new CentralProcessContext()) { var data = LeadPagesVM.set(id, title, desc, oid, bgid, mid, tdid); context.LeadPagesDB.Add(data); context.SaveChanges(); return(true); } } catch { return(false); } }