Esempio n. 1
0
        protected void cmdUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                PageFaceController controller = new PageFaceController();
                PageFaceInfo item = new PageFaceInfo();

                item.Content = txtContent.Text;
                item.ItemId = itemId;
                item.ModuleId = this.ModuleId;
                item.CreatedByUser = this.UserId;

                //determine if we are adding or updating
                if (Null.IsNull(item.ItemId))
                    controller.AddPageFace(item);
                else
                    controller.UpdatePageFace(item);

                Response.Redirect(Globals.NavigateURL(), true);
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Adds a new PageFaceInfo object into the database
 /// </summary>
 /// <param name="info"></param>
 public void AddPageFace(PageFaceInfo info)
 {
     //check we have some content to store
     if (info.Content != string.Empty)
     {
         DataProvider.Instance().AddPageFace(info.ModuleId, info.Content, info.CreatedByUser);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// imports a module from an xml file
        /// </summary>
        /// <param name="ModuleID"></param>
        /// <param name="Content"></param>
        /// <param name="Version"></param>
        /// <param name="UserID"></param>
        public void ImportModule(int ModuleID, string Content, string Version, int UserID)
        {
            XmlNode infos = DotNetNuke.Common.Globals.GetContent(Content, "PageFaces");

            foreach (XmlNode info in infos.SelectNodes("PageFace"))
            {
                PageFaceInfo PageFaceInfo = new PageFaceInfo();
                PageFaceInfo.ModuleId = ModuleID;
                PageFaceInfo.Content = info.SelectSingleNode("content").InnerText;
                PageFaceInfo.CreatedByUser = UserID;

                AddPageFace(PageFaceInfo);
            }
        }