first commit
This commit is contained in:
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.Common.Helper
|
||||
{
|
||||
public static class MathExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// 四舍五入(适用decimal类型)
|
||||
/// </summary>
|
||||
/// <param name="d">要舍入的小数</param>
|
||||
/// <param name="decimals">保留的小数位(负数则不处理)</param>
|
||||
/// <returns></returns>
|
||||
public static decimal Round(decimal? d, int decimals = 2)
|
||||
{
|
||||
if (!d.HasValue)
|
||||
return 0;
|
||||
|
||||
return decimals < 0 ? d.Value : Math.Round(d.Value, decimals, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数学函数扩展-幂运算xⁿ
|
||||
/// </summary>
|
||||
/// <param name="x">底数</param>
|
||||
/// <param name="n">指数</param>
|
||||
/// <param name="decimals">保留的小数位(负数则不处理)</param>
|
||||
/// <returns></returns>
|
||||
public static decimal Pow(decimal x, decimal n, int decimals = -1)
|
||||
{
|
||||
decimal result = (decimal)Math.Pow((double)x, (double)n);
|
||||
return Round(result, decimals);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数学函数扩展-安全除
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <param name="decimals">保留的小数位(负数则不处理)</param>
|
||||
/// <returns></returns>
|
||||
public static decimal Division(decimal first, decimal second, int decimals = -1)
|
||||
{
|
||||
decimal result = second == 0 ? 0 : (first / second);
|
||||
return Round(result, decimals);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 数学函数扩展-安全除
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <returns></returns>
|
||||
public static int Division(int first, int second)
|
||||
{
|
||||
int result = second == 0 ? 0 : (first / second);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 数学函数扩展-安全取余 DY20210312
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <returns></returns>
|
||||
public static int Remainder(int first, int second)
|
||||
{
|
||||
int result = second == 0 ? 0 : (first % second);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 向下取整
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <returns></returns>
|
||||
public static int Floor(int first, int second)
|
||||
{
|
||||
decimal result = second == 0 ? 0 : (first / second);
|
||||
return (int)Math.Floor(result);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向下取整
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">数据</param>
|
||||
/// <returns></returns>
|
||||
public static int Floor(decimal first, decimal second)
|
||||
{
|
||||
decimal result = second == 0 ? 0 : (Convert.ToDecimal(first) / Convert.ToDecimal(second));
|
||||
//判断是否整除
|
||||
if (!StringCheck(result.ToString()))
|
||||
{
|
||||
return (int)Math.Floor(result) - 1;
|
||||
}
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安全除(计算结果为正负无穷大时,返回0)
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <param name="decimals">保留的小数位(负数则不处理)</param>
|
||||
/// <returns></returns>
|
||||
public static double Division(double first, double second, int decimals = -1)
|
||||
{
|
||||
// double类型不能直接判断0,会有精度丢失
|
||||
// 而当除数=0时,计算结果=正负无穷大,并不会报错
|
||||
if (second == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
double result = first / second;
|
||||
result = double.IsInfinity(result) ? 0 : result;
|
||||
return decimals < 0 ? result : Math.Round(result, decimals);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 两个数据是否相等
|
||||
/// </summary>
|
||||
/// <param name="first"></param>
|
||||
/// <param name="second"></param>
|
||||
/// <param name="decimals">保留位数</param>
|
||||
/// <param name="threshold">阀值</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsEqual(decimal first, decimal second, int decimals = 2, decimal threshold = 0.001m)
|
||||
{
|
||||
return Math.Abs(Math.Round(first, decimals) - Math.Round(second, decimals)) <= threshold;
|
||||
}
|
||||
/// <summary>
|
||||
/// 向上取整
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <returns></returns>
|
||||
public static int Up(int first, int second)
|
||||
{
|
||||
decimal result = second == 0 ? 0 : (Convert.ToDecimal(first) / Convert.ToDecimal(second));
|
||||
//判断是否整除
|
||||
if (result.ToString().Contains("."))
|
||||
return (int)Math.Floor(result) + 1;
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 向上取整
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">除数</param>
|
||||
/// <returns></returns>
|
||||
public static int Up(double first, int second)
|
||||
{
|
||||
decimal result = second == 0 ? 0 : (Convert.ToDecimal(first) / Convert.ToDecimal(second));
|
||||
//判断是否整除
|
||||
if (result.ToString().Contains("."))
|
||||
return (int)Math.Floor(result) + 1;
|
||||
|
||||
return (int)result;
|
||||
}
|
||||
/// <summary>
|
||||
/// 向上取整
|
||||
/// </summary>
|
||||
/// <param name="first">被除数</param>
|
||||
/// <param name="second">数据</param>
|
||||
/// <returns></returns>
|
||||
public static int Up(decimal first, decimal second)
|
||||
{
|
||||
decimal result = second == 0 ? 0 : (Convert.ToDecimal(first) / Convert.ToDecimal(second));
|
||||
//判断是否整除
|
||||
if (!StringCheck(result.ToString()))
|
||||
{
|
||||
return (int)Math.Floor(result) + 1;
|
||||
}
|
||||
return (int)result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///判断最终结果,.Contains(".")作为判断依据是不对的,15.0000就会变成16,是错的
|
||||
/// </summary>
|
||||
/// <param name="result"></param>
|
||||
/// <returns></returns>
|
||||
public static bool StringCheck(string result)
|
||||
{
|
||||
string[] sArray = result.Split(".");
|
||||
if (sArray.Length >= 2)
|
||||
{
|
||||
Regex r;
|
||||
string pattern;
|
||||
pattern = @"1|2|3|4|5|6|7|8|9";
|
||||
r = new Regex(pattern);
|
||||
if (r.IsMatch(sArray[1]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using System.IO;
|
||||
|
||||
namespace JSMachine.WMS.Common.Helper
|
||||
{
|
||||
/// <summary>
|
||||
/// 日志文件帮助类
|
||||
/// </summary>
|
||||
public static class OperateLogs
|
||||
{
|
||||
/// <summary>
|
||||
/// 删除日志目录中超过配置保留期限的 .log 文件;NlogRecords 文件不会被删除。
|
||||
/// </summary>
|
||||
public static void DelLogs()
|
||||
{
|
||||
var delLogDelay = Global.AppSettings.DelLogDate;
|
||||
//获取文件夹下所有的文件
|
||||
var strFolderPath = AppDomain.CurrentDomain.BaseDirectory + "Logs\\";
|
||||
var dyInfo = new DirectoryInfo(strFolderPath);
|
||||
|
||||
if (dyInfo.Exists)
|
||||
{
|
||||
//获取文件夹下所有的文件
|
||||
foreach (FileInfo feInfo in dyInfo.GetFiles())
|
||||
{
|
||||
var fileName = feInfo.Name.Split('.')[0];
|
||||
|
||||
//判断文件日期是否小于,是则删除
|
||||
if (fileName != "NlogRecords" && Convert.ToDateTime(fileName) < DateTime.Now.AddDays(-delLogDelay))
|
||||
{
|
||||
if (feInfo.Extension == ".log")
|
||||
{
|
||||
feInfo.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,389 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace JSMachine.WMS.Common.Helper
|
||||
{
|
||||
public static class ValidatorHelper
|
||||
{
|
||||
//private static Regex RegNumber = new Regex("^[0-9]+$");//正整数
|
||||
|
||||
//private static Regex RegNumberSign = new Regex("^[+-]?[0-9]+$");//正负整数
|
||||
|
||||
//private static Regex RegDecimal = new Regex("^[0-9]+[.]?[0-9]+$");//小数
|
||||
|
||||
//private static Regex RegDecimalSign = new Regex("^[+-]?[0-9]+[.]?[0-9]+$"); //等价于^[+-]?\d+[.]?\d+$
|
||||
|
||||
//private static Regex RegEmail = new Regex("^[\\w-]+@[\\w-]+\\.(com|net|org|edu|mil|tv|biz|info)$");//w 英文字母或数字的字符串,和 [a-zA-Z0-9] 语法一样
|
||||
|
||||
//private static Regex RegChinese = new Regex("[\u4e00-\u9fa5]");//中文
|
||||
|
||||
//private static Regex RegUrl = new Regex("^http://([w-]+.)+[w-]+(/[w-./ %&=]*)$");//带http://的网址
|
||||
|
||||
//private static Regex RegTel = new Regex("^(\d{3}-\d{8})$|^(\d{4}-\d{7})$|^(\d{11})$");//国内电话号码 ,正确格式为:“XXXX-XXXXXXX”,“XXXX-XXXXXXXX”,“XXX-XXXXXXX”, “XXXXXXXXXXX”。
|
||||
|
||||
//private static Regex RegQQ = new Regex("^[1-9]*[1-9][0-9]*$");//匹配腾讯QQ号
|
||||
|
||||
//private static Regex RegIDCard = new Regex(@"(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[A-Z])$)|(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)");//匹配国内身份证号〕
|
||||
|
||||
//private static Regex RegUserName = new Regex(@"^[a-zA-Z]\w{5,15}$");//匹配由字母开头,数字、26个英文字母或者下划线组成6-16位的字符串
|
||||
|
||||
//private static Regex RegEnglish = new Regex("^[A-Za-z]+$");//由26个英文字母组成的字符串
|
||||
|
||||
//private static Regex RegTrim = new Regex(@"(^\s*)|(\s*$)");//首尾空格的行
|
||||
|
||||
//private static Regex RegTrimRow = new Regex(@"\n[\s| ]*\r");//空行
|
||||
|
||||
//private static Regex RegMobile = new Regex(@"^((\(\d{2,3}\))|(\d{3}\-))?1[3|5]\d{9}$");//国内手机
|
||||
|
||||
#region 对入库字符进行编码和转换。
|
||||
/// <summary>
|
||||
/// 对入库字符进行编码和转换
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string EncodeStr(string str)
|
||||
{
|
||||
|
||||
str = str.Replace("'", "’");
|
||||
|
||||
str = str.Replace("\"", """);
|
||||
|
||||
str = str.Replace("<", "<");
|
||||
|
||||
str = str.Replace(">", ">");
|
||||
|
||||
str = str.Replace("\n", "<br>");
|
||||
|
||||
return str;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 对出库字符进入显示时的转换。
|
||||
|
||||
/// <summary>
|
||||
/// 对出库字符进入显示时的转换
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <returns></returns>
|
||||
public static string DecodeStr(string str)
|
||||
{
|
||||
str = str.Replace("’", "'");
|
||||
|
||||
str = str.Replace(""", "\"");
|
||||
|
||||
str = str.Replace("<", "<");
|
||||
|
||||
str = str.Replace(">", ">");
|
||||
|
||||
str = str.Replace("<br>", "\n");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数字字符串检查
|
||||
/// <summary>
|
||||
/// 是否数字字符串
|
||||
/// </summary>
|
||||
/// <param name="inputData">输入字符串</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsNumber(string inputData)
|
||||
{
|
||||
Regex RegNumber = new Regex(@"^\+?[1-9][0-9]*$");//正整数
|
||||
|
||||
Match m = RegNumber.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否数字字符串 可带正负号
|
||||
/// </summary>
|
||||
/// <param name="inputData">输入字符串</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsNumberSign(string inputData)
|
||||
{
|
||||
Regex RegNumberSign = new Regex("^[+-]?[0-9]+$");//正负整数
|
||||
|
||||
Match m = RegNumberSign.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否是浮点数
|
||||
/// </summary>
|
||||
/// <param name="inputData">输入字符串</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsDecimal(string inputData)
|
||||
{
|
||||
Regex RegDecimal = new Regex("^[0-9]+[.]?[0-9]+$");//小数
|
||||
|
||||
Match m = RegDecimal.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 是否是浮点数 可带正负号
|
||||
/// </summary>
|
||||
/// <param name="inputData">输入字符串</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsDecimalSign(string inputData)
|
||||
{
|
||||
Regex RegDecimalSign = new Regex("^[+-]?[0-9]+[.]?[0-9]+$"); //等价于^[+-]?\d+[.]?\d+$
|
||||
|
||||
Match m = RegDecimalSign.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 正小数
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsReDecimal(string inputData)
|
||||
{
|
||||
Regex RegDecimal = new Regex("^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$");//小数
|
||||
|
||||
Match m = RegDecimal.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 中文检测
|
||||
/// <summary>
|
||||
/// 检测是否有中文字符
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsChinese(string inputData)
|
||||
{
|
||||
Regex RegChinese = new Regex("^[\u4e00-\u9fa5]+$");//中文
|
||||
|
||||
Match m = RegChinese.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 邮件地址
|
||||
/// <summary>
|
||||
/// 是否是邮件地址
|
||||
/// </summary>
|
||||
/// <param name="inputData">输入字符串</param>
|
||||
/// <returns></returns>
|
||||
public static bool IsEmail(string inputData)
|
||||
{
|
||||
Regex RegEmail = new Regex("^[\\w-]+@[\\w-]+\\.(com|net|org|edu|mil|tv|biz|info|cn)$");//w 英文字母或数字的字符串,和 [a-zA-Z0-9] 语法一样
|
||||
|
||||
Match m = RegEmail.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region URL网址
|
||||
/// <summary>
|
||||
/// 是否是带http://的网址
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsUrl(string inputData)
|
||||
{
|
||||
Regex RegUrl = new Regex("^http://([w-]+.)+[w-]+(/[w-./ %&=]*)$");//带http://的网址
|
||||
|
||||
Match m = RegUrl.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 固定电话
|
||||
/// <summary>
|
||||
/// 是否是国内电话号码
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsTel(string inputData)
|
||||
{
|
||||
Regex RegTel = new Regex(@"^(\d{3}-\d{8})$|^(\d{4}-\d{7})$|^(\d{11})$");//国内电话号码 ,正确格式为:“XXXX-XXXXXXX”,“XXXX-XXXXXXXX”,“XXX-XXXXXXX”, “XXX-XXXXXXXX”,“XXXXXXX”,“XXXXXXXX”。
|
||||
|
||||
Match m = RegTel.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region QQ
|
||||
/// <summary>
|
||||
/// 是否是QQ
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsQQ(string inputData)
|
||||
{
|
||||
Regex RegQQ = new Regex("^[1-9]*[1-9][0-9]*$");//匹配腾讯QQ号
|
||||
|
||||
Match m = RegQQ.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 身份证
|
||||
/// <summary>
|
||||
/// 是否是国内身份证号
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsIDCard(string inputData)
|
||||
{
|
||||
Regex RegIDCard = new Regex(@"(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[A-Z])$)|(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)");//匹配国内身份证号〕
|
||||
|
||||
Match m = RegIDCard.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 账号
|
||||
/// <summary>
|
||||
/// 账号是否合法,字母开头,数字、26个英文字母或者下划线组成6-16位的字符串
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsUserName(string inputData)
|
||||
{
|
||||
Regex RegUserName = new Regex(@"^[a-zA-Z]\w{5,15}$");//匹配由字母开头,数字、26个英文字母或者下划线组成6-16位的字符串
|
||||
|
||||
Match m = RegUserName.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 英文字母
|
||||
/// <summary>
|
||||
/// 是否是由26个英文字母组成的字符串
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsEnglish(string inputData)
|
||||
{
|
||||
Regex RegEnglish = new Regex("^[A-Za-z]+$");//由26个英文字母组成的字符串
|
||||
|
||||
Match m = RegEnglish.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 空行
|
||||
/// <summary>
|
||||
/// 是否有空行
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsTrimRow(string inputData)
|
||||
{
|
||||
Regex RegTrimRow = new Regex(@"\n[\s| ]*\r");//空行
|
||||
|
||||
Match m = RegTrimRow.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 手机
|
||||
/// <summary>
|
||||
/// 是否是国内手机
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsMobile(string inputData)
|
||||
{
|
||||
Regex RegMobile = new Regex(@"^((\(\d{2,3}\))|(\d{3}\-))?1[3|5]\d{9}$");//国内手机
|
||||
|
||||
Match m = RegMobile.Match(inputData);
|
||||
|
||||
return m.Success;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 日期
|
||||
/// <summary>
|
||||
/// 检查是否是日期
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsDate(string inputData)
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime.Parse(inputData);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 检查字符串最大长度,返回指定长度的串
|
||||
/// <summary>
|
||||
/// 检查字符串最大长度,返回指定长度的串
|
||||
/// </summary>
|
||||
/// <param name="sqlInput">输入字符串</param>
|
||||
/// <param name="maxLength">最大长度</param>
|
||||
/// <returns></returns>
|
||||
public static string SqlText(string sqlInput, int maxLength)
|
||||
{
|
||||
if (sqlInput != null && sqlInput != string.Empty)
|
||||
{
|
||||
sqlInput = sqlInput.Trim();
|
||||
|
||||
if (sqlInput.Length > maxLength)//按最大长度截取字符串
|
||||
|
||||
sqlInput = sqlInput.Substring(0, maxLength);
|
||||
}
|
||||
return sqlInput;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 空字符串
|
||||
/// <summary>
|
||||
/// 空字符串
|
||||
/// </summary>
|
||||
/// <param name="inputData"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsEmptyStr(string inputData)
|
||||
{
|
||||
var result = false;
|
||||
if (!string.IsNullOrEmpty(inputData))
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user