Example #1
0
        protected void LoadChildMenusByParentMenuId(string parentMenuId)
        {
            AppMenuBLL appMenu = new AppMenuBLL();

            try
            {
                DataTable dt = appMenu.GetChildMenusByParentMenuId(parentMenuId);

                parentMenuDropDownList.DataSource = dt;
                parentMenuDropDownList.DataValueField = "MenuId";
                parentMenuDropDownList.DataTextField = "MenuName";
                parentMenuDropDownList.DataBind();
                parentMenuDropDownList.Items.Insert(0, "");
                parentMenuDropDownList.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                appMenu = null;
            }
        }
        protected void LoadChildMenusByParentMenuId(string parentMenuId)
        {
            AppMenuBLL appMenu = new AppMenuBLL();

            try
            {
                DataTable dt = appMenu.GetChildMenusByParentMenuId(parentMenuId);

                groupWiseUserMenuListListBox.DataSource = dt;
                groupWiseUserMenuListListBox.DataValueField = "MenuId";
                groupWiseUserMenuListListBox.DataTextField = "MenuName";
                groupWiseUserMenuListListBox.DataBind();

                if (groupWiseUserMenuListListBox.Items.Count > 0)
                {
                    upImageButton.Enabled = true;
                    downImageButton.Enabled = true;
                    saveButton.Enabled = true;
                }
                else
                {
                    upImageButton.Enabled = false;
                    downImageButton.Enabled = false;
                    saveButton.Enabled = false;
                }

                countChildMenuLabel.Text = "Total: " + groupWiseUserMenuListListBox.Items.Count.ToString();
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                appMenu = null;
            }
        }