using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ButcherFactory.BO.LocalBL
{
  public static class BLUtil
  {
    public static void DeleteLocalDb<T>()
      where T : SyncBill
    {
      var delete = new DQDeleteDom(typeof(T));
      delete.Where.Conditions.Add(DQCondition.And(DQCondition.LessThan("CreateTime", DateTime.Today.AddDays(-3)), DQCondition.EQ("Sync", true)));
      delete.EExecute();
    }

    public static void DeleteSaleOutStoreInfo<T>()
    {
      var delete = new DQDeleteDom(typeof(T));
      delete.Where.Conditions.Add(DQCondition.LessThan("Time", DateTime.Today.AddDays(-30)));
      delete.EExecute();
    }
  }
}
