53 lines
1.7 KiB
Plaintext
Executable File
53 lines
1.7 KiB
Plaintext
Executable File
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace GXWebApi.Common
|
|
{
|
|
|
|
public static class WmsCommonFunction
|
|
{
|
|
|
|
public static T GetBodyData<T>(string jsonData)
|
|
{
|
|
T myBodyData = JsonConvert.DeserializeObject<T>(jsonData);
|
|
return myBodyData;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 更新或者插入功能使用次数
|
|
/// </summary>
|
|
/// <param name="FNumber"></param>
|
|
/// <param name="FName"></param>
|
|
public static void UpUserCount(string FNumber,string FName)
|
|
{
|
|
DBHelpe db = new DBHelpe();
|
|
|
|
DateTime now = DateTime.Now;
|
|
int year = now.Year;
|
|
int month = now.Month;
|
|
|
|
string SQL = $@"SELECT *
|
|
from T_Oth_DevelopmentInfo
|
|
WHERE FYear = {year} and FMonth = {month} and FNumber = '{FNumber}'";
|
|
string SQL1 = string.Empty;
|
|
DataTable dt = db.ExecuteTable(SQL);
|
|
if(dt != null && dt.Rows.Count > 0)
|
|
{
|
|
SQL1 = $@"UPDATE T_Oth_DevelopmentInfo set FCount = {Convert.ToInt32(dt.Rows[0]["FCount"]) + 1}
|
|
WHERE FYear = {year} and FMonth = {month} and FNumber = '{FNumber}'";
|
|
}
|
|
else
|
|
{
|
|
SQL1 = $@"INSERT into T_Oth_DevelopmentInfo(FYear,FMonth,FNumber,FName,FCount)
|
|
values ({year} ,{month},'{FNumber}','{FName}',1)";
|
|
}
|
|
db.ExecuteNonQuery(SQL1);
|
|
}
|
|
|
|
}
|
|
} |