屠宰场管理服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

using BWP.B3ClientService.BO;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TSingSoft.WebPluginFramework.TimerTasks;
using TSingSoft.WebPluginFramework;
using Forks.EnterpriseServices.BusinessInterfaces;
using BWP.B3ClientService.BL;
namespace BWP.B3ClientService.Tasks
{
public class AutoCreateProductBatchTask : ITimerTask
{
public void Execute()
{
var exist = Exist();
if (exist)
return;
var bl = BIFactory.Create<IProductBatchBL>();
var entity = new ProductBatch();
bl.InitNewDmo(entity);
entity.Name = DateTime.Today.ToString("yyyyMMdd"); ;
entity.Date = DateTime.Today;
bl.Insert(entity);
}
bool Exist()
{
var query = new DQueryDom(new JoinAlias(typeof(ProductBatch)));
query.Where.Conditions.Add(DQCondition.EQ("Date", DateTime.Today));
return query.EExists();
}
public string Name
{
get { return "自动创建生产批次"; }
}
}
}