Beispiel #1
0
        /// <summary>
        ///Cron表达式校验
        /// </summary>
        /// <param name="e">校验参数</param>
        /// <returns>错误信息</returns>
        private static string CronVerify(ImportVerifyParam e, object extra)
        {
            string result = "";

            result = ExcelImportHelper.GetCellMsg(e.CellValue, e.ColName, 200, true, true);
            if (string.IsNullOrEmpty(result))
            {
                if (!QuartzHelper.ValidExpression(e.CellValue.ToString()))
                {
                    result += "Cron表达式格式不正确";
                }
            }
            return(result);
        }
Beispiel #2
0
        /// <summary>
        ///下拉选项校验
        /// </summary>
        /// <param name="e">校验参数</param>
        /// <returns>错误信息</returns>
        private static string SelectVerify(ImportVerifyParam e, object extra)
        {
            string result = "";

            result = ExcelImportHelper.GetCellMsg(e.CellValue, e.ColName, 0, true);
            if (string.IsNullOrEmpty(result))
            {
                var dict = extra as Dictionary <string, string>;
                if (dict != null)
                {
                    if (!dict.ContainsKey(e.CellValue.ToString()))
                    {
                        result += e.ColName + "下拉选项" + e.CellValue + "不存在";
                    }
                }
            }
            return(result);
        }