添加项目文件。

This commit is contained in:
jl
2023-01-13 15:30:20 +08:00
parent 40ed216831
commit bf208bde56
834 changed files with 470902 additions and 0 deletions

100
Epost.DAL/HistoryDataDAL.cs Normal file
View File

@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Epost.DAL
{
public class HistoryDataDAL
{
DataBaseOpration.OprationSqlDAL db = DB_DLL.GetInstance();
#region
public bool DeleteTable(string table)
{
//执行删除语句
string sql = "";
if (table == "Ordershis")
{
sql = "delete from Ordershis where state!=3";
}
else
{
sql = "delete from {0}";
sql = string.Format(sql, table);
}
//如果表中数据为空
string sql1 = "select count(*) from {0}";
sql1 = string.Format(sql1, table);
DataTable dt = db.GetsqlForDT(sql1);
int y = Convert.ToInt32(dt.Rows[0][0].ToString());
if (y == 0)
{
return true;
}
else
{
int x = db.InsertSql(sql);
if (x > 0)
{
return true;
}
else
{
return false;
}
}
}
#endregion
#region ()
public bool SaveTime(String table, string date)
{
int x = -1;
string sql = "alter proceduce proceduce_delete " +
"as delete from {0} where {1}<DATEADD(DAY,{2} GETDATE()) go " +
"Execute proceduce_delete";
if (table == "Error")
{
sql = string.Format(sql, table, "date", Convert.ToInt32(date) * (-1), "GETDATE()");
}
else if (table == "Orders")
{
sql = string.Format(sql, table, "downdate", Convert.ToInt32(date) * (-1), "GETDATE()");
}
//GetsqlForDT
x = db.InsertSql(sql);
if (x != -1)
{
return true;
}
else
{
return false;
}
}
#endregion
#region
public DataTable HistoryData()
{
string sql = "exec sys_viewtablespace";
DataTable dt = db.GetsqlForDT(sql);
return dt;
}
#endregion
}
}