示例#1
0
        protected void LoadForCurCommand()
        {
            Control control     = null;
            string  controlPath = string.Empty;

            cmd = ConvertUtility.ToString(Request.QueryString["cmd"]);
            CommandInfo command = null;

            if (cmd != string.Empty)
            {
                command = CommandController.GetCommand(cmd);
                if (command != null)
                {
                    lbcmd.Text = command.CommandName;
                    //lblTitle.Text = command.CommandName;
                }
            }
            if (command == null)
            {
                controlPath = "/UserControls/WelCome.ascx";
            }
            else if (!CurrentUser.IsSuperAdmin && !CommandController.IsAvailableForUser(command.CommandID, CurrentUser.UserID, ConvertUtility.ToInt32(Request.QueryString["portalid"])))
            {
                controlPath = "/UserControls/AccessDeny.ascx";
            }
            else if (File.Exists(Server.MapPath(command.ControlPath)))
            {
                control = LoadAdminControl(command.CommandKey);
            }

            if (controlPath != string.Empty)
            {
                control = LoadControl(controlPath);
            }
            if (control != null)
            {
                this.placeControls.Controls.Add(control);
            }
            else
            {
                lblErrorMessage.Text = "Không tìm thấy module !";
            }
        }