123 lines
4.3 KiB
C#
123 lines
4.3 KiB
C#
using FineUIPro;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 消防设计审查验收管理
|
|
/// </summary>
|
|
public static class DesignreviewandacceptanceService
|
|
{
|
|
#region 获取列表
|
|
/// <summary>
|
|
/// 记录数
|
|
/// </summary>
|
|
public static int Count
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
public static IQueryable<Model.FireGasSafety_DesignReviewAndAcceptance> GetFireGasSafety_DesignReviewAndAcceptanceByModle(Model.FireGasSafety_DesignReviewAndAcceptance table)
|
|
{
|
|
var q = from x in Funs.DB.FireGasSafety_DesignReviewAndAcceptance
|
|
where
|
|
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
|
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
|
(string.IsNullOrEmpty(table.Code) || x.Code.Contains(table.Code)) &&
|
|
(string.IsNullOrEmpty(table.Name) || x.Name.Contains(table.Name)) &&
|
|
(string.IsNullOrEmpty(table.Content) || x.Content.Contains(table.Content)) &&
|
|
(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.FireGasSafety_DesignReviewAndAcceptance table, Grid grid1)
|
|
{
|
|
var q = GetFireGasSafety_DesignReviewAndAcceptanceByModle(table);
|
|
Count = q.Count();
|
|
if (Count == 0)
|
|
{
|
|
return null;
|
|
}
|
|
q = q.Skip(grid1.PageSize * grid1.PageIndex).Take(grid1.PageSize);
|
|
return from x in q
|
|
select new
|
|
{
|
|
x.Id,
|
|
x.ProjectId,
|
|
x.Code,
|
|
x.Name,
|
|
x.Content,
|
|
x.CompileMan,
|
|
x.CompileDate,
|
|
};
|
|
}
|
|
#endregion
|
|
|
|
public static Model.FireGasSafety_DesignReviewAndAcceptance GetById(string Id)
|
|
{
|
|
return Funs.DB.FireGasSafety_DesignReviewAndAcceptance.FirstOrDefault(x => x.Id == Id);
|
|
}
|
|
|
|
|
|
public static void Add(Model.FireGasSafety_DesignReviewAndAcceptance newtable)
|
|
{
|
|
|
|
Model.FireGasSafety_DesignReviewAndAcceptance table = new Model.FireGasSafety_DesignReviewAndAcceptance
|
|
{
|
|
Id = newtable.Id,
|
|
ProjectId = newtable.ProjectId,
|
|
Code = newtable.Code,
|
|
Name = newtable.Name,
|
|
Content = newtable.Content,
|
|
CompileMan = newtable.CompileMan,
|
|
CompileDate = newtable.CompileDate,
|
|
};
|
|
Funs.DB.FireGasSafety_DesignReviewAndAcceptance.InsertOnSubmit(table);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
|
|
public static void Update(Model.FireGasSafety_DesignReviewAndAcceptance newtable)
|
|
{
|
|
|
|
Model.FireGasSafety_DesignReviewAndAcceptance table = Funs.DB.FireGasSafety_DesignReviewAndAcceptance.FirstOrDefault(x => x.Id == newtable.Id);
|
|
if (table != null)
|
|
{
|
|
table.Id = newtable.Id;
|
|
table.ProjectId = newtable.ProjectId;
|
|
table.Code = newtable.Code;
|
|
table.Name = newtable.Name;
|
|
table.Content = newtable.Content;
|
|
table.CompileMan = newtable.CompileMan;
|
|
table.CompileDate = newtable.CompileDate;
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
}
|
|
public static void DeleteById(string Id)
|
|
{
|
|
|
|
Model.FireGasSafety_DesignReviewAndAcceptance table = Funs.DB.FireGasSafety_DesignReviewAndAcceptance.FirstOrDefault(x => x.Id == Id);
|
|
if (table != null)
|
|
{
|
|
Funs.DB.FireGasSafety_DesignReviewAndAcceptance.DeleteOnSubmit(table);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
} |