/// <summary> /// Добавляет новый сайт /// </summary> /// <param name="site">информация о сайте</param> /// <returns>информация о сайте</returns> internal static Site Save(Site site) { using (var scope = new QPConnectionScope()) { if (QPContext.DatabaseType == DatabaseType.SqlServer) { ChangeInsertAccessTriggerState(false); ChangeInsertDefaultTriggerState(false); DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.Site, site); } var fieldValues = site.QpPluginFieldValues; var result = DefaultRepository.Save <Site, SiteDAL>(site); CommonSecurity.CreateSiteAccess(scope.DbConnection, result.Id); CreateDefaultStatuses(result); CreateDefaultNotificationTemplate(result); CreateDefaultGroup(result); UpdatePluginValues(fieldValues, result.Id); if (QPContext.DatabaseType == DatabaseType.SqlServer) { DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.Site); ChangeInsertAccessTriggerState(true); ChangeInsertDefaultTriggerState(true); } return(result); } }
internal static Field Save(Field item) { DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.Field, item); var newItem = DefaultRepository.Save <Field, FieldDAL>(item); DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.Field); return(newItem); }
/// <summary> /// Добавляет новый виртуальный контент /// </summary> internal static Content Save(Content content) { DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.Content, content); var newContent = DefaultRepository.Save <Content, ContentDAL>(content); DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.Content); return(newContent); }
internal static StatusType SaveProperties(StatusType statusType) { DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.StatusType); var result = DefaultRepository.Save <StatusType, StatusTypeDAL>(statusType); DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.StatusType); return(result); }
internal static Notification SaveProperties(Notification notification) { DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.Notification, notification); var result = DefaultRepository.Save <Notification, NotificationsDAL>(notification); DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.Notification); return(result); }
internal static VisualEditorStyle SaveStyleProperties(VisualEditorStyle visualEditorStyle) { DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.VisualEditorStyle, visualEditorStyle); var result = DefaultRepository.Save <VisualEditorStyle, VeStyleDAL>(visualEditorStyle); DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.VisualEditorStyle); return(result); }
/// <summary> /// Добавляет новый сайт /// </summary> /// <param name="site">информация о сайте</param> /// <returns>информация о сайте</returns> internal static Site Save(Site site) { DefaultRepository.TurnIdentityInsertOn(EntityTypeCode.Site, site); var result = DefaultRepository.Save <Site, SiteDAL>(site); DefaultRepository.TurnIdentityInsertOff(EntityTypeCode.Site); return(result); }
internal static BllObject SaveObjectProperties(BllObject bllObject) { var result = DefaultRepository.Save <BllObject, ObjectDAL>(bllObject); if (bllObject.IsObjectContainerType) { bllObject.Container.ObjectId = result.Id; result.Container = SaveContainer(bllObject.Container); } else if (bllObject.IsObjectFormType) { bllObject.ContentForm.ObjectId = result.Id; result.ContentForm = SaveContentForm(bllObject.ContentForm); } if (bllObject.DefaultValues != null && bllObject.DefaultValues.Any()) { SetDefaultValues(bllObject.DefaultValues, result.Id); } return(result); }
public override Folder CreateInDb(Folder folder) => DefaultRepository.Save <SiteFolder, SiteFolderDAL>((SiteFolder)folder);
public override Folder CreateInDb(Folder folder) => DefaultRepository.Save <ContentFolder, ContentFolderDAL>((ContentFolder)folder);
internal static Page SavePageProperties(Page page) => DefaultRepository.Save <Page, PageDAL>(page);
internal static PageTemplate SaveProperties(PageTemplate template) => DefaultRepository.Save <PageTemplate, PageTemplateDAL>(template);
internal static ObjectFormat SaveObjectFormatProperties(ObjectFormat objectFormat) => DefaultRepository.Save <ObjectFormat, ObjectFormatDAL>(objectFormat);