Ejemplo n.º 1
0
        //保存数据
        /// <summary>
        /// 保存数据
        /// </summary>
        /// <returns></returns>
        internal override bool Save()
        {
            if (!ValidateEditForm())
            {
                return(false);
            }

            string msg;

            BuildEntity();

            var result = CurrentOperationStatus == OperationStatus.New
                             ? RightFunctionBll.InsertRightFunction(EditEntity, out msg)
                             : RightFunctionBll.UpdateRightFunction(EditEntity, out msg);

            UI.ShowInfo(msg);

            if (result)
            {
                UI.ReadOnlyUi(pageEditData, true);
                SetSelectedEntity();
            }

            return(result);
        }
Ejemplo n.º 2
0
        //加载查询数据
        /// <summary>
        /// 加载查询数据
        /// </summary
        private void QueryData()
        {
            var condition = new QueryCondition
            {
                Code      = UI.GetValue(txtViewFuncCode),
                GroupName = UI.GetValue(txtViewFuncName)
            };
            var lstData = RightFunctionBll.QueryRightFunction(condition);

            grdQueryResult.DataSource = lstData;
        }
Ejemplo n.º 3
0
        //加载查询数据
        /// <summary>
        /// 加载查询数据
        /// </summary
        private void QueryData()
        {
            Commands =
                DictionaryItemBll.QueryDictionaryItem(new QueryCondition
            {
                Code           = DataDictionary.FunctionCommand.ToString(),
                ReasonCategory = DictionaryCategory.Dictionary.ToString()
            });
            gridViewCommand.DataSource = Commands;

            Functions               = RightFunctionBll.QueryAll();
            IsCheckNeedSave         = false;
            gridViewFunc.DataSource = Functions;
            IsCheckNeedSave         = true;
        }
Ejemplo n.º 4
0
 //删除数据
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <returns></returns>
 internal override bool Delete()
 {
     if (EditEntity == null)
     {
         UI.ShowWarn("请选择待删除数据");
         return(false);
     }
     if (!UI.Confirm("确定要删除吗?"))
     {
         return(false);
     }
     if (!RightFunctionBll.DeleteRightFunction(EditEntity))
     {
         UI.ShowError("删除失败");
         return(false);
     }
     EditEntity = null;
     UI.ClearUi(pageEditData);
     return(true);
 }