Esempio n. 1
0
        /// <summary>
        /// 刪除功能
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string DeleteFunction(string id)
        {
            string result = string.Empty;

            var sqlConnTrans = _sqlConnectionHelper.BeginTransaction();

            int deleteRoleFunctionResult = _roleFunctionRepo.DeleteRoleFunctionByFunctionID(id, ref sqlConnTrans.SqlConn, ref sqlConnTrans.SqlTrans);

            int deleteFunctionResult = _functionRepo.DeleteFunction(id, ref sqlConnTrans.SqlConn, ref sqlConnTrans.SqlTrans);

            if (deleteRoleFunctionResult >= 0 && deleteFunctionResult > 0)
            {
                result = "";
            }
            else
            {
                result = "刪除失敗。";
            }

            _sqlConnectionHelper.Commit();

            return(result);
        }