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

            if (e.ColName.Equals("库存量"))
            {
                if (Convert.ToInt32(e.CellValue) <= 0)
                {
                    result += "库存量必须大于0";
                }
            }
            return(result);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }