コード例 #1
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// adds an object to the database
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <param name="objATI_Register">The ATI_RegisterInfo object</param>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 public void AddATI_Register(ATI_RegisterInfo objATI_Register)
 {
     if (objATI_Register.Content.Trim() != "")
     {
         DataProvider.Instance().AddATI_Register(objATI_Register.ModuleId, objATI_Register.Content, objATI_Register.CreatedByUser);
     }
 }
コード例 #2
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// adds an object to the database
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <param name="objATI_Register">The ATI_RegisterInfo object</param>
 /// <history>
 /// </history>
 /// -----------------------------------------------------------------------------
 public void AddATI_Register(ATI_RegisterInfo objATI_Register)
 {
     if (objATI_Register.Content.Trim() != "")
     {
         DataProvider.Instance().AddATI_Register(objATI_Register.ModuleId, objATI_Register.Content, objATI_Register.CreatedByUser);
     }
 }
コード例 #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_RegisterController objATI_Registers = new ATI_RegisterController();
                ATI_RegisterInfo       objATI_Register  = new ATI_RegisterInfo();

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

                //Update the content within the ATI_Register table
                if (Null.IsNull(ItemId))
                {
                    objATI_Registers.AddATI_Register(objATI_Register);
                }
                else
                {
                    objATI_Registers.UpdateATI_Register(objATI_Register);
                }

                //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);
            }
        }
コード例 #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_Registers = Globals.GetContent(Content, "ATI_Registers");

            foreach (XmlNode xmlATI_Register in xmlATI_Registers.SelectNodes("ATI_Register"))
            {
                ATI_RegisterInfo objATI_Register = new ATI_RegisterInfo();

                objATI_Register.ModuleId      = ModuleID;
                objATI_Register.Content       = xmlATI_Register.SelectSingleNode("content").InnerText;
                objATI_Register.CreatedByUser = UserId;
                AddATI_Register(objATI_Register);
            }
        }
コード例 #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_Register 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_RegisterController objATI_Registers = new ATI_RegisterController();
                        ATI_RegisterInfo       objATI_Register  = objATI_Registers.GetATI_Register(ModuleId, ItemId);
                        if (objATI_Register != null)
                        {
                            txtContent.Text        = objATI_Register.Content;
                            ctlAudit.CreatedByUser = objATI_Register.CreatedByUser.ToString();
                            ctlAudit.CreatedDate   = objATI_Register.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);
            }
        }
コード例 #6
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_Registers = Globals.GetContent(Content, "ATI_Registers");

            foreach (XmlNode xmlATI_Register in xmlATI_Registers.SelectNodes("ATI_Register"))
            {
                ATI_RegisterInfo objATI_Register = new ATI_RegisterInfo();

                objATI_Register.ModuleId = ModuleID;
                objATI_Register.Content = xmlATI_Register.SelectSingleNode("content").InnerText;
                objATI_Register.CreatedByUser = UserId;
                AddATI_Register(objATI_Register);
            }
        }
コード例 #7
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_RegisterController objATI_Registers = new ATI_RegisterController();
                ATI_RegisterInfo objATI_Register = new ATI_RegisterInfo();

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

                //Update the content within the ATI_Register table
                if(Null.IsNull(ItemId))
                {
                    objATI_Registers.AddATI_Register(objATI_Register);
                }
                else
                {
                    objATI_Registers.UpdateATI_Register(objATI_Register);
                }

                //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);
            }
        }