Exemplo n.º 1
0
        protected void LogoutButton_Click(object sender, EventArgs e)
        {
            SessionObject.CurrentBitSiteUser = null;
            DataBind(null);
            ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{LogoutButton}");

            if (navigationAction.NavigationType == BitPlate.Domain.Modules.NavigationTypeEnum.NavigateToPage)
            {
                if (navigationAction.NavigationUrl != null)
                {
                    Response.Redirect(navigationAction.NavigationUrl);
                }
            }
            else if (navigationAction.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                foreach (string drillDownModuleId in navigationAction.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this);
                    }
                }
            }
            //else
            //{
            //    this.Visible = false;
            //}
        }
Exemplo n.º 2
0
        private string buildDrillDownLink(DataGroup group)
        {
            string drillDownLink = "";

            ModuleNavigationActionLite navigationAction = this.GetNavigationActionByTagName("{DrillDownLink}");
            string navigationUrl = navigationAction.NavigationUrl;

            if (navigationAction.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                //blijven op dezelfde pagina
                navigationUrl    = Request.Url.LocalPath;
                group.RewriteUrl = group.GetRewriteUrl(navigationUrl);

                //per module is er bij NavigationTypeEnum.ShowDetailsInModules een dummylinkbutton aangemaakt.
                //Deze staat bovein de usercontrol
                //Het  server event van deze dummylinkbutton is aan te roepen met  javascript:__doPostBack()
                //je doet net alsof de click van de dummylinkbutton, maar gebruiker klik op een andere link
                //je hebt dan de clientname nodig van de button
                //tweede parameter in __doPostBack() = eventargs = dataid
                string dummyLinkButtonName = this.Controls[3].ClientID; //Linkbutton is altijd 3de element todo: deze code kan beter
                dummyLinkButtonName = dummyLinkButtonName.Replace("_", "$");
                //HYJAX: In BitSiteScript.js worden de hrefs vervangen door onClick events.
                //Hrefs wel nodig voor seo met ajax
                drillDownLink = String.Format(@"<a class=""showDetailsInModules"" href=""{0}"" onclick=""javascript:__doPostBack('{1}','{2}');"">", group.RewriteUrl, dummyLinkButtonName, group.ID);
            }
            else
            {
                group.RewriteUrl = group.GetRewriteUrl(navigationUrl);
                drillDownLink    = String.Format(@"<a href=""{0}"">", group.RewriteUrl);
            }
            return(drillDownLink);
        }
Exemplo n.º 3
0
        private void showEmailSend()
        {
            ModuleNavigationActionLite  action     = GetFirstNavigationAction();
            Dictionary <string, object> DataObject = new Dictionary <string, object>();

            DataObject.Add("NavigationType", action.NavigationType);
            DataObject.Add("NavigationUrl", action.NavigationUrl);
            Response.Clear();
            Response.Write(JsonResult.CreateResult(true, DataObject).ToJsonString());
            Response.End();

            /* ModuleNavigationActionLite action = GetFirstNavigationAction();
             * if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
             * {
             *
             *
             *  Response.Redirect(action.NavigationUrl);
             * }
             * else
             * {
             *  if (this.Messagelabel != null)
             *  {
             *      this.Messagelabel.Text = this.Settings["SendCompleteMessage"].ToString();
             *  }
             *
             * } */
        }
Exemplo n.º 4
0
        private void HandleNavigation()
        {
            ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{SubmitButton}");

            switch (navigationAction.NavigationType)
            {
            case NavigationTypeEnum.NavigateToPage:
                Response.Redirect(navigationAction.NavigationUrl);
                break;

            case NavigationTypeEnum.ShowDetailsInModules:
                foreach (string drillDownModuleId in navigationAction.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this);
                    }
                }
                break;

            default:
                break;
            }
        }
        private void showEmailSend()
        {
            ModuleNavigationActionLite action = GetFirstNavigationAction();

            if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
            {
                Response.Redirect(action.NavigationUrl);
            }
            else //if (action.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                //if (this.CustomerEmailAddressTextBox != null) this.CustomerEmailAddressTextBox.Visible = false;
                if (this.ButtonSubmit != null)
                {
                    this.ButtonSubmit.Visible = false;
                }
                if (this.LinkButtonSubmit != null)
                {
                    this.LinkButtonSubmit.Visible = false;
                }
                if (this.Messagelabel != null)
                {
                    this.Messagelabel.Text = this.Settings["SendCompleteMessage"].ToString();
                }

                /* foreach (HtmlControl htmlControl in this.CustomInputs)
                 * {
                 *  htmlControl.Visible = false;
                 * } */
            }
        }
Exemplo n.º 6
0
        protected void DrillUpLink_Click(Object sender, EventArgs args)
        {
            LinkButton link = (LinkButton)sender;
            Guid       dataId;

            Guid.TryParse(link.CommandArgument, out dataId);

            ModuleNavigationActionLite action = GetNavigationActionByTagName("{DrillUpLink}");

            if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
            {
                Response.Redirect(action.NavigationUrl);
            }
            else if (action.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                foreach (string drillDownModuleId in action.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this, new NavigationParameterObject()
                        {
                            Name = "dataid", GuidValue = dataId
                        });                                                                                                  //{  //SelectAndShowData(dataId);
                    }
                }
            }

            string js = link.OnClientClick;

            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "navigation" + this.ModuleID.ToString("N"), js, true);
        }
        protected void ClearFilter_Event(Object sender, EventArgs args)
        {
            ModuleNavigationActionLite action = GetNavigationActionByTagName("{ApplyFilter}");

            if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
            {
                Response.Redirect(action.NavigationUrl);
            }
            else if (action.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                foreach (string drillDownModuleId in action.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this, new NavigationParameterObject()
                        {
                            Name = "dataid", GuidValue = Guid.Empty
                        });                                                                                                      //{  //SelectAndShowData(dataId);
                    }
                }

                foreach (Control control in this.Controls)
                {
                    if (control.ID != null)
                    {
                        string    filterColumnID = Regex.Match(control.ID, "_(.*?)_").ToString().Replace("_", "");
                        DataField dataField      = null;
                        if (filterColumnID == "02f78e8cfc9c40ca9dd432eadc01f92a") //02f78e8c-fc9c-40ca-9dd4-32eadc01f92a = searchall ID
                        {
                            //SearchAllVelden. In deze velden wordt gezocht naar de invoer van de SearchAllTextbox
                            filterColumnID = "ID, Name, Title";
                        }
                        else
                        {
                            dataField = GetDataFieldByID(filterColumnID);
                        }

                        if (dataField != null)
                        {
                            ClearControlValue(control);
                        }

                        //Zoek in alle dataitem velden.
                        if (dataField == null && filterColumnID != "" && control != null && control.GetType().Name == "TextBox")
                        {
                            ClearControlValue(control);
                        }
                    }
                }
                //stuur eventueel javascript naar de browser zodat deze wordt uitgevoerd nadat pagina opnieuw is gerenderd

                /* string js = linkButton.OnClientClick;
                 * if (js != null && js != "")
                 * {
                 *  ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "navigation" + this.ModuleID.ToString("N"), js, true);
                 * } */
            }
        }
Exemplo n.º 8
0
        protected ModuleNavigationActionLite GetNavigationActionByTagName(string key)
        {
            ModuleNavigationActionLite returnValue = null;

            if (NavigationActions == null)
            {
                LoadNavigationActions();
            }
            if (NavigationActions != null && NavigationActions.ContainsKey(key))
            {
                returnValue = NavigationActions[key];
            }
            return(returnValue);
        }
Exemplo n.º 9
0
        protected ModuleNavigationActionLite GetFirstNavigationAction()
        {
            ModuleNavigationActionLite returnValue = null;

            if (NavigationActions == null)
            {
                LoadNavigationActions();
            }
            if (NavigationActions != null && NavigationActions.Count > 0)
            {
                returnValue = NavigationActions.First().Value;
            }
            return(returnValue);
        }
Exemplo n.º 10
0
        public void SubmitButton_Click(object sender, EventArgs e)
        {
            if (UserNameTextbox.Text.Trim() != "" && UserPasswordTextbox.Text.Trim() != "")
            {
                SiteUser user = this.Login(UserNameTextbox.Text, UserPasswordTextbox.Text);
                if (user != null)
                {
                    //loginModule = BaseObject.GetById<LoginModule>(this.ModuleID);
                    //this.LoadModuleObject();
                    //ModuleNavigationAction drillDownAction = this.GetDrillDownActionByTagName("LoginButton");
                    ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{LoginButton}");

                    switch (navigationAction.NavigationType)
                    {
                    case NavigationTypeEnum.NavigateToPage:
                        Response.Redirect(navigationAction.NavigationUrl);
                        break;

                    case NavigationTypeEnum.ShowDetailsInModules:
                        foreach (string drillDownModuleId in navigationAction.RefreshModules)
                        {
                            BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                            if (moduleControl != null)
                            {
                                moduleControl.Reload(this);
                            }
                        }
                        break;

                    default:
                        break;
                    }
                    UserNameTextbox.Text     = "";
                    UserPasswordTextbox.Text = "";
                    this.Visible             = false;
                }
                else
                {
                    ResultLabel.Text = "Login mislukt.";
                }
            }
            else
            {
                ResultLabel.Text = "Login mislukt.";
            }
        }
        /// <summary>
        /// wordt aangeroepen vanuit Page_Load() en ReLoad() in BaseDataModuleUserControl
        /// </summary>
        /// <param name="dataId"></param>
        ///
        public override void SelectAndShowData(Guid dataId)
        {
            DataGroup group = BaseObject.GetById <DataGroup>(dataId);

            if (group == null)
            {
                DataItem item = BaseObject.GetById <DataItem>(dataId);
                if (item != null)
                {
                    group = item.ParentGroup;
                }
            }
            if (group == null)
            {
                group = new DataGroup();
            }
            if (group.DataCollection != null && group.DataCollection.ID != DataCollectionID)
            {
                //return;
            }
            ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{DrillDownLink}");

            if (navigationAction != null)
            {
                string navigationUrl = navigationAction.NavigationUrl;
                if (navigationAction.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
                {
                    //blijven op dezelfde pagina
                    navigationUrl = Request.Url.LocalPath;
                }
                group.RewriteUrl = group.GetRewriteUrl(navigationUrl);

                //maak list aan
                BaseCollection <BaseDataObject> dataObjects = new BaseCollection <BaseDataObject>();
                dataObjects.Add(group);
                while (group.ParentGroup != null)
                {
                    group            = group.ParentGroup;
                    group.RewriteUrl = group.GetRewriteUrl(navigationUrl);
                    dataObjects.Insert(0, group);
                }
                DataBind(dataObjects);
            }
        }
Exemplo n.º 12
0
        protected void SelectItemLink_Click(Object sender, EventArgs args)
        {
            //LinkButton link = (LinkButton)sender;
            //Guid dataId;
            //Guid.TryParse(link.CommandArgument, out dataId);
            //this.LoadModuleObject();
            //ModuleNavigationAction action = this.Module.GetNavigationActionByTagName("DrillDownLink");
            ModuleNavigationActionLite action = GetNavigationActionByTagName("{DrillDownLink}");

            if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
            {
                //Response.Redirect(DrillDownPage.GetRewriteUrl());
                Response.Redirect(action.NavigationUrl);
            }
            else if (action.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                Guid dataId;
                //click van linkbutton wordt via javascript:__doPostback() gedaan
                //de link is dus geen echte linkbutton
                //dataid staat in eventArgument van deze postbackfunctie
                string eventArgument = Request.Params.Get("__EVENTARGUMENT");
                Guid.TryParse(eventArgument, out dataId);
                LinkButton linkButton = (LinkButton)sender;

                foreach (string drillDownModuleId in action.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this, new NavigationParameterObject()
                        {
                            Name = "dataItemID", GuidValue = dataId
                        });                                                                                                      //{  //SelectAndShowData(dataId);
                    }
                }


                string js = linkButton.OnClientClick;
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "navigation" + this.ModuleID.ToString("N"), js, true);
            }
        }
Exemplo n.º 13
0
        private void SetRewriteUrls(BaseCollection <DataGroup> groups)
        {
            ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{DrillDownLink}");

            if (navigationAction != null)
            {
                string navigationUrl = navigationAction.NavigationUrl;
                if (navigationAction.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
                {
                    //blijven op dezelfde pagina
                    navigationUrl = Request.Url.LocalPath;
                }
                //set rewriteurl per groep
                foreach (DataGroup group in groups)
                {
                    group.RewriteUrl = group.GetRewriteUrl(navigationUrl);
                }
                this.ParentGroup.RewriteUrl       = ParentGroup.GetRewriteUrl(navigationUrl);
                this.ParentParentGroup.RewriteUrl = ParentParentGroup.GetRewriteUrl(navigationUrl);
            }
        }
        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;
                }
            }
        }
Exemplo n.º 15
0
        protected void DrillUpLink_Click(Object sender, EventArgs args)
        {
            ModuleNavigationActionLite action = GetNavigationActionByTagName("{DrillUpLink}");

            if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
            {
                Response.Redirect(action.NavigationUrl);
            }
            else if (action.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                //click van linkbutton wordt via javascript:__doPostback() gedaan
                //de link is dus geen echte linkbutton
                //dataid staat in eventArgument van deze postbackfunctie
                Guid   dataId;
                string eventArgument = Request.Params.Get("__EVENTARGUMENT");
                Guid.TryParse(eventArgument, out dataId);
                LinkButton linkButton = (LinkButton)sender;

                foreach (string drillDownModuleId in action.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this, new NavigationParameterObject()
                        {
                            Name = "dataid", GuidValue = dataId
                        });                                                                                                  //{  //SelectAndShowData(dataId);
                    }
                }

                //stuur eventueel javascript naar de browser zodat deze wordt uitgevoerd nadat pagina opnieuw is gerenderd
                string js = linkButton.OnClientClick;
                if (js != null && js != "")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "navigation" + this.ModuleID.ToString("N"), js, true);
                }
            }
        }
Exemplo n.º 16
0
        protected void ButtonSearch_Click(object sender, EventArgs e)
        {
            ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{SearchLink}");

            if (navigationAction == null)
            {
                return;
            }
            if (navigationAction.NavigationType == NavigationTypeEnum.NavigateToPage && navigationAction.NavigationUrl != null)
            {
                Response.Redirect(navigationAction.NavigationUrl + "?Search=" + TextBoxSearch.Text);
            }
            else if (navigationAction.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                foreach (string drillDownModuleId in navigationAction.RefreshModules)
                {
                    SearchResultsModuleControl searchResultsControl = (SearchResultsModuleControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", "_"));
                    if (searchResultsControl != null)
                    {
                        searchResultsControl.ShowResults(TextBoxSearch.Text);
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Diagnostics.Trace.WriteLine("Page_Load Start", "GoogleMapsModuleControl");
            base.Load(sender, e);
            if (base.CheckAutorisation())
            {
                LabelMsg.Text    = "";
                this.ParentGroup = null;
                if (DataCollectionID == null || DataCollectionID == Guid.Empty)
                {
                    LabelMsg.Text = "Kies eerst een datacollectie";
                }
                else
                {
                    if (!IsPostBack)
                    {
                        Guid         dataId     = Guid.Empty;
                        ShowDataEnum showDataBy = base.getSetting <ShowDataEnum>("ShowDataBy");
                        if (showDataBy == ShowDataEnum.UserSelect)
                        {
                            string dataIdQuery = Request.QueryString["dataid"];
                            Guid.TryParse(dataIdQuery, out dataId);
                        }
                        SelectAndShowData(dataId);


                        GPoint initPoint = GoogleGeocoder.GetLatLng(base.getSetting <string>("InitialAddress") + "," + base.getSetting <string>("InitialAddress"), SessionObject.CurrentSite.GoogleMapsKey);

                        string  infoBalloonFormat  = "";
                        string  sideBarRowFormat   = "";
                        Literal literalInfoBalloon = (Literal)FindControl("LiteralInfoBalloon" + ModuleID.ToString("N"));
                        if (literalInfoBalloon != null)
                        {
                            infoBalloonFormat = literalInfoBalloon.Text;
                            infoBalloonFormat = infoBalloonFormat.Replace("\r", "").Replace("\n", "").Replace("\t", "");
                            infoBalloonFormat = infoBalloonFormat.Replace("'", "&quot;");
                        }

                        Literal literalSideBar = (Literal)FindControl("LiteralSideBar" + ModuleID.ToString("N"));
                        if (literalSideBar != null)
                        {
                            sideBarRowFormat = literalSideBar.Text;
                            sideBarRowFormat = sideBarRowFormat.Replace("\r", "").Replace("\n", "").Replace("\t", "");
                            sideBarRowFormat = sideBarRowFormat.Replace("'", "&quot;");
                        }

                        string navigationUrl = Request.Url.LocalPath;

                        ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{DrillDownLink}");
                        if (navigationAction != null)
                        {
                            navigationUrl = navigationAction.NavigationUrl;
                            if (navigationAction.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
                            {
                                //blijven op dezelfde pagina
                                navigationUrl = Request.Url.LocalPath;
                            }
                        }
                        LabelMsg.Text = String.Format(@"
<script type=""text/javascript"">
    BITGOOGLEMAP.key = '{0}';
    
    BITGOOGLEMAP.initLatitude = {1};
    BITGOOGLEMAP.initLongitude = {2};
    BITGOOGLEMAP.initZoom = {3};
    BITGOOGLEMAP.datacollectionID = '{4}';
    BITGOOGLEMAP.infoBalloonFormat = '{5}';
    BITGOOGLEMAP.sideBarRowFormat = '{6}';
    BITGOOGLEMAP.navigationUrl = '{7}'
    //BITGOOGLEMAP.mapType = '{0}';
</script>", SessionObject.CurrentSite.GoogleMapsKey, initPoint.Lat.ToString().Replace(",", "."), initPoint.Long.ToString().Replace(",", "."), base.getSetting <string>("InitialZoom"), this.DataCollectionID, infoBalloonFormat, sideBarRowFormat, navigationUrl);
                    }
                }
            }
            System.Diagnostics.Trace.WriteLine("Page_Load End", "GoogleMapsModuleControl");
        }
Exemplo n.º 18
0
        protected void AppyFilter_Event(Object sender, EventArgs args)
        {
            string where = "";
            string whereStatement;

            //string dropdownList = "", checkboxList = "";
            //string
            foreach (Control control in this.GetAllControls(this.Page.Master))
            {
                whereStatement = "";
                if (control.ID != null)
                {
                    string    filterColumnID = Regex.Match(control.ID, "_(.*?)_").ToString().Replace("_", "");
                    DataField dataField      = null;
                    if (filterColumnID == "02f78e8cfc9c40ca9dd432eadc01f92a") //02f78e8c-fc9c-40ca-9dd4-32eadc01f92a = searchall ID
                    {
                        //SearchAllVelden. In deze velden wordt gezocht naar de invoer van de SearchAllTextbox
                        filterColumnID = "ID, Name, Title";
                    }
                    else
                    {
                        dataField = GetDataFieldByID(filterColumnID);
                    }

                    if (dataField != null)
                    {
                        whereStatement = GetFilterControlValue(control, dataField);
                        if (whereStatement != "")
                        {
                            where += whereStatement;
                        }
                    }

                    //Zoek in alle dataitem velden.
                    if (dataField == null && filterColumnID != "" && control != null && control.GetType().Name == "TextBox")
                    {
                        TextBox textBox            = (TextBox)control;
                        string  concatmappingField = " AND CONCAT(Name, Title";
                        foreach (DataField dataFieldToConcat in dataCollection.DataItemFields)
                        {
                            if (dataFieldToConcat.FieldType == FieldTypeEnum.Text ||
                                dataFieldToConcat.FieldType == FieldTypeEnum.LongText ||
                                dataFieldToConcat.FieldType == FieldTypeEnum.Html)
                            {
                                if (dataFieldToConcat.MappingColumn != "")
                                {
                                    concatmappingField += ", " + dataFieldToConcat.MappingColumn;
                                }
                            }
                        }
                        concatmappingField += ")";
                        whereStatement     += concatmappingField + " LIKE '%" + textBox.Text + "%'";
                        if (whereStatement != "" && textBox.Text.Trim() != "")
                        {
                            where += whereStatement;
                        }
                    }
                }
            }

            //if (where != "") where = where.Remove(where.Length - 4);

            //Antieke code
            //if (dropdownList != "")
            //{
            //    dropdownList = dropdownList.Remove(dropdownList.Length - 2);
            //    dropdownList = " (FK_1 IN (" + dropdownList + ") OR " +
            //        " FK_2 IN (" + dropdownList + ") OR " +
            //        " FK_3 IN (" + dropdownList + ") OR " +
            //        " FK_4 IN (" + dropdownList + ") OR " +
            //        " FK_5 IN (" + dropdownList + ") OR " +
            //        " FK_6 IN (" + dropdownList + ") OR " +
            //        " FK_7 IN (" + dropdownList + ") OR " +
            //        " FK_8 IN (" + dropdownList + ") OR " +
            //        " FK_9 IN (" + dropdownList + ") OR " +
            //        " FK_10 IN (" + dropdownList + ")) ";
            //    where += " AND " + dropdownList;
            //}

            //if (checkboxList != "")
            //{
            //    checkboxList = checkboxList.Remove(checkboxList.Length - 2);
            //    checkboxList = " EXISTS (SELECT * FROM datalookupvalueperitem WHERE FK_LookupValue IN (" + checkboxList + ") AND dataitem.ID = datalookupvalueperitem.FK_Item) ";
            //    where += " AND " + checkboxList;
            //}
            ModuleNavigationActionLite action = GetNavigationActionByTagName("{ApplyFilter}");

            if (action.NavigationType == NavigationTypeEnum.NavigateToPage)
            {
                Response.Redirect(action.NavigationUrl);
            }
            else if (action.NavigationType == NavigationTypeEnum.ShowDetailsInModules)
            {
                foreach (string drillDownModuleId in action.RefreshModules)
                {
                    BaseModuleUserControl moduleControl = (BaseModuleUserControl)FindControlRecursive(this.Page.Master, "Mod" + drillDownModuleId.Replace("-", ""));
                    if (moduleControl != null)
                    {
                        moduleControl.Reload(this, new NavigationParameterObject()
                        {
                            Name = "filter", StringValue = where, GuidValue = Guid.Empty
                        });                                                                                                                           //{  //SelectAndShowData(dataId);
                    }
                }
                //stuur eventueel javascript naar de browser zodat deze wordt uitgevoerd nadat pagina opnieuw is gerenderd

                /* string js = linkButton.OnClientClick;
                 * if (js != null && js != "")
                 * {
                 *  ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "navigation" + this.ModuleID.ToString("N"), js, true);
                 * } */
            }
        }
Exemplo n.º 19
0
        public void DataBind(BaseCollection <DataItem> items)
        {
            repeater = (Repeater)FindControl("Repeater" + ModuleID.ToString("N"));
            if (repeater == null)
            {
                LabelMsg.Text = "Geen repeater gevonden.<br />";
                return;
            }
            if (items.Count > 0)
            {
                string pageLanguage  = this.GetLanguageCodeFromMasterPage();
                string navigationUrl = Request.Url.LocalPath;
                ModuleNavigationActionLite navigationAction = GetNavigationActionByTagName("{DrillDownLink}");
                if (navigationAction != null && navigationAction.NavigationType == NavigationTypeEnum.NavigateToPage)
                {
                    navigationUrl = navigationAction.NavigationUrl;
                }

                //set rewriteurl per groep
                foreach (DataItem item in items)
                {
                    item.RewriteUrl = item.GetRewriteUrl(navigationUrl);

                    if (pageLanguage != "" && pageLanguage != null)
                    {
                        item.Translate(pageLanguage);
                    }
                }


                //if (items.Count > 0 && this.ParentGroup == null)
                //{
                //    if (this.getSetting<int>("ShowDataBy") == 0)
                //    {
                //        this.ParentGroup = items[0].ParentGroup;
                //    }
                //}
                //Null waarde kan niet (NullRefenceException)
                //if (this.ParentGroup == null) this.ParentGroup = new DataGroup();
                //repeater = (Repeater)FindControl("Repeater" + ModuleID.ToString("N"));


                //repeater.DataSource = items;
                //repeater.ItemDataBound += repeater_ItemDataBound; //Trigger list repeater.
                //repeater.DataBind();
                //repeater.Visible = true;
            }
            else
            {
                if (base.getSetting <bool>("HideWhenNoData"))
                {
                    repeater.Visible = false;
                }
            }


            if (usePaging)
            {
                PagedDataSource pagedResults = new PagedDataSource();
                pagedResults.DataSource       = items;
                pagedResults.AllowPaging      = true;
                pagedResults.PageSize         = pageSize;
                pagedResults.CurrentPageIndex = currentPage;


                repeater.DataSource = pagedResults;
            }
            else
            {
                repeater.DataSource = items;
            }


            repeater.ItemDataBound += repeater_ItemDataBound; //Trigger list repeater.
            repeater.DataBind();
            repeater.Visible = true;
        }