Пример #1
0
        /// <summary>
        /// 字段数据验证失败
        /// </summary>
        /// <param name="cFieldName"></param>
        /// <param name="cValidMessage"></param>
        /// <returns></returns>
        public static ActiveResult Valid(String cFieldName, String cValidMessage)
        {
            ActiveResult ret = new ActiveResult();

            ret.result       = AppConfig.FAILURE;
            ret.validfield   = cFieldName;
            ret.validmessage = cValidMessage;
            return(ret);
        }
Пример #2
0
        public static ActiveResult Valid(bool TypeOfBool)
        {
            ActiveResult ret = new ActiveResult();

            if (TypeOfBool)
            {
                ret.result = AppConfig.SUCCESS;
            }
            else
            {
                ret.result = AppConfig.FAILURE;
            }
            return(ret);
        }
Пример #3
0
        /// <summary>
        /// 执行返回结果
        /// </summary>
        /// <param name="iEffect"></param>
        /// <returns></returns>
        public static ActiveResult Valid(int iEffect)
        {
            ActiveResult ret = new ActiveResult();

            if (iEffect > 0)
            {
                ret.result = AppConfig.SUCCESS;
            }
            else
            {
                ret.result = AppConfig.FAILURE;
            }
            return(ret);
        }
Пример #4
0
        /// <summary>
        /// 执行返回结果
        /// </summary>
        /// <param name="iEffect"></param>
        /// <returns></returns>
        public static ActiveResult Valid(int iEffect, string str)
        {
            ActiveResult ret = new ActiveResult();

            if (iEffect > 0)
            {
                ret.result = 0;
            }
            else
            {
                ret.isLock = iEffect;
            }

            return(ret);
        }
Пример #5
0
        /// <summary>
        /// 返回单个数据对象
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static ActiveResult returnObject(Object obj)
        {
            ActiveResult ret = new ActiveResult();

            if (obj == null)
            {
                ret.result = AppConfig.FAILURE;
            }
            else
            {
                ret.result = AppConfig.SUCCESS;
                ret.info   = obj;
            }
            return(ret);
        }
Пример #6
0
        /// <summary>
        /// 返回数据集对象

        /// </summary>
        /// <param name="dtRows"></param>
        /// <returns></returns>
        public static ActiveResult Query(DataTable dtRows)
        {
            ActiveResult ret = new ActiveResult();

            if (dtRows == null)
            {
                ret.result = AppConfig.FAILURE;
            }
            else
            {
                ret.result = AppConfig.SUCCESS;
                ret.total  = dtRows.Rows.Count;
                ret.rows   = JsonLib.ConvertDataTableToList(dtRows);
            }

            return(ret);
        }