39 lines
961 B
C#
39 lines
961 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace EShangApiWisdom.Method
|
|
{
|
|
public class Common
|
|
{
|
|
/// <summary>
|
|
/// 判断是否是偶数
|
|
/// </summary>
|
|
/// <param name="n"></param>
|
|
/// <returns></returns>
|
|
|
|
public static bool IsOdd(int n)
|
|
{
|
|
return Convert.ToBoolean(n % 2 == 0);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 返回json数据结果对象
|
|
/// </summary>
|
|
/// <param name="code"></param>
|
|
/// <param name="msg"></param>
|
|
/// <param name="data"></param>
|
|
/// <returns></returns>
|
|
public static object ReturnJson(int code, string msg, object data = null)
|
|
{
|
|
Models.Result result = new Models.Result();
|
|
result.Result_Data = data;
|
|
result.Result_Code = code;
|
|
result.Result_Desc = msg;
|
|
|
|
return result;
|
|
}
|
|
|
|
}
|
|
} |