Ejemplo n.º 1
0
        public static Collection <Content> GetArchivedContent(int moduleId, string culture)
        {
            ContentTableAdapter contentAdapter = new ContentTableAdapter();

            DataAccessLayer.ContentDataTable contentTable    = contentAdapter.GetContentByStatusId(3, moduleId, culture);
            Collection <Content>             archivedContent = new Collection <Content>();

            foreach (DataRow dataRow in contentTable.Rows)
            {
                DataAccessLayer.ContentRow contentRow = (DataAccessLayer.ContentRow)dataRow;
                Content contentObject = new Content();
                contentObject.ContentVersionId = contentRow.ContentVersionId;
                contentObject.ModuleId         = contentRow.ModuleId;
                contentObject.StatusId         = contentRow.StatusId;
                contentObject.Culture          = contentRow.Culture;
                contentObject.Text             = contentRow.Text;
                contentObject.Modified         = contentRow.Modified;

                archivedContent.Add(contentObject);
            }

            return(archivedContent);
        }
Ejemplo n.º 2
0
        public static Content GetPendingContent(int moduleId, string culture)
        {
            ContentTableAdapter contentAdapter = new ContentTableAdapter();

            DataAccessLayer.ContentDataTable contentTable;

            contentTable = contentAdapter.GetContentByStatusId(1, moduleId, culture);
            if (contentTable.Rows.Count > 0)
            {
                DataAccessLayer.ContentRow activeContentRow = (DataAccessLayer.ContentRow)contentTable.Rows[0];
                Content content = new Content();
                content.ContentVersionId = activeContentRow.ContentVersionId;
                content.ModuleId         = activeContentRow.ModuleId;
                content.Culture          = activeContentRow.Culture;
                content.StatusId         = activeContentRow.StatusId;
                content.Modified         = activeContentRow.Modified;
                content.Text             = activeContentRow.Text;
                return(content);
            }
            else
            {
                return(null);
            }
        }