2023-11-16
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -87,62 +88,75 @@ namespace BLL
|
||||
|
||||
public static void AddProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
DefectName = newtable.DefectName,
|
||||
DefectNum = newtable.DefectNum,
|
||||
};
|
||||
db.Project_HJGLData_Defect.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Model.Project_HJGLData_Defect table = new Model.Project_HJGLData_Defect
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ProjectId = newtable.ProjectId,
|
||||
UnitId = newtable.UnitId,
|
||||
CollCropCode = newtable.CollCropCode,
|
||||
UnitName = newtable.UnitName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
DefectName = newtable.DefectName,
|
||||
DefectNum = newtable.DefectNum,
|
||||
};
|
||||
db.Project_HJGLData_Defect.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void UpdateProject_HJGLData_Defect(Model.Project_HJGLData_Defect newtable)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.CollCropCode = newtable.CollCropCode;
|
||||
table.UnitName = newtable.UnitName;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
table.DefectName = newtable.DefectName;
|
||||
table.DefectNum = newtable.DefectNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.CollCropCode = newtable.CollCropCode;
|
||||
table.UnitName = newtable.UnitName;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
table.DefectName = newtable.DefectName;
|
||||
table.DefectNum = newtable.DefectNum;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteProject_HJGLData_DefectById(string Id)
|
||||
{
|
||||
|
||||
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
db.Project_HJGLData_Defect.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Model.Project_HJGLData_Defect table = db.Project_HJGLData_Defect.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_Defect.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
public static void DeleteProject_HJGLData_DefectByDate(DateTime? reportDate, string projectid)
|
||||
{
|
||||
|
||||
var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
|
||||
if (table != null)
|
||||
using (var db = new SGGLDB(Funs.ConnString))
|
||||
{
|
||||
db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
var table = db.Project_HJGLData_Defect.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 && x.ProjectId == projectid);
|
||||
if (table != null)
|
||||
{
|
||||
db.Project_HJGLData_Defect.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 判断当天是否已统计数据
|
||||
|
||||
Reference in New Issue
Block a user