//保存数据 /// <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); }
//加载查询数据 /// <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; }
//加载查询数据 /// <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; }
//删除数据 /// <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); }