/// ----------------------------------------------------------------------------- /// <summary> /// adds an object to the database /// </summary> /// <remarks> /// </remarks> /// <param name="objATI_GroupAdmin">The ATI_GroupAdminInfo object</param> /// <history> /// </history> /// ----------------------------------------------------------------------------- public void AddATI_GroupAdmin(ATI_GroupAdminInfo objATI_GroupAdmin) { if (objATI_GroupAdmin.Content.Trim() != "") { DataProvider.Instance().AddATI_GroupAdmin(objATI_GroupAdmin.ModuleId, objATI_GroupAdmin.Content, objATI_GroupAdmin.CreatedByUser); } }
/// ----------------------------------------------------------------------------- /// <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_GroupAdminController objATI_GroupAdmins = new ATI_GroupAdminController(); ATI_GroupAdminInfo objATI_GroupAdmin = new ATI_GroupAdminInfo(); objATI_GroupAdmin.ModuleId = ModuleId; objATI_GroupAdmin.ItemId = ItemId; objATI_GroupAdmin.Content = txtContent.Text; objATI_GroupAdmin.CreatedByUser = this.UserId; //Update the content within the ATI_GroupAdmin table if (Null.IsNull(ItemId)) { objATI_GroupAdmins.AddATI_GroupAdmin(objATI_GroupAdmin); } else { objATI_GroupAdmins.UpdateATI_GroupAdmin(objATI_GroupAdmin); } //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); } }
/// ----------------------------------------------------------------------------- /// <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_GroupAdmins = Globals.GetContent(Content, "ATI_GroupAdmins"); foreach (XmlNode xmlATI_GroupAdmin in xmlATI_GroupAdmins.SelectNodes("ATI_GroupAdmin")) { ATI_GroupAdminInfo objATI_GroupAdmin = new ATI_GroupAdminInfo(); objATI_GroupAdmin.ModuleId = ModuleID; objATI_GroupAdmin.Content = xmlATI_GroupAdmin.SelectSingleNode("content").InnerText; objATI_GroupAdmin.CreatedByUser = UserId; AddATI_GroupAdmin(objATI_GroupAdmin); } }
/// ----------------------------------------------------------------------------- /// <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_GroupAdmin 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_GroupAdminController objATI_GroupAdmins = new ATI_GroupAdminController(); ATI_GroupAdminInfo objATI_GroupAdmin = objATI_GroupAdmins.GetATI_GroupAdmin(ModuleId, ItemId); if (objATI_GroupAdmin != null) { txtContent.Text = objATI_GroupAdmin.Content; ctlAudit.CreatedByUser = objATI_GroupAdmin.CreatedByUser.ToString(); ctlAudit.CreatedDate = objATI_GroupAdmin.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); } }
/// ----------------------------------------------------------------------------- /// <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_GroupAdminController objATI_GroupAdmins = new ATI_GroupAdminController(); ATI_GroupAdminInfo objATI_GroupAdmin = new ATI_GroupAdminInfo(); objATI_GroupAdmin.ModuleId = ModuleId; objATI_GroupAdmin.ItemId = ItemId; objATI_GroupAdmin.Content = txtContent.Text; objATI_GroupAdmin.CreatedByUser = this.UserId; //Update the content within the ATI_GroupAdmin table if(Null.IsNull(ItemId)) { objATI_GroupAdmins.AddATI_GroupAdmin(objATI_GroupAdmin); } else { objATI_GroupAdmins.UpdateATI_GroupAdmin(objATI_GroupAdmin); } //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); } }