Ejemplo n.º 1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// adds an object to the database
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <param name="objATI_Base">The ATI_BaseInfo object</param>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 public void AddATI_Base(ATI_BaseInfo objATI_Base)
 {
     if (objATI_Base.Content.Trim() != "")
     {
         DataProvider.Instance().AddATI_Base(objATI_Base.ModuleId, objATI_Base.Content, objATI_Base.CreatedByUser);
     }
 }
Ejemplo n.º 2
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// adds an object to the database
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <param name="objATI_Base">The ATI_BaseInfo object</param>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 public void AddATI_Base(ATI_BaseInfo objATI_Base)
 {
     if (objATI_Base.Content.Trim() != "")
     {
         DataProvider.Instance().AddATI_Base(objATI_Base.ModuleId, objATI_Base.Content, objATI_Base.CreatedByUser);
     }
 }
Ejemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// cmdUpdate_Click runs when the update button is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)
        {
            try
            {
                ATI_BaseController objATI_Bases = new ATI_BaseController();
                ATI_BaseInfo       objATI_Base  = new ATI_BaseInfo();

                objATI_Base.ModuleId      = ModuleId;
                objATI_Base.ItemId        = ItemId;
                objATI_Base.Content       = txtContent.Text;
                objATI_Base.CreatedByUser = this.UserId;

                //Update the content within the ATI_Base table
                if (Null.IsNull(ItemId))
                {
                    objATI_Bases.AddATI_Base(objATI_Base);
                }
                else
                {
                    objATI_Bases.UpdateATI_Base(objATI_Base);
                }

                //refresh cache
                SynchronizeModule();

                //Redirect back to the portal home page
                this.Response.Redirect(Globals.NavigateURL(this.TabId), true);
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Ejemplo n.º 4
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// ImportModule implements the IPortable ImportModule Interface
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="ModuleID">The Id of the module to be imported</param>
        /// <param name="Content">The content to be imported</param>
        /// <param name="Version">The version of the module to be imported</param>
        /// <param name="UserId">The Id of the user performing the import</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public void ImportModule(int ModuleID, string Content, string Version, int UserId)
        {
            XmlNode xmlATI_Bases = Globals.GetContent(Content, "ATI_Bases");

            foreach (XmlNode xmlATI_Base in xmlATI_Bases.SelectNodes("ATI_Base"))
            {
                ATI_BaseInfo objATI_Base = new ATI_BaseInfo();

                objATI_Base.ModuleId      = ModuleID;
                objATI_Base.Content       = xmlATI_Base.SelectSingleNode("content").InnerText;
                objATI_Base.CreatedByUser = UserId;
                AddATI_Base(objATI_Base);
            }
        }
Ejemplo n.º 5
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            try
            {
                //Determine ItemId of ATI_Base to Update
                if (this.Request.QueryString["ItemId"] != null)
                {
                    ItemId = Int32.Parse(this.Request.QueryString["ItemId"]);
                }

                //If this is the first visit to the page, bind the role data to the datalist
                if (Page.IsPostBack == false)
                {
                    cmdDelete.Attributes.Add("onClick", "javascript:return confirm('" + Localization.GetString("DeleteItem") + "');");

                    if (ItemId != -1)
                    {
                        //get content
                        ATI_BaseController objATI_Bases = new ATI_BaseController();
                        ATI_BaseInfo       objATI_Base  = objATI_Bases.GetATI_Base(ModuleId, ItemId);
                        if (objATI_Base != null)
                        {
                            txtContent.Text        = objATI_Base.Content;
                            ctlAudit.CreatedByUser = objATI_Base.CreatedByUser.ToString();
                            ctlAudit.CreatedDate   = objATI_Base.CreatedDate.ToString();
                        }
                        else
                        {
                            Response.Redirect(Globals.NavigateURL(), true);
                        }
                    }
                    else
                    {
                        cmdDelete.Visible = false;
                        ctlAudit.Visible  = false;
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Ejemplo n.º 6
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// cmdUpdate_Click runs when the update button is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void cmdUpdate_Click(System.Object sender, System.EventArgs e)
        {
            try
            {
                ATI_BaseController objATI_Bases = new ATI_BaseController();
                ATI_BaseInfo objATI_Base = new ATI_BaseInfo();

                objATI_Base.ModuleId = ModuleId;
                objATI_Base.ItemId = ItemId;
                objATI_Base.Content = txtContent.Text;
                objATI_Base.CreatedByUser = this.UserId;

                //Update the content within the ATI_Base table
                if(Null.IsNull(ItemId))
                {
                    objATI_Bases.AddATI_Base(objATI_Base);
                }
                else
                {
                    objATI_Bases.UpdateATI_Base(objATI_Base);
                }

                //refresh cache
                SynchronizeModule();

                //Redirect back to the portal home page
                this.Response.Redirect(Globals.NavigateURL(this.TabId), true);
             }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
Ejemplo n.º 7
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// ImportModule implements the IPortable ImportModule Interface
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="ModuleID">The Id of the module to be imported</param>
        /// <param name="Content">The content to be imported</param>
        /// <param name="Version">The version of the module to be imported</param>
        /// <param name="UserId">The Id of the user performing the import</param>
        /// <history>
        /// </history>
        /// -----------------------------------------------------------------------------
        public void ImportModule(int ModuleID, string Content, string Version, int UserId)
        {
            XmlNode xmlATI_Bases = Globals.GetContent(Content, "ATI_Bases");

            foreach (XmlNode xmlATI_Base in xmlATI_Bases.SelectNodes("ATI_Base"))
            {
                ATI_BaseInfo objATI_Base = new ATI_BaseInfo();

                objATI_Base.ModuleId = ModuleID;
                objATI_Base.Content = xmlATI_Base.SelectSingleNode("content").InnerText;
                objATI_Base.CreatedByUser = UserId;
                AddATI_Base(objATI_Base);
            }
        }