首次提交:添加src文件夹代码
This commit is contained in:
45
Cowain.Bake.BLL/ElectricEnergyService.cs
Normal file
45
Cowain.Bake.BLL/ElectricEnergyService.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using Cowain.Bake.Common.Interface;
|
||||
using Cowain.Bake.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Unity;
|
||||
|
||||
|
||||
|
||||
namespace Cowain.Bake.BLL
|
||||
{
|
||||
public class ElectricEnergyService:ServiceBase
|
||||
{
|
||||
public ElectricEnergyService(IUnityContainer unityContainer) : base(unityContainer)
|
||||
{
|
||||
}
|
||||
public DataTable GetYestodayEnergy()
|
||||
{
|
||||
string sql = $@"CALL ProcGetYestodayEnergy()";
|
||||
return GetDataTable(sql);
|
||||
}
|
||||
|
||||
public List<TElectricEnergy> Query(int maincheId, DateTime dtStart, DateTime dtEnd)
|
||||
{
|
||||
using (var Context = new BakingEntities())
|
||||
{
|
||||
return Context.Set<TElectricEnergy>().Where(x => x.CreateTime >= dtStart
|
||||
&& x.CreateTime <= dtEnd
|
||||
&& x.StationId == maincheId).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public int Insert(TElectricEnergy model)
|
||||
{
|
||||
using (var Context = new BakingEntities())
|
||||
{
|
||||
Context.Set<TElectricEnergy>().Add(model);
|
||||
return Context.SaveChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user