2023-08-31
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class PhtglContracttrackmatchwbsService
|
||||
{
|
||||
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int Count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.PHTGL_ContractTrackMatchWBS> GetPHTGL_ContractTrackMatchWBSByModle(Model.PHTGL_ContractTrackMatchWBS table)
|
||||
{
|
||||
var q = from x in Funs.DB.PHTGL_ContractTrackMatchWBS
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.ContractTrackId) || x.ContractTrackId.Contains(table.ContractTrackId)) &&
|
||||
(string.IsNullOrEmpty(table.ControlItemAndCycleId) || x.ControlItemAndCycleId.Contains(table.ControlItemAndCycleId))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable GetListData(Model.PHTGL_ContractTrackMatchWBS table, Grid grid1)
|
||||
{
|
||||
var q = GetPHTGL_ContractTrackMatchWBSByModle(table);
|
||||
Count = q.Count();
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.ContractTrackId,
|
||||
x.ControlItemAndCycleId,
|
||||
x.WorkPackageEstimate,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.PHTGL_ContractTrackMatchWBS GetPHTGL_ContractTrackMatchWBSById(string Id)
|
||||
{
|
||||
return Funs.DB.PHTGL_ContractTrackMatchWBS.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static void AddPHTGL_ContractTrackMatchWBS(Model.PHTGL_ContractTrackMatchWBS newtable)
|
||||
{
|
||||
|
||||
Model.PHTGL_ContractTrackMatchWBS table = new Model.PHTGL_ContractTrackMatchWBS
|
||||
{
|
||||
Id = newtable.Id,
|
||||
ContractTrackId = newtable.ContractTrackId,
|
||||
ControlItemAndCycleId = newtable.ControlItemAndCycleId,
|
||||
WorkPackageEstimate = newtable.WorkPackageEstimate,
|
||||
};
|
||||
Funs.DB.PHTGL_ContractTrackMatchWBS.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdatePHTGL_ContractTrackMatchWBS(Model.PHTGL_ContractTrackMatchWBS newtable)
|
||||
{
|
||||
|
||||
Model.PHTGL_ContractTrackMatchWBS table = Funs.DB.PHTGL_ContractTrackMatchWBS.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.ContractTrackId = newtable.ContractTrackId;
|
||||
table.ControlItemAndCycleId = newtable.ControlItemAndCycleId;
|
||||
table.WorkPackageEstimate = newtable.WorkPackageEstimate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteModelById(string Id)
|
||||
{
|
||||
|
||||
Model.PHTGL_ContractTrackMatchWBS table = Funs.DB.PHTGL_ContractTrackMatchWBS.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.PHTGL_ContractTrackMatchWBS.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteModelByContractTrackId(string ContractTrackId)
|
||||
{
|
||||
var table = Funs.DB.PHTGL_ContractTrackMatchWBS.Where(x =>
|
||||
x.ContractTrackId == ContractTrackId);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.PHTGL_ContractTrackMatchWBS.DeleteAllOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user