1
This commit is contained in:
@@ -0,0 +1,131 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class CheckActualmeasuredquantityService
|
||||
{
|
||||
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int Count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static IQueryable<Model.Check_ActualMeasuredQuantity> GetCheck_ActualMeasuredQuantityByModle(Model.Check_ActualMeasuredQuantity table)
|
||||
{
|
||||
var q = from x in Funs.DB.Check_ActualMeasuredQuantity
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.Projectid) || x.Projectid.Contains(table.Projectid)) &&
|
||||
(string.IsNullOrEmpty(table.MeasurementItem) || x.MeasurementItem.Contains(table.MeasurementItem)) &&
|
||||
(string.IsNullOrEmpty(table.MeasurementValue) || x.MeasurementValue.Contains(table.MeasurementValue)) &&
|
||||
(string.IsNullOrEmpty(table.MeasurementDevice) || x.MeasurementDevice.Contains(table.MeasurementDevice)) &&
|
||||
(string.IsNullOrEmpty(table.MeasurementPerson) || x.MeasurementPerson.Contains(table.MeasurementPerson)) &&
|
||||
(string.IsNullOrEmpty(table.CompileMan) || x.CompileMan.Contains(table.CompileMan))
|
||||
select x
|
||||
;
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
/// <param name="grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable GetListData(Model.Check_ActualMeasuredQuantity table, Grid grid1)
|
||||
{
|
||||
var q = GetCheck_ActualMeasuredQuantityByModle(table);
|
||||
Count = q.Count();
|
||||
if (Count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.Id,
|
||||
x.Projectid,
|
||||
x.MeasurementItem,
|
||||
x.MeasurementValue,
|
||||
x.MeasurementDevice,
|
||||
x.MeasurementPerson,
|
||||
x.CompileMan,
|
||||
x.CompileDate,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Check_ActualMeasuredQuantity GetCheck_ActualMeasuredQuantityById(string Id)
|
||||
{
|
||||
return Funs.DB.Check_ActualMeasuredQuantity.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static void AddCheck_ActualMeasuredQuantity(Model.Check_ActualMeasuredQuantity newtable)
|
||||
{
|
||||
|
||||
Model.Check_ActualMeasuredQuantity table = new Model.Check_ActualMeasuredQuantity
|
||||
{
|
||||
Id = newtable.Id,
|
||||
Projectid = newtable.Projectid,
|
||||
MeasurementItem = newtable.MeasurementItem,
|
||||
MeasurementValue = newtable.MeasurementValue,
|
||||
MeasurementDevice = newtable.MeasurementDevice,
|
||||
MeasurementPerson = newtable.MeasurementPerson,
|
||||
CompileMan = newtable.CompileMan,
|
||||
CompileDate = newtable.CompileDate,
|
||||
};
|
||||
Funs.DB.Check_ActualMeasuredQuantity.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateCheck_ActualMeasuredQuantity(Model.Check_ActualMeasuredQuantity newtable)
|
||||
{
|
||||
|
||||
Model.Check_ActualMeasuredQuantity table = Funs.DB.Check_ActualMeasuredQuantity.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.Projectid = newtable.Projectid;
|
||||
table.MeasurementItem = newtable.MeasurementItem;
|
||||
table.MeasurementValue = newtable.MeasurementValue;
|
||||
table.MeasurementDevice = newtable.MeasurementDevice;
|
||||
table.MeasurementPerson = newtable.MeasurementPerson;
|
||||
table.CompileMan = newtable.CompileMan;
|
||||
table.CompileDate = newtable.CompileDate;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteCheck_ActualMeasuredQuantityById(string Id)
|
||||
{
|
||||
|
||||
Model.Check_ActualMeasuredQuantity table = Funs.DB.Check_ActualMeasuredQuantity.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
Funs.DB.Check_ActualMeasuredQuantity.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user