示例#1
0
        protected void GetMenuById(string menuId)
        {
            AppMenuBLL appMenu = new AppMenuBLL();

            try
            {
                DataTable dt = appMenu.GetMenuById(menuId);

                if (dt.Rows.Count > 0)
                {
                    appMenuNameHiddenField.Value = menuNameTextBox.Text = dt.Rows[0]["MenuName"].ToString();
                    descriptionTextBox.Text = dt.Rows[0]["ToolTipDescription"].ToString();
                    urlTextBox.Text = dt.Rows[0]["URL"].ToString();
                    displayNameTextBox.Text = dt.Rows[0]["DisplayName"].ToString();
                    imageURLTextBox.Text = dt.Rows[0]["ImageURL"].ToString();
                    menuTargetDropDownList.SelectedValue = dt.Rows[0]["MenuTarget"].ToString();

                    LoadMenuApps();
                    menuForAppDropDownList.SelectedValue = dt.Rows[0]["MenuForApp"].ToString();

                    LoadMenuTypesByApp();
                    menuTypeDropDownList.SelectedValue = dt.Rows[0]["MenuType"].ToString();

                    LoadMenuGroupsByMenuAppAndType();
                    menuGroupDropDownList.SelectedValue = dt.Rows[0]["MenuGroupId"].ToString();

                    menuDisplayDropDownList.SelectedValue = dt.Rows[0]["IsDisplay"].ToString();

                    LoadMenuLevelsByMenuAppTypeAndGroup();
                    menuLevelDropDownList.SelectedValue = dt.Rows[0]["ParentMenuLevel"].ToString();
                    LoadOnlyParentMenusByMenuAppTypeGroupAndLevel();

                    LoadParentMenusByMenuAppTypeGroupAndLevel();
                    parentMenuDropDownList.SelectedValue = dt.Rows[0]["ParentMenuId"].ToString();

                    menuDefaultDropDownList.SelectedValue = dt.Rows[0]["IsDefault"].ToString();
                    subParentMenuDropDownList.SelectedValue = dt.Rows[0]["IsSubParent"].ToString();
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Data Not Found!!!"; msgDetailLabel.Text = "";
                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
            finally
            {
                appMenu = null;
            }
        }