You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB
C#

1 year ago
using Admin.Core.IRepository;
using Admin.Core.Service;
using Admin.Core.IService;
using Admin.Core.Model;
using System.Collections.Generic;
using System.Linq;
using System;
1 year ago
namespace Admin.Core.Service
{
public class LR_weighServices : BaseServices<LR_weigh>, ILR_weighServices
{
private readonly IBaseRepository<LR_weigh> _dal;
public LR_weighServices(IBaseRepository<LR_weigh> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
public List<LR_weigh> GetRecentWeightList(string MaterialName)
{
try
{
List<LR_weigh> list = _dal.Query(x => x.Material_Name == MaterialName).ToList();
if (list == null && list.Count == 0)
{
return new List<LR_weigh>();
}
int maxMainID = list.Max(x => x.MainId);
List<LR_weigh> groupList = list.Where(x => x.MainId == maxMainID).ToList();
return groupList;
}
catch
{
return new List<LR_weigh>();
}
}
1 year ago
}
}