2023-03-21 质量验收增加可编辑界面的资料验收
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class CheckMaterialacceptanceService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Check_MaterialAcceptance> GetCheck_MaterialAcceptanceByModle(Model.Check_MaterialAcceptance table)
|
||||
{
|
||||
var q = from x in db.Check_MaterialAcceptance
|
||||
where
|
||||
(string.IsNullOrEmpty(table.MaterialAcceptanceId) || x.MaterialAcceptanceId.Contains(table.MaterialAcceptanceId)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.PlanCode) || x.PlanCode.Contains(table.PlanCode)) &&
|
||||
(string.IsNullOrEmpty(table.FileName) || x.FileName.Contains(table.FileName)) &&
|
||||
(string.IsNullOrEmpty(table.CompileMan) || x.CompileMan.Contains(table.CompileMan)) &&
|
||||
(string.IsNullOrEmpty(table.State) || x.State.Contains(table.State)) &&
|
||||
(string.IsNullOrEmpty(table.FilePath) || x.FilePath.Contains(table.FilePath))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Check_MaterialAcceptance table, Grid Grid1)
|
||||
{
|
||||
var q = GetCheck_MaterialAcceptanceByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.MaterialAcceptanceId,
|
||||
x.ProjectId,
|
||||
x.PlanCode,
|
||||
x.FileName,
|
||||
x.CompileMan,
|
||||
x.CompileDate,
|
||||
x.State,
|
||||
x.FilePath,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Check_MaterialAcceptance GetCheck_MaterialAcceptanceById(string MaterialAcceptanceId)
|
||||
{
|
||||
return db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId);
|
||||
}
|
||||
|
||||
|
||||
public static void AddCheck_MaterialAcceptance(Model.Check_MaterialAcceptance newtable)
|
||||
{
|
||||
|
||||
Model.Check_MaterialAcceptance table = new Model.Check_MaterialAcceptance
|
||||
{
|
||||
MaterialAcceptanceId = newtable.MaterialAcceptanceId,
|
||||
ProjectId = newtable.ProjectId,
|
||||
PlanCode = newtable.PlanCode,
|
||||
FileName = newtable.FileName,
|
||||
CompileMan = newtable.CompileMan,
|
||||
CompileDate = newtable.CompileDate,
|
||||
State = newtable.State,
|
||||
FilePath = newtable.FilePath,
|
||||
};
|
||||
db.Check_MaterialAcceptance.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkCheck_MaterialAcceptance(List<Model.Check_MaterialAcceptance> newtables)
|
||||
{
|
||||
|
||||
db.Check_MaterialAcceptance.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateCheck_MaterialAcceptance(Model.Check_MaterialAcceptance newtable)
|
||||
{
|
||||
|
||||
Model.Check_MaterialAcceptance table = db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == newtable.MaterialAcceptanceId);
|
||||
if (table != null)
|
||||
{
|
||||
table.MaterialAcceptanceId = newtable.MaterialAcceptanceId;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
table.PlanCode = newtable.PlanCode;
|
||||
table.FileName = newtable.FileName;
|
||||
table.CompileMan = newtable.CompileMan;
|
||||
table.CompileDate = newtable.CompileDate;
|
||||
table.State = newtable.State;
|
||||
table.FilePath = newtable.FilePath;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteCheck_MaterialAcceptanceById(string MaterialAcceptanceId)
|
||||
{
|
||||
|
||||
Model.Check_MaterialAcceptance table = db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Check_MaterialAcceptance.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLCheck_MaterialAcceptance()
|
||||
{
|
||||
if (db.Check_MaterialAcceptance != null)
|
||||
{
|
||||
db.Check_MaterialAcceptance.DeleteAllOnSubmit(db.Check_MaterialAcceptance);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user