Ejemplo n.º 1
0
        public static void CreateContent(int moduleId, string culture, int statusId, DateTime modified, string text)
        {
            ContentTableAdapter contentAdapter = new ContentTableAdapter();

            DataAccessLayer.ContentDataTable contentTable = new DataAccessLayer.ContentDataTable();
            DataAccessLayer.ContentRow       contentRow   = contentTable.NewContentRow();
            contentRow.ModuleId = moduleId;
            contentRow.Modified = modified;
            contentRow.StatusId = statusId;
            contentRow.Culture  = culture;
            contentRow.Text     = text;
            //contentRow.RowState = DataRowState.Added;

            contentTable.AddContentRow(contentRow);

            contentAdapter.Update(contentTable);
        }
Ejemplo n.º 2
0
        public static void UpdateContent(int contentVersionId, int moduleId, string culture, int statusId, DateTime modified, string text)
        {
            ContentTableAdapter contentAdapter = new ContentTableAdapter();

            DataAccessLayer.ContentDataTable contentTable = contentAdapter.GetContentByContentVersionId(contentVersionId);
            if (contentTable.Rows.Count != 1)
            {
                throw new Exception("GetContentByContentVersionId did not return 1 row.");
            }

            DataAccessLayer.ContentRow contentRow = (DataAccessLayer.ContentRow)contentTable.Rows[0];
            contentRow.ModuleId = moduleId;
            contentRow.Modified = modified;
            contentRow.StatusId = statusId;
            contentRow.Culture  = culture;
            contentRow.Text     = text;

            contentAdapter.Update(contentRow);
        }