Beispiel #1
0
        public void btnAddMenuItem_Click(Object sender, EventArgs e)
        {
            var    newMenuNode = new ETEMModel.Models.MenuNode();
            var    newUrl      = new ETEMModel.Models.NavURL();
            Button btnSender   = sender as Button;

            if (btnSender != null && btnSender.Text == BaseHelper.GetCaptionString("Add_Btn"))
            {
                int selectedMainMenuItemValue = int.Parse(this.ddlMainMenuItems.SelectedValue.ToString());

                if (selectedMainMenuItemValue != Constants.INVALID_ID_ZERO)
                {
                    int selectedSubMenuItemValue = int.Parse(this.ddlSubMenuItems.SelectedValue.ToString());
                    if (selectedSubMenuItemValue != Constants.INVALID_ID_ZERO)
                    {
                        newMenuNode.parentNode = selectedSubMenuItemValue;
                        newMenuNode.name       = this.tbxNewMenuItemName.Text;
                        newMenuNode.type       = "link";
                    }
                    else
                    {
                        newMenuNode.parentNode = selectedMainMenuItemValue;
                        newMenuNode.name       = this.tbxNewMenuItemName.Text;
                        newMenuNode.type       = "parent";
                    }
                }
                else
                {
                    newMenuNode.parentNode = Constants.INVALID_ID_ZERO;
                    newMenuNode.name       = this.tbxNewMenuItemName.Text;
                    newMenuNode.type       = "root";
                }
            }
            else if (btnSender != null)
            {
                var edittingIndexValue = this.hdnEditingIndexValue.Value;
                newMenuNode            = new ETEMModel.Models.MenuNode();
                newMenuNode.idNode     = int.Parse(edittingIndexValue);
                newMenuNode.name       = this.tbxNewMenuItemName.Text;
                newMenuNode.parentNode = int.Parse(this.ddlCurrentNodePlace.SelectedValue);
                newMenuNode.type       = this.hdnEditingNodeType.Value;
                newUrl.idNavURL        = int.Parse(this.hdnEditingNodeUrlIndex.Value);
            }

            newUrl.URL         = this.txvNavUrl.Text;
            newUrl.code        = "1";
            newUrl.QueryParams = this.tbxQueryParams.Text.Trim();

            this.ownerPage.CallContext.CurrentConsumerID = this.ownerPage.UserProps.IdUser;
            this.ownerPage.CallContext = this.ownerPage.AdminClientRef.MenuNodeSave(newUrl, newMenuNode, this.ownerPage.CallContext);
            CheckIfResultIsSuccess();
            AddResultMessage(this.ownerPage.CallContext);
            this.ownerPage.ReloadMenuNodeDataViewApplication();
        }
Beispiel #2
0
        private void SetEddingNodeValues(string nodeId, MenuNodeDataView edittedNode, NavURL navUrl)
        {
            this.hdnEditingIndexValue.Value = nodeId;
            this.hdnEditingNodeUrlIndex.Value = edittedNode.idNavURL.ToString();

            this.btnAddMenuItem.Text = BaseHelper.GetCaptionString("Save_Btn");
            this.txvNavUrl.Text = navUrl.URL;
            this.tbxNewMenuItemName.Text = edittedNode.name;
            this.lbNewMenuItemName.Text = BaseHelper.GetCaptionString("New_Node_Name");
            this.tbxQueryParams.Text = navUrl.QueryParams;
            this.ddlMainMenuItems.Visible = false;
            this.ddlSubMenuItems.Visible = false;
            lbMainNodesDll.Visible = false;
            lbSubMenuItems.Visible = false;
            this.PopUpHeadline.InnerText = BaseHelper.GetCaptionString("Editing_Nodes");
            this.lbResultContext.Attributes.Remove("class");
            this.lbResultContext.Text = string.Empty;
        }
Beispiel #3
0
        public void btnAddMenuItem_Click(Object sender, EventArgs e)
        {
            var newMenuNode = new ETEMModel.Models.MenuNode();
            var newUrl = new ETEMModel.Models.NavURL();
            Button btnSender = sender as Button;
            if (btnSender != null && btnSender.Text == BaseHelper.GetCaptionString("Add_Btn"))
            {

                int selectedMainMenuItemValue = int.Parse(this.ddlMainMenuItems.SelectedValue.ToString());

                if (selectedMainMenuItemValue != Constants.INVALID_ID_ZERO)
                {
                    int selectedSubMenuItemValue = int.Parse(this.ddlSubMenuItems.SelectedValue.ToString());
                    if (selectedSubMenuItemValue != Constants.INVALID_ID_ZERO)
                    {
                        newMenuNode.parentNode = selectedSubMenuItemValue;
                        newMenuNode.name = this.tbxNewMenuItemName.Text;
                        newMenuNode.type = "link";
                    }
                    else
                    {
                        newMenuNode.parentNode = selectedMainMenuItemValue;
                        newMenuNode.name = this.tbxNewMenuItemName.Text;
                        newMenuNode.type = "parent";
                    }
                }
                else
                {
                    newMenuNode.parentNode = Constants.INVALID_ID_ZERO;
                    newMenuNode.name = this.tbxNewMenuItemName.Text;
                    newMenuNode.type = "root";


                }


            }
            else if (btnSender != null)
            {
                var edittingIndexValue = this.hdnEditingIndexValue.Value;
                newMenuNode = new ETEMModel.Models.MenuNode();
                newMenuNode.idNode = int.Parse(edittingIndexValue);
                newMenuNode.name = this.tbxNewMenuItemName.Text;
                newMenuNode.parentNode = int.Parse(this.ddlCurrentNodePlace.SelectedValue);
                newMenuNode.type = this.hdnEditingNodeType.Value;
                newUrl.idNavURL = int.Parse(this.hdnEditingNodeUrlIndex.Value);

            }

            newUrl.URL = this.txvNavUrl.Text;
            newUrl.code = "1";
            newUrl.QueryParams = this.tbxQueryParams.Text.Trim();

            this.ownerPage.CallContext.CurrentConsumerID = this.ownerPage.UserProps.IdUser;
            this.ownerPage.CallContext = this.ownerPage.AdminClientRef.MenuNodeSave(newUrl, newMenuNode, this.ownerPage.CallContext);
            CheckIfResultIsSuccess();
            AddResultMessage(this.ownerPage.CallContext);
            this.ownerPage.ReloadMenuNodeDataViewApplication();
        }
 /// <summary>
 /// Create a new NavURL object.
 /// </summary>
 /// <param name="idNavURL">Initial value of the idNavURL property.</param>
 /// <param name="uRL">Initial value of the URL property.</param>
 public static NavURL CreateNavURL(global::System.Int32 idNavURL, global::System.String uRL)
 {
     NavURL navURL = new NavURL();
     navURL.idNavURL = idNavURL;
     navURL.URL = uRL;
     return navURL;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the NavURLs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToNavURLs(NavURL navURL)
 {
     base.AddObject("NavURLs", navURL);
 }