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}