/// <summary>给出用户权限,返回 bool 值</summary> /// <param name="modelid">当前需要判断模块的模块标识</param> /// <param name="authValue">当前模块ModelID中需要判断的权限码</param> /// <returns>bool值</returns> public bool GetPermission(long authValue) { bool havePermission = true; //超级管理员(一切权限) if (User.RoleID == 1 || User.UserID == ApplicationConfig.SUPER_ADMINISTRATOR_ID) { return(havePermission); } long privValue = 0; //如果存在需要判断权限的模块标识的权限值 if (UserPermission.TryGetValue(ModuleID.ToString().Trim(), out privValue)) { if ((privValue & authValue) > 0) { return(havePermission); } else { havePermission = false; } } else { havePermission = false; } return(havePermission); }
/// <summary> /// 在 OnInit 事件里面设置各个自定义控件的属性和关联 /// </summary> /// <param name="e"></param> protected override void OnInit(EventArgs e) { //父类里面验证参数是否正确 base.OnInit(e); var cssLink = new HtmlLink(); cssLink.Href = "/aspnet_client/css/cssList.css"; cssLink.Attributes.Add("rel", "stylesheet"); cssLink.Attributes.Add("type", "text/css"); //Page.Header.Controls.Add(cssLink); //验证是否有权限访问。 MyUser.UserPermission.CheckModuleID(ModuleID.ToString(CultureInfo.InvariantCulture)); //设置分页控件的属性和事件 SetQuickPagerInfo(); //设置数据表格的属性 SetGridInfo(); //设置查询控件的属性 SetFindControlInfo(); //设置操作按钮的属性 SetButtonBarInfo(); }
public void DataBind(BaseCollection <DataGroup> groups) { SetRewriteUrls(groups); //if (groups.Count > 0 && this.ParentGroup == null) //{ // this.ParentGroup = groups[0].ParentGroup; //} //if (groups.Count > 0 && this.ParentParentGroup == null) //{ // if (groups[0].ParentGroup != null) // { // this.ParentParentGroup = groups[0].ParentGroup.ParentGroup; // } //} ////Null waarde kan niet (NullRefenceException) //if (this.ParentGroup == null) this.ParentGroup = new DataGroup(); //if (this.ParentParentGroup == null) this.ParentParentGroup = new DataGroup(); repeater = (Repeater)FindControl("Repeater" + ModuleID.ToString("N")); if (repeater != null) { repeater.DataSource = groups; repeater.ItemDataBound += repeater_ItemDataBound; //Trigger list repeater. repeater.DataBind(); } else { LabelMsg.Text = "Geen repeater gevonden.<br />"; } }
/// <summary> /// Handles FlushCache event at Page level<br/> /// Performs FlushCache actions that are common to all Pages<br/> /// Can be overridden /// </summary> protected virtual void OnFlushCache() { if (FlushCache != null) { FlushCache(this, new EventArgs()); //Invokes the delegates } // remove module output from cache, if it's there StringBuilder sb = new StringBuilder(); sb.Append("rb_"); sb.Append(portalSettings.PortalAlias.ToLower()); sb.Append("_mid"); sb.Append(ModuleID.ToString()); sb.Append("["); sb.Append(portalSettings.PortalContentLanguage); sb.Append("+"); sb.Append(portalSettings.PortalUILanguage); sb.Append("+"); sb.Append(portalSettings.PortalDataFormattingCulture); sb.Append("]"); if (Context.Cache[sb.ToString()] != null) { Context.Cache.Remove(sb.ToString()); Debug.WriteLine("************* Remove " + sb.ToString()); } // any other code goes here }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!HideList && cmsHelper.AdminModules.Any()) { GeneralUtilities.BindRepeater(rpModuleList, cmsHelper.AdminModules); } else { rpModuleList.Visible = false; } } pnlNav.Visible = !HideList; if (ModuleID != Guid.Empty) { pnlSetter.Visible = true; int x = 0; foreach (var row in cmsHelper.AdminModules) { if (ModuleID.ToString().ToLower() == row.PluginID.ToString().ToLower()) { SelMenu = x.ToString(); break; } x++; } } }
private void ShowData(DataGroup group) { formView = (Repeater)FindControl("Repeater" + ModuleID.ToString("N")); if (formView == null) { LabelMsg.Text = "Geen repeater gevonden.<br />"; } if (group != null) { string pageLanguage = this.GetLanguageCodeFromMasterPage(); if (pageLanguage != "" && pageLanguage != null) { group.Translate(pageLanguage); } //voor tag: {DirectUrl} group.RewriteUrl = group.GetRewriteUrl(Request.Url.LocalPath); //formview moet aan list worden gekoppeld, vreemd genoeg var list = new List <DataGroup> { group }; formView.DataSource = list; formView.DataBind(); overridePageTitleAndMetaTags(group); formView.Visible = true; } else { if (base.getSetting <bool>("HideWhenNoData")) { formView.Visible = false; } } }
/// <summary> /// Overriden from PortalModuleControl, this override deletes unnecessary picture files from the system /// </summary> protected override void Publish() { string pathToDelete = Server.MapPath(((SettingItem)Settings["AlbumPath"]).FullPath) + "\\"; DirectoryInfo albumDirectory = new DirectoryInfo(pathToDelete); foreach (FileInfo fi in albumDirectory.GetFiles(ModuleID.ToString() + "m*.Production.jpg")) { try { System.IO.File.Delete(fi.FullName); } catch {} } foreach (FileInfo fi in albumDirectory.GetFiles(ModuleID.ToString() + "m*")) { try { System.IO.File.Copy(fi.FullName, fi.FullName.Replace(".jpg", ".Production.jpg"), true); } catch {} } base.Publish(); }
void PagerLinkButton_Click(object sender, EventArgs e) { LinkButton lnk = sender as LinkButton; currentPage = int.Parse(lnk.Text) - 1; SelectAndShowData(Guid.Empty, where); CreatePager(currentPage, Convert.ToInt32(ViewState["TotalResults" + ModuleID.ToString("N")])); }
/// <summary> /// Public constructor. Sets base settings for module. /// </summary> public UserDefinedTable() { SettingItem setSortField = new SettingItem(new StringDataType()); setSortField.Required = false; setSortField.Value = string.Empty; setSortField.Order = 1; this._baseSettings.Add("SortField", setSortField); SettingItem setSortOrder = new SettingItem(new ListDataType("ASC;DESC")); setSortOrder.Required = true; setSortOrder.Value = "ASC"; setSortOrder.Order = 2; this._baseSettings.Add("SortOrder", setSortOrder); SettingItem DocumentPath = new SettingItem(new PortalUrlDataType()); DocumentPath.Required = true; DocumentPath.Value = "Documents"; DocumentPath.Order = 3; this._baseSettings.Add("DocumentPath", DocumentPath); SettingItem ImagePath = new SettingItem(new PortalUrlDataType()); ImagePath.Required = true; ImagePath.Value = "Images\\Default"; ImagePath.Order = 4; this._baseSettings.Add("ImagePath", ImagePath); SettingItem XSLsrc = new SettingItem(new PortalUrlDataType()); XSLsrc.Required = false; XSLsrc.Order = 5; this._baseSettings.Add("XSLsrc", XSLsrc); //Rob Siera - 04 nov 2004 - Adding possibility to use data of other UDT SettingItem UDTsrc = new SettingItem(new IntegerDataType()); UDTsrc.Required = false; UDTsrc.Value = ModuleID.ToString(); UDTsrc.EnglishName = "XSL data"; UDTsrc.Description = "Specify ModuleID of a UserDefinedTable to be used as data source for XSL (see 'mID' parameter in edit URL). Specify 0 to reset to current module data."; UDTsrc.Order = 6; this._baseSettings.Add("UDTsrc", UDTsrc); //Rob Siera - 04 nov 2004 - Adding possibility to view data as raw XML SettingItem DisplayAsXML = new SettingItem(new BooleanDataType()); DisplayAsXML.Required = false; DisplayAsXML.EnglishName = "Display XML"; DisplayAsXML.Description = "Toggle to display data as XML. Helpfull to develop XSL file."; DisplayAsXML.Order = 7; this._baseSettings.Add("DisplayAsXML", DisplayAsXML); }
protected string MarkSelected(string sID, string sParm) { if (sID == ModuleID.ToString().ToLower() && sParm == pf) { return(" class=\"selectedModule\" "); } else { return(" "); } }
/// <summary> /// Updates the content with tokens. /// </summary> /// <param name="content">The content.</param> /// <returns></returns> private string UpdateContentWithTokens(string content) { int startIndex = 0; while ((startIndex = content.IndexOf("_WPQ_", startIndex)) != -1) { content = content.Substring(0, startIndex) + ModuleID.ToString() + content.Substring(startIndex + 5); startIndex += 5; } return(content); }
public BaseViewData GetBaseViewData(ModuleID moduleId) { BaseViewData value = null; if (allBaseViewData.TryGetValue(moduleId, out value) == false) { value = Activator.CreateInstance(Type.GetType(moduleId.ToString() + "ViewData")) as BaseViewData; allBaseViewData.Add(moduleId, value); } return(value); }
public BaseModel GetModel(ModuleID moduleId) { BaseModel model = null; if (allModule.TryGetValue(moduleId, out model) == false) { model = Activator.CreateInstance(Type.GetType(moduleId.ToString() + "Model"), moduleId) as BaseModel; allModule.Add(moduleId, model); } return(model); }
/// <summary> /// 根据父节点信息设置子节点的基本信息 /// </summary> /// <param name="dal">数据访问函数库的实例 </param> /// <param name="parentID">父节点ID</param> /// <param name="moduleID">用户输入的模块ID </param> public void SetSonNote(DataAccessLibrary dal, int parentID, string moduleID) { #region 获取数据库里的最大的ModuleID //因为是功能节点管理,可以限制单人操作,所以这里不考虑并发的问题。 if (moduleID.Length == 0) { string tmpModuleID = dal.ExecuteString("select top 1 ModuleID from Manage_Module order by ModuleID desc "); ModuleID = int.Parse(tmpModuleID); ModuleID = ModuleID + 1; } //this.PowerMark = this.ModuleID; #endregion #region 设置其他信息 //提取父节点信息 // 0 1 2 3 4 5 string sql = "select ParentID, ParentIDAll, ModuleLevel, DisOrder, URL, Target FROM Manage_Module WHERE (ModuleID = {0})"; string[] moduleInfo = dal.ExecuteStringsBySingleRow(string.Format(sql, parentID)); if (moduleInfo != null) { ParentID = parentID; //父节点 ParentIDAll = moduleInfo[1] + "," + parentID; //父节点路径 ModuleLevel = int.Parse(moduleInfo[2]) + 1; //节点级数 URL = moduleInfo[4]; //网址 Target = moduleInfo[5]; //目标 GridPageViewID = int.Parse(ModuleID.ToString(CultureInfo.InvariantCulture) + "01"); FindPageViewID = int.Parse(ModuleID.ToString(CultureInfo.InvariantCulture) + "02"); #region 设置序号,子节点的情况 //获取指定的节点的所有子节点的最大序号序号。如果有则+10设置,等真正保存的时候再修改后面的序号。 //如果没有则本序号 + 10。 sql = "select top 1 DisOrder from Manage_Module where ParentIDAll + ',' like '{0},{1},%' and DisOrder > {2} order by DisOrder desc"; string tmpDisOrder = dal.ExecuteString(string.Format(sql, moduleInfo[1], parentID, moduleInfo[3])); if (tmpDisOrder != null) { //有子节点,设置序号 DisOrder = Int32.Parse(tmpDisOrder) + 10; } else { //选中的节点没有子节点 DisOrder = Int32.Parse(moduleInfo[3]) + 10; } #endregion } #endregion }
protected void EditBtn_Click(object sender, ImageClickEventArgs e) { // Redirect to edit page of currently selected tab if (tabList.SelectedIndex > -1) { // Redirect to module settings page PageItem t = ( PageItem )portalPages[tabList.SelectedIndex]; // added mID by Mario Endara <*****@*****.**> to support security check (2004/11/09) Response.Redirect( HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Pages/PageLayout.aspx", t.ID, "mID=" + ModuleID.ToString() + "&returntabid=" + Page.PageID)); } }
public override string ToString() { string sOutput; if (IsHeader) { sOutput = "======== Header Word ========\r\n Mod ID: " + ModuleID.ToString() + "\t2 bit Res: " + TwoBitResolution.ToString(); if (IsLeadingEdge) { sOutput = sOutput + "\tEdge Rec: L"; } else { sOutput = sOutput + "\tEdge Rec: B"; } sOutput = sOutput + "\tEvent Serial: " + EventSerial.ToString(); if (IsDoubleWord) { sOutput = sOutput + "\tPrec: D"; } else { sOutput = sOutput + "\tPrec: S"; } } else { sOutput = "Data Word --->"; if (IsLSB) { sOutput = sOutput + "\tBit: LS"; } else { sOutput = sOutput + "\tBit: MS"; } if (IsLeadingEdge) { sOutput = sOutput + "\tEdge: L"; } else { sOutput = sOutput + "\tEdge: T"; } sOutput = sOutput + "\tC: " + Channel.ToString() + "\tT: " + Time.ToString(); } return(sOutput); }
/// <summary> /// WriteXml converts the object to Xml (serializes it) and writes it using the XmlWriter passed /// </summary> /// <remarks></remarks> /// <param name="writer">The XmlWriter that contains the xml for the object</param> public void WriteXml(XmlWriter writer) { writer.WriteStartElement("Announcement"); writer.WriteElementString("ItemID", ItemID.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("ModuleID", ModuleID.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Title", Title); writer.WriteElementString("URL", URL); writer.WriteElementString("ViewOrder", ViewOrder.ToString(CultureInfo.InvariantCulture)); writer.WriteElementString("Description", Description); writer.WriteElementString("ImageSource", ImageSource); writer.WriteElementString("TrackClicks", TrackClicks.ToString()); writer.WriteElementString("NewWindow", NewWindow.ToString()); writer.WriteElementString("PublishDate", PublishDate.ToString()); writer.WriteElementString("ExpireDate", ExpireDate.ToString()); writer.WriteEndElement(); }
private void repeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { RepeaterItem item = e.Item; if ((item.ItemType == ListItemType.Item) || (item.ItemType == ListItemType.AlternatingItem)) { string controlId = "RepeaterImageList1" + ModuleID.ToString("N"); listRepeater = (Repeater)item.FindControl(controlId); if (listRepeater != null) { DataItem dg = (DataItem)item.DataItem; listRepeater.DataSource = dg.ImageList1; listRepeater.DataBind(); } } }
private void Load() { Repeater repeater = (Repeater)FindControl("Repeater" + ModuleID.ToString("N")); if (repeater == null) { LabelMsg.Text = "Geen repeater gevonden.<br />"; return; } this.LoadSettings(); if (this.DataCollectionID == null || this.DataCollectionID == Guid.Empty) { this.LabelMsg.Text = "Kies eerst een datacollectie"; } }
public void SubmitButton_Click(object sender, System.EventArgs e) { Array ArrRadioButton = (Array)ViewState["arrRadioButton"]; Array ArrCheckButton = (Array)ViewState["arrCheckButton"]; int MaxRdIndex = (int)ViewState["MaxRdIndex"]; Array arrRadioQuestionID = (Array)ViewState["arrRadioQuestionID"]; Array arrRadioOptionID = (Array)ViewState["arrRadioOptionID"]; int MaxChIndex = (int)ViewState["MaxChIndex"]; Array arrCheckQuestionID = (Array)ViewState["arrCheckQuestionID"]; Array arrCheckOptionID = (Array)ViewState["arrCheckOptionID"]; for (int i = 1; i <= MaxRdIndex; i++) { RadioButton RadioButtonID = new RadioButton(); RadioButtonID = (RadioButton)SurveyHolder.Controls[((int)(ArrRadioButton.GetValue(i))) - 1]; if (RadioButtonID.Checked) { // get { The QuestionID and OptionID int QuestionID = (int)arrRadioQuestionID.GetValue(i); int OptionID = (int)arrRadioOptionID.GetValue(i); int SurveyID = (int)ViewState["SurveyID"]; SurveyDB AddAnswer = new SurveyDB(); AddAnswer.AddAnswer(SurveyID, QuestionID, OptionID); } } for (int j = 1; j <= MaxChIndex; j++) { CheckBox CheckButtonID = new CheckBox(); CheckButtonID = (CheckBox)SurveyHolder.Controls[((int)(ArrCheckButton.GetValue(j))) - 1]; if (CheckButtonID.Checked) { int QuestionID = (int)arrCheckQuestionID.GetValue(j); int OptionID = (int)arrCheckOptionID.GetValue(j); int SurveyID = (int)ViewState["SurveyID"]; SurveyDB AddAnswer = new SurveyDB(); AddAnswer.AddAnswer(SurveyID, QuestionID, OptionID); } } // Store a cookie to show the chart after the submit string CookieName = "Survey" + ModuleID.ToString(); Response.Cookies[CookieName].Value = ViewState["SurveyID"].ToString(); Response.Cookies[CookieName].Expires = DateTime.Now.AddDays(VoteDayPeriod); Response.Redirect(ViewState["URL"].ToString()); }
private void RedirectOnSave(bool isSaved, bool closeOnSave) { if (RefreshPageURL == null || !isSaved) { return; } if (DialogMode) { // Check for selector ID string selector = ScriptHelper.GetString(QueryHelper.GetString("selectorid", string.Empty), false); if (!string.IsNullOrEmpty(selector)) { // Add selector refresh StringBuilder script = new StringBuilder(); if (!EditMode) { ScriptHelper.RegisterWOpenerScript(Page); script.AppendFormat(@" if (wopener) {{ wopener.US_SelectNewValue_{0}('{1}'); }}" , selector, Query.QueryFullName); } script.AppendFormat(@" window.name = '{2}'; window.open('{0}?name={1}&saved=1&editonlycode=true&selectorid={2}&tabmode={3}', window.name); " , ScriptHelper.ResolveUrl(RefreshPageURL), Query.QueryFullName, selector, QueryHelper.GetInteger("tabmode", 0)); if (closeOnSave) { script.AppendLine("CloseDialog();"); } ScriptHelper.RegisterStartupScript(this, GetType(), "UpdateSelector", script.ToString(), true); } } else { string redirectUrl = URLHelper.AddParameterToUrl(RefreshPageURL, "saved", "1"); redirectUrl = URLHelper.AddParameterToUrl(redirectUrl, "parentobjectid", ClassID.ToString()); redirectUrl = URLHelper.AddParameterToUrl(redirectUrl, "objectid", Query.QueryID.ToString()); redirectUrl = URLHelper.AddParameterToUrl(redirectUrl, "moduleid", ModuleID.ToString()); URLHelper.Redirect(redirectUrl); } }
protected void Page_Load(object sender, EventArgs e) { if (base.CheckAutorisation()) { } string searchString = ""; TextBoxSearch = (TextBox)FindControl("TextBoxSearch" + ModuleID.ToString("N")); if (Request.QueryString["Search"] != null) { searchString = Request.QueryString["Search"]; if (!IsPostBack) { TextBoxSearch.Text = searchString; } } //base.LoadModule(); }
public bool GetUserPagePermission() { bool result = true; if (User == null) { return(false); } if (User.RoleID == 1 || User.UserID == 1) { return(result); } long value = 0L; if (!UserPermission.TryGetValue(ModuleID.ToString().Trim(), out value)) { return(false); } return(true); }
public int ShowResults(string searchString, int pageSize, int currentPage) { List <SearchResultItem> totalResults = BitSite._services.SearchService.Find(searchString, "", 0, 0, false); Repeater = (Repeater)FindControl("Repeater" + ModuleID.ToString("N")); if (usePaging) { PagedDataSource pagedResults = new PagedDataSource(); pagedResults.DataSource = totalResults; pagedResults.AllowPaging = true; pagedResults.PageSize = pageSize; pagedResults.CurrentPageIndex = currentPage; Repeater.DataSource = pagedResults; } else { Repeater.DataSource = totalResults; } Repeater.DataBind(); Label labelNumberOfResults = (Label)FindControl("LabelNumberOfResults" + ModuleID.ToString("N")); if (labelNumberOfResults != null) { labelNumberOfResults.Text = totalResults.Count.ToString(); } if (totalResults.Count == 0) { Panel panelNoresults = (Panel)FindControl("PanelNoResults" + ModuleID.ToString("N")); if (panelNoresults != null) { panelNoresults.Visible = true; } } return(totalResults.Count); }
public ActionResult CareerDevelopment(int taskid, int id, FormCollection form) { string message = string.Empty; Dictionary <string, string> dictform = new Dictionary <string, string>(); dictform.Add("ModuleID", ModuleID.ToString()); dictform.Add("TaskID", taskid.ToString()); dictform.Add("UserID", UserInfo.userinfo.ID.ToString()); dictform.Add("ApprID", id.ToString()); int ApprovalLevel = PMSHelper.GetApprovalLevel(id, UserInfo.userinfo.ID); if (PMSModel.FinishTaskAndUpdateApprStatus(dictform, (int)ApprStatus.New, ApprovalLevel, "", out message)) { TempData["AlertMessage"] = "CarrerDevelopment data saved successfully"; return(Redirect("/")); } else { TempData["AlertMessage"] = "Ops! CarrerDevelopment data saving failed, please try again or contact IT member"; return(View()); } }
/// <summary> /// The AddPage_Click server event handler is used /// to add a new tab for this portal /// </summary> /// <param name="Sender">The source of the event.</param> /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param> protected void AddPage_Click(Object Sender, EventArgs e) { if (Settings["TAB_VERSION"] != null) { if (Settings["TAB_VERSION"].ToString() == "True") // Use Old Version { // New tabs go to the end of the list PageItem t = new PageItem(); t.Name = General.GetString("TAB_NAME", "New Page Name"); //Just in case it comes to be empty t.ID = -1; t.Order = 990000; portalPages.Add(t); // write tab to database PagesDB tabs = new PagesDB(); t.ID = tabs.AddPage(portalSettings.PortalID, t.Name, t.Order); // Reset the order numbers for the tabs within the list OrderPages(); //Clear SiteMaps Cache RainbowSiteMapProvider.ClearAllRainbowSiteMapCaches(); // Redirect to edit page // 3_aug_2004 Cory Isakson added returntabid so that PageLayout could return to the tab it was called from. // added mID by Mario Endara <*****@*****.**> to support security check (2004/11/09) Response.Redirect( HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Pages/PageLayout.aspx", t.ID, "mID=" + ModuleID.ToString() + "&returntabid=" + Page.PageID)); } else { // Redirect to New Form - Mike Stone 19/12/2004 Response.Redirect( HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Pages/AddPage.aspx", "mID=" + ModuleID.ToString() + "&returntabid=" + Page.PageID)); } } }
protected void Page_Load(object sender, EventArgs e) { if (!base.CheckAutorisation()) { return; } if (Request.QueryString["Search"] != null) { searchString = Request.QueryString["Search"]; pageSize = base.getSetting <int>("MaxNumberOfRows"); placeHolderPaging = (PlaceHolder)FindControl("PlaceHolderPaging" + ModuleID.ToString("N")); usePaging = ((pageSize > 0) && (placeHolderPaging != null)); if (!IsPostBack) { ViewState["TotalResults"] = ShowResults(searchString); //ViewState["CurrentPage"] = 0; } //CreatePager(Convert.ToInt32(ViewState["CurrentPage"]), Convert.ToInt32(ViewState["TotalResults"])); CreatePager(0, Convert.ToInt32(ViewState["TotalResults"])); } }
public void DataBind(BaseCollection <BaseDataObject> dataObjects) { repeater = (Repeater)FindControl("Repeater" + ModuleID.ToString("N")); if (repeater == null) { LabelMsg.Text = "Geen repeater gevonden.<br />"; return; } if (dataObjects.Count > 0) { string pageLanguage = this.GetLanguageCodeFromMasterPage(); ModuleNavigationActionLite navigationAction = GetFirstNavigationAction(); if (navigationAction != null) { //set rewriteurl per groep foreach (BaseDataObject dataObject in dataObjects) { dataObject.RewriteUrl = dataObject.GetRewriteUrl(navigationAction.NavigationUrl); if (pageLanguage != "" && pageLanguage != null) { //dataObject.Translate(pageLanguage); } } } repeater.DataSource = dataObjects; //repeater.ItemDataBound += repeater_ItemDataBound; //Trigger list repeater. repeater.DataBind(); repeater.Visible = true; } else { if (base.getSetting <bool>("HideWhenNoData")) { repeater.Visible = false; } } }
/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void Page_Load(object sender, EventArgs e) { string ModuleIDent = ModuleID.ToString(); string WebPartFile = Settings["WebPartFile"].ToString(); if ((WebPartFile == null) || (WebPartFile == string.Empty)) { ContentPane.Text = "<font color=red><b>WebPart file setting is missing!</b></font>"; ContentPane.Visible = true; return; } string filename = Server.MapPath(WebPartFile); WebPart partData = WebPartParser.Load(filename); if (partData == null) { return; } if (partData.RequiresIsolation == 1) { InnerFrame.Attributes["src"] = partData.ContentLink; InnerFrame.Attributes["width"] = partData.Width; InnerFrame.Attributes["height"] = partData.Height; InnerFrame.Visible = true; return; } string content = ObtainWebPartContent(partData); if (content != null) { ContentPane.Text = UpdateContentWithTokens(content); ContentPane.Visible = true; } }
public string GetEditUrl(string keyName, string keyValue, string controlKey) { if (ModuleID == Null.NullInteger) { throw new Exception("GetEditUrl: ModuleID is required!"); } StringDictionary replaceParams = new StringDictionary { { "mid", ModuleID.ToString() } }; if (!string.IsNullOrEmpty(keyName) && !string.IsNullOrEmpty(keyValue)) { replaceParams.Add(keyName, keyValue); } if (string.IsNullOrEmpty(controlKey)) { controlKey = "Edit"; } return(Globals.NavigateURL(TabID, controlKey, GetNavigateParameters(replaceParams))); }