提交代码

This commit is contained in:
2024-12-25 15:43:38 +08:00
parent 0a2f9ea3a7
commit c0b489aaf4
79 changed files with 8536 additions and 1546 deletions
@@ -31,7 +31,7 @@ namespace BLL
(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)) &&
(string.IsNullOrEmpty(table.TypeName) || x.TypeName.Contains(table.TypeName))
(string.IsNullOrEmpty(table.TypeName) || x.TypeName.Contains(table.TypeName))
select x
;
@@ -51,7 +51,7 @@ namespace BLL
{
return null;
}
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
return from x in q
select new
{
@@ -82,62 +82,67 @@ namespace BLL
}
public static void AddHSSEData_HiddenDangerDetail(Model.HSSEData_HiddenDangerDetail newtable)
{
Model.HSSEData_HiddenDangerDetail table = new Model.HSSEData_HiddenDangerDetail
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
Id = newtable.Id,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
TypeName = newtable.TypeName,
TotalNum = newtable.TotalNum,
NeedRectifyNum = newtable.NeedRectifyNum,
};
db.HSSEData_HiddenDangerDetail.InsertOnSubmit(table);
db.SubmitChanges();
Model.HSSEData_HiddenDangerDetail table = new Model.HSSEData_HiddenDangerDetail
{
Id = newtable.Id,
UnitId = newtable.UnitId,
CollCropCode = newtable.CollCropCode,
UnitName = newtable.UnitName,
ReportDate = newtable.ReportDate,
TypeName = newtable.TypeName,
TotalNum = newtable.TotalNum,
NeedRectifyNum = newtable.NeedRectifyNum,
};
db.HSSEData_HiddenDangerDetail.InsertOnSubmit(table);
db.SubmitChanges();
}
}
public static void UpdateHSSEData_HiddenDangerDetail(Model.HSSEData_HiddenDangerDetail newtable)
{
Model.HSSEData_HiddenDangerDetail table = db.HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
table.Id = newtable.Id;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.TypeName = newtable.TypeName;
table.TotalNum = newtable.TotalNum;
table.NeedRectifyNum = newtable.NeedRectifyNum;
db.SubmitChanges();
Model.HSSEData_HiddenDangerDetail table = db.HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == newtable.Id);
if (table != null)
{
table.Id = newtable.Id;
table.UnitId = newtable.UnitId;
table.CollCropCode = newtable.CollCropCode;
table.UnitName = newtable.UnitName;
table.ReportDate = newtable.ReportDate;
table.TypeName = newtable.TypeName;
table.TotalNum = newtable.TotalNum;
table.NeedRectifyNum = newtable.NeedRectifyNum;
db.SubmitChanges();
}
}
}
public static void DeleteHSSEData_HiddenDangerDetailById(string Id)
{
Model.HSSEData_HiddenDangerDetail table = db.HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
db.HSSEData_HiddenDangerDetail.DeleteOnSubmit(table);
db.SubmitChanges();
Model.HSSEData_HiddenDangerDetail table = db.HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id);
if (table != null)
{
db.HSSEData_HiddenDangerDetail.DeleteOnSubmit(table);
db.SubmitChanges();
}
}
}
public static void DeleteHSSEData_HiddenDangerDetailByDate(DateTime? reportDate)
{
var table = db.HSSEData_HiddenDangerDetail.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
if (table != null)
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
{
db.HSSEData_HiddenDangerDetail.DeleteAllOnSubmit(table);
db.SubmitChanges();
var table = db.HSSEData_HiddenDangerDetail.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
if (table != null)
{
db.HSSEData_HiddenDangerDetail.DeleteAllOnSubmit(table);
db.SubmitChanges();
}
}
}
}