Example #1
0
        /// <summary>
        /// To check if form is ready to input new data or not
        /// </summary>
        /// <param name="condition"></param>
        /// <returns></returns>
        protected FormCondition CekKondisi(FormCondition condition)
        {
            switch (condition)
            {
            case FormCondition.Ready:

                InputControlHelper.DisableInput(this);
                button1.Enabled = true;
                button2.Enabled = false;

                break;

            case FormCondition.Inputting:

                InputControlHelper.EnableInput(this);
                button1.Enabled = false;
                button2.Enabled = true;

                break;

            default:
                break;
            }

            //Method to setup the control
            InputControlHelper.SetUpControls(this);
            _condition = condition;
            return(condition);
        }
Example #2
0
        private void SetButtonProperty(SuperWebTreeNode node)
        {
            this.btnAddSubMenu.Visible  = node.CanAddSubItem;
            this.btnAddSubMenu.Disabled = !node.AllowAddSubItem;
            this.btnSave.Visible        = node.CanModify;
            this.btnSave.Disabled       = !node.AllowModify;
            this.btnDelete.Visible      = node.CanDelete;
            this.btnDelete.Disabled     = !node.AllowDelete;
            this.btnUp.Visible          = node.CanMoveUp;
            this.btnUp.Disabled         = !node.AllowMoveUp;
            this.btnDown.Visible        = node.CanMoveDown;
            this.btnDown.Disabled       = !node.AllowMoveDown;
            this.btnReSorted.Visible    = node.CanResortSub;
            this.btnReSorted.Disabled   = !node.AllowResortSub;
            InputControlHelper.ClearInputButton(btnAddSubMenu, new string[] { "onclick", "Title" });
            InputControlHelper.ClearInputButton(btnSave, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnDelete, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnUp, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnDown, new string[] { "Title" });
            InputControlHelper.ClearInputButton(btnReSorted, new string[] { "Title" });


            if (node.CanDelete && !node.AllowDelete)
            {
                this.btnDelete.Attributes["Title"] = "请先删除下面的子菜单。";
            }

            if (node.CanMoveUp && !node.AllowMoveUp)
            {
                this.btnUp.Attributes["Title"] = "该菜单是第一个,无法上移。";
            }

            if (node.CanMoveDown && !node.AllowMoveDown)
            {
                this.btnDown.Attributes["Title"] = "该菜单是最后一个,无法下移。";
            }
        }