2023-08-04

This commit is contained in:
2023-08-04 17:06:50 +08:00
parent 70a51ab125
commit 78e8037f08
81 changed files with 8897 additions and 2763 deletions
@@ -87,12 +87,14 @@ namespace BLL
public static List<Model.SYHSEData_SYHSE> GetSYHSEData_SYHSEByModle(Model.SYHSEData_SYHSE table)
{
Model.SGGLDB db = Funs.DB;
var q = from x in db.SYHSEData_SYHSE
where
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.CollCropCode) || x.CollCropCode.Contains(table.CollCropCode)) &&
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName))
orderby x.ReportDate descending
select x
;
@@ -102,6 +104,7 @@ namespace BLL
public static void AddSYHSEData_SYHSE(Model.SYHSEData_SYHSE newtable)
{
Model.SGGLDB db = Funs.DB;
Model.SYHSEData_SYHSE table = new Model.SYHSEData_SYHSE
{
Id = newtable.Id,
@@ -153,6 +156,7 @@ namespace BLL
public static void DeleteSYHSEData_SYHSEById(string Id)
{
Model.SGGLDB db = Funs.DB;
Model.SYHSEData_SYHSE table = db.SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
@@ -269,6 +273,7 @@ namespace BLL
public static Model.SYHSEData_SYHSE GetSYHSEData_SYHSEById(string Id)
{
Model.SGGLDB db = Funs.DB;
return db.SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id);
}
@@ -278,7 +283,8 @@ namespace BLL
SYHSEData data = new SYHSEData();
if (q != null && q.State == Const.CNCEC_State_S)
{
data = GetItemBySyhseData_SYHSE(q);
// data = GetItemBySyhseData_SYHSE(q);
data = StatisticalData();
}
else
{
@@ -301,7 +307,7 @@ namespace BLL
q.State = Const.CNCEC_State_1;
UpdateSYHSEData_SYHSE(q);
}
}
public static bool IsReportByDate(DateTime dateTime)
{
@@ -344,7 +350,13 @@ namespace BLL
public static SYHSEData StatisticalData()
{
var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN);
string thisUnitId = string.Empty;
var thisUnit = CommonService.GetIsThisUnit();
if (thisUnit != null)
{
thisUnitId = thisUnit.UnitId;
}
var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId);
var ProjectData = (from x in Funs.DB.Project_SYHSEData_SYHSE
where x.ReportDate < DateTime.Now.AddDays(1).Date && x.ReportDate >= DateTime.Now.Date
select x).ToList();
@@ -352,7 +364,7 @@ namespace BLL
Model.SYHSEData_SYHSE table = new Model.SYHSEData_SYHSE
{
UnitId = BLL.Const.UnitId_SEDIN,
UnitId = thisUnitId,
CollCropCode = base_Unit.CollCropCode,
UnitName = base_Unit.UnitName,
ReportDate = DateTime.Now.Date,
@@ -412,6 +424,7 @@ namespace BLL
}
public static void UpdateSYHSEData_SYHSE(Model.SYHSEData_SYHSE newtable)
{
Model.SGGLDB db = Funs.DB;
Model.SYHSEData_SYHSE table = db.SYHSEData_SYHSE.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{