20220315 代码初始化上传

This commit is contained in:
2022-03-15 17:36:38 +08:00
commit 9dc8a7e05d
9501 changed files with 2066431 additions and 0 deletions
@@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 标准规范
/// </summary>
public static class ConstructionStandardListProjectService
{
/// <summary>
/// 根据项目标准规范清单Id获取一个项目标准规范清单信息
/// </summary>
/// <param name="standardCode">项目标准规范清单Id</param>
/// <returns>一个项目标准规范清单实体</returns>
public static Model.CQMS_Law_ConstructionStandardListProject GetConstructionStandardListProjectByStandardCode(int standardCode, string projectId)
{
return Funs.DB.CQMS_Law_ConstructionStandardListProject.FirstOrDefault(x => x.StandardCode == standardCode && x.ProjectId == projectId);
}
/// <summary>
/// 查询的项目标准规范信息的数量
/// </summary>
/// <returns>项目标准规范信息的数量</returns>
public static int GetCountConstructionStandardListProject(string projectId)
{
return (from x in Funs.DB.CQMS_Law_ConstructionStandardListProject where x.ProjectId == projectId select x).Count();
}
/// <summary>
/// 查询最大的项目标准规范序号
/// </summary>
/// <returns>最大的项目标准规范序号</returns>
public static int GetMaxStandardCode(string projectId)
{
return (from x in Funs.DB.CQMS_Law_ConstructionStandardListProject where x.ProjectId == projectId select x.StandardCode).Max();
}
/// <summary>
/// 增加项目标准规范清单信息
/// </summary>
/// <param name="ConstructionStandardListProject">项目标准规范清单实体</param>
public static void AddConstructionStandardListProject(Model.CQMS_Law_ConstructionStandardListProject ConstructionStandardListProject)
{
Model.CQMS_Law_ConstructionStandardListProject newConstructionStandardListProject = new Model.CQMS_Law_ConstructionStandardListProject();
newConstructionStandardListProject.StandardCode = ConstructionStandardListProject.StandardCode;
newConstructionStandardListProject.ProjectId = ConstructionStandardListProject.ProjectId;
newConstructionStandardListProject.StandardGrade = ConstructionStandardListProject.StandardGrade;
newConstructionStandardListProject.StandardNo = ConstructionStandardListProject.StandardNo;
newConstructionStandardListProject.StandardName = ConstructionStandardListProject.StandardName;
newConstructionStandardListProject.AttachUrl = ConstructionStandardListProject.AttachUrl;
newConstructionStandardListProject.Memo = ConstructionStandardListProject.Memo;
newConstructionStandardListProject.Status = ConstructionStandardListProject.Status;
newConstructionStandardListProject.ImpDate = ConstructionStandardListProject.ImpDate;
newConstructionStandardListProject.PubDate = ConstructionStandardListProject.PubDate;
newConstructionStandardListProject.UseLevel = ConstructionStandardListProject.UseLevel;
newConstructionStandardListProject.StandardType = ConstructionStandardListProject.StandardType;
newConstructionStandardListProject.ReplaceStandard = ConstructionStandardListProject.ReplaceStandard;
newConstructionStandardListProject.IsSelected1 = ConstructionStandardListProject.IsSelected1;
newConstructionStandardListProject.IsSelected2 = ConstructionStandardListProject.IsSelected2;
newConstructionStandardListProject.IsSelected3 = ConstructionStandardListProject.IsSelected3;
newConstructionStandardListProject.IsSelected4 = ConstructionStandardListProject.IsSelected4;
newConstructionStandardListProject.IsSelected5 = ConstructionStandardListProject.IsSelected5;
newConstructionStandardListProject.IsSelected6 = ConstructionStandardListProject.IsSelected6;
newConstructionStandardListProject.IsSelected7 = ConstructionStandardListProject.IsSelected7;
newConstructionStandardListProject.IsSelected8 = ConstructionStandardListProject.IsSelected8;
newConstructionStandardListProject.IsSelected9 = ConstructionStandardListProject.IsSelected9;
newConstructionStandardListProject.IsSelected10 = ConstructionStandardListProject.IsSelected10;
Funs.DB.CQMS_Law_ConstructionStandardListProject.InsertOnSubmit(newConstructionStandardListProject);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改项目标准规范清单信息
/// </summary>
/// <param name="ConstructionStandardListProject">项目标准规范清单实体</param>
public static void UpdateConstructionStandardListProject(Model.CQMS_Law_ConstructionStandardListProject ConstructionStandardListProject)
{
Model.CQMS_Law_ConstructionStandardListProject newConstructionStandardListProject = Funs.DB.CQMS_Law_ConstructionStandardListProject.FirstOrDefault(e => e.StandardCode == ConstructionStandardListProject.StandardCode && e.ProjectId == ConstructionStandardListProject.ProjectId);
if (newConstructionStandardListProject != null)
{
newConstructionStandardListProject.StandardGrade = ConstructionStandardListProject.StandardGrade;
newConstructionStandardListProject.StandardNo = ConstructionStandardListProject.StandardNo;
newConstructionStandardListProject.StandardName = ConstructionStandardListProject.StandardName;
newConstructionStandardListProject.AttachUrl = ConstructionStandardListProject.AttachUrl;
newConstructionStandardListProject.Memo = ConstructionStandardListProject.Memo;
newConstructionStandardListProject.Status = ConstructionStandardListProject.Status;
newConstructionStandardListProject.ImpDate = ConstructionStandardListProject.ImpDate;
newConstructionStandardListProject.PubDate = ConstructionStandardListProject.PubDate;
newConstructionStandardListProject.UseLevel = ConstructionStandardListProject.UseLevel;
newConstructionStandardListProject.StandardType = ConstructionStandardListProject.StandardType;
newConstructionStandardListProject.ReplaceStandard = ConstructionStandardListProject.ReplaceStandard;
newConstructionStandardListProject.IsSelected1 = ConstructionStandardListProject.IsSelected1;
newConstructionStandardListProject.IsSelected2 = ConstructionStandardListProject.IsSelected2;
newConstructionStandardListProject.IsSelected3 = ConstructionStandardListProject.IsSelected3;
newConstructionStandardListProject.IsSelected4 = ConstructionStandardListProject.IsSelected4;
newConstructionStandardListProject.IsSelected5 = ConstructionStandardListProject.IsSelected5;
newConstructionStandardListProject.IsSelected6 = ConstructionStandardListProject.IsSelected6;
newConstructionStandardListProject.IsSelected7 = ConstructionStandardListProject.IsSelected7;
newConstructionStandardListProject.IsSelected8 = ConstructionStandardListProject.IsSelected8;
newConstructionStandardListProject.IsSelected9 = ConstructionStandardListProject.IsSelected9;
newConstructionStandardListProject.IsSelected10 = ConstructionStandardListProject.IsSelected10;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据项目标准规范清单Id删除一个项目标准规范清单信息
/// </summary>
/// <param name="standardCode">项目标准规范清单Id</param>
public static void DeleteConstructionStandardListProject(int standardCode, string projectId)
{
Model.CQMS_Law_ConstructionStandardListProject ConstructionStandardListProject = Funs.DB.CQMS_Law_ConstructionStandardListProject.First(e => e.StandardCode == standardCode && e.ProjectId == projectId);
if (ConstructionStandardListProject != null)
{
Funs.DB.CQMS_Law_ConstructionStandardListProject.DeleteOnSubmit(ConstructionStandardListProject);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据项目ID删除所有标准规范
/// </summary>
/// <param name="projectId"></param>
public static void DeleteConstructionStandardListByProjectId(string projectId)
{
var ConstructionStandardList = from x in Funs.DB.CQMS_Law_ConstructionStandardListProject where x.ProjectId == projectId select x;
if (ConstructionStandardList != null)
{
Funs.DB.CQMS_Law_ConstructionStandardListProject.DeleteAllOnSubmit(ConstructionStandardList);
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据项目信息获取项目标准规范标准级别列表
/// </summary>
/// <param name="projectId"></param>
/// <returns></returns>
public static List<string> GetStandardGradeDistinctList(string projectId)
{
return ((from x in Funs.DB.CQMS_Law_ConstructionStandardListProject where x.ProjectId == projectId orderby x.StandardGrade select x.StandardGrade).Distinct()).ToList();
}
}
}
@@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
namespace BLL
{
/// <summary>
/// 施工标准规范
/// </summary>
public static class ConstructionStandardListService
{
/// <summary>
/// 根据标准规范清单Id获取一个标准规范清单信息
/// </summary>
/// <param name="standardCode">标准规范清单Id</param>
/// <returns>一个标准规范清单实体</returns>
public static Model.CQMS_Law_ConstructionStandardList GetConstructionStandardListByStandardCode(int standardCode)
{
return Funs.DB.CQMS_Law_ConstructionStandardList.FirstOrDefault(x => x.StandardCode == standardCode);
}
/// <summary>
/// 查询的标准规范信息的数量
/// </summary>
/// <returns>标准规范信息的数量</returns>
public static int GetCountConstructionStandardList()
{
return (from x in Funs.DB.CQMS_Law_ConstructionStandardList select x).Count();
}
/// <summary>
/// 查询最大的标准规范序号
/// </summary>
/// <returns>最大的标准规范序号</returns>
public static int GetMaxStandardCode()
{
return (from x in Funs.DB.CQMS_Law_ConstructionStandardList select x.StandardCode).Max();
}
/// <summary>
/// 增加标准规范清单信息
/// </summary>
/// <param name="ConstructionStandardList">标准规范清单实体</param>
public static void AddConstructionStandardList(Model.CQMS_Law_ConstructionStandardList ConstructionStandardList)
{
Model.CQMS_Law_ConstructionStandardList newConstructionStandardList = new Model.CQMS_Law_ConstructionStandardList();
newConstructionStandardList.StandardCode = ConstructionStandardList.StandardCode;
newConstructionStandardList.StandardGrade = ConstructionStandardList.StandardGrade;
newConstructionStandardList.StandardNo = ConstructionStandardList.StandardNo;
newConstructionStandardList.StandardName = ConstructionStandardList.StandardName;
newConstructionStandardList.AttachUrl = ConstructionStandardList.AttachUrl;
newConstructionStandardList.Memo = ConstructionStandardList.Memo;
newConstructionStandardList.Status = ConstructionStandardList.Status;
newConstructionStandardList.ImpDate = ConstructionStandardList.ImpDate;
newConstructionStandardList.PubDate = ConstructionStandardList.PubDate;
newConstructionStandardList.UseLevel = ConstructionStandardList.UseLevel;
newConstructionStandardList.StandardType = ConstructionStandardList.StandardType;
newConstructionStandardList.ReplaceStandard = ConstructionStandardList.ReplaceStandard;
newConstructionStandardList.IsSelected1 = ConstructionStandardList.IsSelected1;
newConstructionStandardList.IsSelected2 = ConstructionStandardList.IsSelected2;
newConstructionStandardList.IsSelected3 = ConstructionStandardList.IsSelected3;
newConstructionStandardList.IsSelected4 = ConstructionStandardList.IsSelected4;
newConstructionStandardList.IsSelected5 = ConstructionStandardList.IsSelected5;
newConstructionStandardList.IsSelected6 = ConstructionStandardList.IsSelected6;
newConstructionStandardList.IsSelected7 = ConstructionStandardList.IsSelected7;
newConstructionStandardList.IsSelected8 = ConstructionStandardList.IsSelected8;
newConstructionStandardList.IsSelected9 = ConstructionStandardList.IsSelected9;
newConstructionStandardList.IsSelected10 = ConstructionStandardList.IsSelected10;
Funs.DB.CQMS_Law_ConstructionStandardList.InsertOnSubmit(newConstructionStandardList);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改标准规范清单信息
/// </summary>
/// <param name="ConstructionStandardList">标准规范清单实体</param>
public static void UpdateConstructionStandardList(Model.CQMS_Law_ConstructionStandardList ConstructionStandardList)
{
Model.CQMS_Law_ConstructionStandardList newConstructionStandardList = Funs.DB.CQMS_Law_ConstructionStandardList.FirstOrDefault(e => e.StandardCode == ConstructionStandardList.StandardCode);
if (newConstructionStandardList != null)
{
newConstructionStandardList.StandardGrade = ConstructionStandardList.StandardGrade;
newConstructionStandardList.StandardNo = ConstructionStandardList.StandardNo;
newConstructionStandardList.StandardName = ConstructionStandardList.StandardName;
newConstructionStandardList.AttachUrl = ConstructionStandardList.AttachUrl;
newConstructionStandardList.Memo = ConstructionStandardList.Memo;
newConstructionStandardList.Status = ConstructionStandardList.Status;
newConstructionStandardList.ImpDate = ConstructionStandardList.ImpDate;
newConstructionStandardList.PubDate = ConstructionStandardList.PubDate;
newConstructionStandardList.UseLevel = ConstructionStandardList.UseLevel;
newConstructionStandardList.StandardType = ConstructionStandardList.StandardType;
newConstructionStandardList.ReplaceStandard = ConstructionStandardList.ReplaceStandard;
newConstructionStandardList.IsSelected1 = ConstructionStandardList.IsSelected1;
newConstructionStandardList.IsSelected2 = ConstructionStandardList.IsSelected2;
newConstructionStandardList.IsSelected3 = ConstructionStandardList.IsSelected3;
newConstructionStandardList.IsSelected4 = ConstructionStandardList.IsSelected4;
newConstructionStandardList.IsSelected5 = ConstructionStandardList.IsSelected5;
newConstructionStandardList.IsSelected6 = ConstructionStandardList.IsSelected6;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据标准规范清单Id删除一个标准规范清单信息
/// </summary>
/// <param name="standardCode">标准规范清单Id</param>
public static void DeleteConstructionStandardList(int standardCode)
{
Model.CQMS_Law_ConstructionStandardList ConstructionStandardList = Funs.DB.CQMS_Law_ConstructionStandardList.FirstOrDefault(e => e.StandardCode == standardCode);
if (ConstructionStandardList != null)
{
Funs.DB.CQMS_Law_ConstructionStandardList.DeleteOnSubmit(ConstructionStandardList);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,212 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Web.UI.WebControls;
namespace BLL
{
public class DataTypeProjectService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 记录数
/// </summary>
public static int count
{
get;
set;
}
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.DataBase_DataTypeProject> qq = from x in db.DataBase_DataTypeProject orderby x.SortIndex select x;
/// <summary>
/// 获取项目列表
/// </summary>
/// <param name="searchItem"></param>
/// <param name="searchValue"></param>
/// <param name="startRowIndex"></param>
/// <param name="maximumRows"></param>
/// <returns></returns>
public static IEnumerable getListData(int startRowIndex, int maximumRows)
{
IQueryable<Model.DataBase_DataTypeProject> q = qq;
count = q.Count();
if (count == 0)
{
return new object[] { "" };
}
return from x in q.Skip(startRowIndex).Take(maximumRows)
select new
{
x.DataTypeProjectId,
x.DataTypeCode,
x.DataTypeName,
x.Remark,
};
}
/// <summary>
/// 获取列表数
/// </summary>
/// <param name="searchItem"></param>
/// <param name="searchValue"></param>
/// <returns></returns>
public static int getListCount()
{
return count;
}
/// <summary>
/// 添加资料库类别
/// </summary>
/// <param name="Installation"></param>
public static void AddDataTypeProject(Model.DataBase_DataTypeProject dataTypeProject)
{
Model.SGGLDB db = Funs.DB;
Model.DataBase_DataTypeProject newDataTypeProject = new Model.DataBase_DataTypeProject();
newDataTypeProject.DataTypeProjectId = dataTypeProject.DataTypeProjectId;
newDataTypeProject.ProjectId = dataTypeProject.ProjectId;
newDataTypeProject.DataTypeCode = dataTypeProject.DataTypeCode;
newDataTypeProject.DataTypeName = dataTypeProject.DataTypeName;
newDataTypeProject.SuperDataTypeId = dataTypeProject.SuperDataTypeId;
newDataTypeProject.SortIndex = dataTypeProject.SortIndex;
newDataTypeProject.Pages = dataTypeProject.Pages;
newDataTypeProject.Remark = dataTypeProject.Remark;
newDataTypeProject.IsRelatedWBS = dataTypeProject.IsRelatedWBS;
newDataTypeProject.SourceDataTypeId = dataTypeProject.SourceDataTypeId;
newDataTypeProject.UnitWorkId = dataTypeProject.UnitWorkId;
db.DataBase_DataTypeProject.InsertOnSubmit(newDataTypeProject);
db.SubmitChanges();
}
/// <summary>
/// 修改资料库类别
/// </summary>
/// <param name="dataTypeProject"></param>
public static void UpdateDataTypeProject(Model.DataBase_DataTypeProject dataTypeProject)
{
Model.SGGLDB db = Funs.DB;
Model.DataBase_DataTypeProject newDataTypeProject = db.DataBase_DataTypeProject.First(e => e.DataTypeProjectId == dataTypeProject.DataTypeProjectId);
newDataTypeProject.DataTypeCode = dataTypeProject.DataTypeCode;
newDataTypeProject.DataTypeName = dataTypeProject.DataTypeName;
newDataTypeProject.SuperDataTypeId = dataTypeProject.SuperDataTypeId;
newDataTypeProject.SortIndex = dataTypeProject.SortIndex;
newDataTypeProject.Pages = dataTypeProject.Pages;
newDataTypeProject.Remark = dataTypeProject.Remark;
newDataTypeProject.IsRelatedWBS = dataTypeProject.IsRelatedWBS;
newDataTypeProject.SourceDataTypeId = dataTypeProject.SourceDataTypeId;
newDataTypeProject.UnitWorkId = dataTypeProject.UnitWorkId;
db.SubmitChanges();
}
/// <summary>
/// 根据一个资料库类别信息
/// </summary>
/// <param name="dataTypeProjectCode"></param>
public static void DeleteDataTypeProject(string dataTypeProjectId)
{
Model.SGGLDB db = Funs.DB;
Model.DataBase_DataTypeProject dataTypeProject = db.DataBase_DataTypeProject.First(e => e.DataTypeProjectId == dataTypeProjectId);
db.DataBase_DataTypeProject.DeleteOnSubmit(dataTypeProject);
db.SubmitChanges();
}
/// <summary>
/// 根据一个上级资料库类别Id删除所有对应资料库类别信息
/// </summary>
/// <param name="dataTypeProjectCode"></param>
public static void DeleteAllDataTypeProject(string dataTypeProjectId)
{
Model.SGGLDB db = Funs.DB;
var q = from x in db.DataBase_DataTypeProject where x.SuperDataTypeId == dataTypeProjectId select x;
db.DataBase_DataTypeProject.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
/// <summary>
/// 获取施工资料库类别项
/// </summary>
/// <returns></returns>
public static ListItem[] GetDataTypeProjectNameList()
{
var q = (from x in Funs.DB.DataBase_DataTypeProject orderby x.SortIndex select x).ToList();
ListItem[] list = new ListItem[q.Count()];
for (int i = 0; i < q.Count(); i++)
{
list[i] = new ListItem(q[i].DataTypeName ?? "", q[i].DataTypeProjectId.ToString());
}
return list;
}
/// <summary>
/// 根据主键返回一个资料库类别信息
/// </summary>
/// <param name="cnProfessionalCode">资料库类别编号</param>
/// <returns></returns>
public static Model.DataBase_DataTypeProject GetDataTypeProjectById(string dataTypeProjectId)
{
return Funs.DB.DataBase_DataTypeProject.FirstOrDefault(x => x.DataTypeProjectId == dataTypeProjectId);
}
/// <summary>
/// 根据原主键返回一个资料库类别信息
/// </summary>
/// <param name="sourceDataTypeId"></param>
/// <returns></returns>
public static Model.DataBase_DataTypeProject GetDataTypeProjectBySourceDataTypeId(string sourceDataTypeId, string projectId)
{
return Funs.DB.DataBase_DataTypeProject.FirstOrDefault(x => x.SourceDataTypeId == sourceDataTypeId && x.ProjectId == projectId);
}
/// <summary>
/// 根据父级Id返回所有资料库类别信息
/// </summary>
/// <param name="superDataTypeProjectId">资料库类别编号</param>
/// <returns></returns>
public static List<Model.DataBase_DataTypeProject> GetDataTypeProjectsBySuperDataTypeProjectId(string superDataTypeId)
{
return (from x in Funs.DB.DataBase_DataTypeProject where x.SuperDataTypeId == superDataTypeId select x).ToList();
}
/// <summary>
/// 判断资料库类别编号是否存在
/// </summary>
/// <param name="dataTypeProjectCode"></param>
/// <returns></returns>
public static bool IsExistDataTypeProjectCode(string dataTypeCode, string dataTypeProjectId)
{
Model.DataBase_DataTypeProject m = Funs.DB.DataBase_DataTypeProject.FirstOrDefault(e => e.DataTypeCode == dataTypeCode && e.DataTypeProjectId != dataTypeProjectId);
if (m != null)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// 判断资料库类别名称是否存在
/// </summary>
/// <param name="professionalName"></param>
/// <returns></returns>
public static bool IsExistProfessionalName(string dataTypeName, string dataTypeProjectId)
{
Model.DataBase_DataTypeProject m = Funs.DB.DataBase_DataTypeProject.FirstOrDefault(e => e.DataTypeName == dataTypeName && e.DataTypeProjectId != dataTypeProjectId);
if (m != null)
{
return true;
}
else
{
return false;
}
}
}
}
+88
View File
@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 资料库维护
/// </summary>
public static class DataTypeService
{
/// <summary>
/// 根据主键返回一个资料库类别信息
/// </summary>
/// <param name="cnProfessionalCode">资料库类别编号</param>
/// <returns></returns>
public static Model.DataBase_DataType GetDataTypeById(string dataTypeId)
{
return Funs.DB.DataBase_DataType.FirstOrDefault(x => x.DataTypeId == dataTypeId);
}
/// <summary>
/// 根据父级Id返回所有资料库类别信息
/// </summary>
/// <param name="superDataTypeId">资料库类别编号</param>
/// <returns></returns>
public static List<Model.DataBase_DataType> GetDataTypesBySuperDataTypeId(string superDataTypeId)
{
return (from x in Funs.DB.DataBase_DataType where x.SuperDataTypeId == superDataTypeId select x).ToList();
}
/// <summary>
/// 添加资料库类别
/// </summary>
/// <param name="Installation"></param>
public static void AddDataType(Model.DataBase_DataType dataType)
{
Model.DataBase_DataType newDataType = new Model.DataBase_DataType();
newDataType.DataTypeId = dataType.DataTypeId;
newDataType.DataTypeCode = dataType.DataTypeCode;
newDataType.DataTypeName = dataType.DataTypeName;
newDataType.SuperDataTypeId = dataType.SuperDataTypeId;
newDataType.SortIndex = dataType.SortIndex;
newDataType.Pages = dataType.Pages;
newDataType.Remark = dataType.Remark;
newDataType.IsRelatedWBS = dataType.IsRelatedWBS;
Funs.DB.DataBase_DataType.InsertOnSubmit(newDataType);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改资料库类别
/// </summary>
/// <param name="dataType"></param>
public static void UpdateDataType(Model.DataBase_DataType dataType)
{
Model.DataBase_DataType newDataType = Funs.DB.DataBase_DataType.FirstOrDefault(e => e.DataTypeId == dataType.DataTypeId);
if (newDataType != null)
{
newDataType.DataTypeCode = dataType.DataTypeCode;
newDataType.DataTypeName = dataType.DataTypeName;
newDataType.SuperDataTypeId = dataType.SuperDataTypeId;
newDataType.SortIndex = dataType.SortIndex;
newDataType.Pages = dataType.Pages;
newDataType.Remark = dataType.Remark;
newDataType.IsRelatedWBS = dataType.IsRelatedWBS;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除资料库类别信息
/// </summary>
/// <param name="dataTypeCode"></param>
public static void DeleteDataTypeById(string dataTypeId)
{
Model.DataBase_DataType dataType = Funs.DB.DataBase_DataType.FirstOrDefault(e => e.DataTypeId == dataTypeId);
if (dataType != null)
{
Funs.DB.DataBase_DataType.DeleteOnSubmit(dataType);
Funs.DB.SubmitChanges();
}
}
}
}
+100
View File
@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class FileService
{
/// <summary>
/// 根据主键返回一个文件信息
/// </summary>
/// <param name="cnProfessionalCode">文件编号</param>
/// <returns></returns>
public static Model.DataBase_File GetFileById(string fileId)
{
return Funs.DB.DataBase_File.FirstOrDefault(x => x.FileId == fileId);
}
/// <summary>
/// 根据子分部Id返回所有文件信息
/// </summary>
/// <param name="cnProfessionalCode">文件编号</param>
/// <returns></returns>
public static List<Model.DataBase_File> GetFilesByDataTypeProjectId(string dataTypeProjectId)
{
return (from x in Funs.DB.DataBase_File where x.DataTypeProjectId == dataTypeProjectId select x).ToList();
}
/// <summary>
/// 添加文件
/// </summary>
/// <param name="Installation"></param>
public static void AddFile(Model.DataBase_File file)
{
Model.DataBase_File newFile = new Model.DataBase_File();
newFile.FileId = file.FileId;
newFile.ProjectId = file.ProjectId;
newFile.DataTypeProjectId = file.DataTypeProjectId;
newFile.FileCode = file.FileCode;
newFile.FileName = file.FileName;
newFile.Pages = file.Pages;
newFile.Remark = file.Remark;
newFile.CompileDate = file.CompileDate;
newFile.CompileMan = file.CompileMan;
newFile.AttachUrl = file.AttachUrl;
newFile.UnitWorkId = file.UnitWorkId;
newFile.DivisionProjectId = file.DivisionProjectId;
newFile.UnitId = file.UnitId;
newFile.FileType = file.FileType;
Funs.DB.DataBase_File.InsertOnSubmit(newFile);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改文件
/// </summary>
/// <param name="file"></param>
public static void UpdateFile(Model.DataBase_File file)
{
Model.DataBase_File newFile = Funs.DB.DataBase_File.FirstOrDefault(e => e.FileId == file.FileId);
if (newFile != null)
{
//newFile.DataTypeProjectId = file.DataTypeProjectId;
newFile.FileCode = file.FileCode;
newFile.FileName = file.FileName;
newFile.Pages = file.Pages;
newFile.Remark = file.Remark;
//newFile.CompileDate = file.CompileDate;
//newFile.CompileMan = file.CompileMan;
newFile.AttachUrl = file.AttachUrl;
//newFile.UnitWorkId = file.UnitWorkId;
//newFile.DivisionProjectId = file.DivisionProjectId;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除一个文件信息
/// </summary>
/// <param name="breakdownCode"></param>
public static void DeleteFileById(string fileId)
{
Model.DataBase_File file = Funs.DB.DataBase_File.FirstOrDefault(e => e.FileId == fileId);
if (file != null)
{
if (!string.IsNullOrEmpty(file.AttachUrl))
{
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, file.AttachUrl);//删除附件
}
Funs.DB.DataBase_File.DeleteOnSubmit(file);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 检验批表格库
/// </summary>
public static class InspectionLotService
{
/// <summary>
/// 根据主键获取检验批信息
/// </summary>
/// <param name="generalPlanApprovalId"></param>
/// <returns></returns>
public static Model.CQMS_DataBase_InspectionLot GetInspectionLotById(string inspectionLotId)
{
return Funs.DB.CQMS_DataBase_InspectionLot.FirstOrDefault(e => e.InspectionLotId == inspectionLotId);
}
/// <summary>
/// 添加检验批信息
/// </summary>
/// <param name="inspectionLot"></param>
public static void AddInspectionLot(Model.CQMS_DataBase_InspectionLot inspectionLot)
{
Model.CQMS_DataBase_InspectionLot newInspectionLot = new Model.CQMS_DataBase_InspectionLot();
newInspectionLot.InspectionLotId = inspectionLot.InspectionLotId;
newInspectionLot.CNProfessionalId = inspectionLot.CNProfessionalId;
newInspectionLot.InspectionLotName = inspectionLot.InspectionLotName;
newInspectionLot.CNProfessionaType = inspectionLot.CNProfessionaType;
newInspectionLot.FileUpload = inspectionLot.FileUpload;
Funs.DB.CQMS_DataBase_InspectionLot.InsertOnSubmit(newInspectionLot);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改检验批信息
/// </summary>
/// <param name="generalPlanApproval"></param>
public static void UpdateInspectionLot(Model.CQMS_DataBase_InspectionLot inspectionLot)
{
Model.CQMS_DataBase_InspectionLot newInspectionLot = Funs.DB.CQMS_DataBase_InspectionLot.FirstOrDefault(e => e.InspectionLotId == inspectionLot.InspectionLotId);
if (newInspectionLot != null)
{
newInspectionLot.CNProfessionalId = inspectionLot.CNProfessionalId;
newInspectionLot.InspectionLotName = inspectionLot.InspectionLotName;
newInspectionLot.CNProfessionaType = inspectionLot.CNProfessionaType;
newInspectionLot.FileUpload = inspectionLot.FileUpload;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除检验批信息
/// </summary>
/// <param name="generalPlanApprovalId"></param>
public static void DeleteInspectionLotById(string inspectionLotId)
{
Model.CQMS_DataBase_InspectionLot inspectionLot = Funs.DB.CQMS_DataBase_InspectionLot.FirstOrDefault(e => e.InspectionLotId == inspectionLotId);
if (inspectionLot != null)
{
if (!string.IsNullOrEmpty(inspectionLot.FileUpload))
{
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, inspectionLot.FileUpload);//删除附件
}
Funs.DB.CQMS_DataBase_InspectionLot.DeleteOnSubmit(inspectionLot);
Funs.DB.SubmitChanges();
}
}
}
}
+82
View File
@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public static class PhotoService
{
/// <summary>
/// 根据主键返回一个照片信息
/// </summary>
/// <param name="cnProfessionalCode">文件编号</param>
/// <returns></returns>
public static Model.DataBase_Photo GetPhotoById(string photoId)
{
return Funs.DB.DataBase_Photo.FirstOrDefault(x => x.PhotoId == photoId);
}
/// <summary>
/// 添加照片
/// </summary>
/// <param name="Installation"></param>
public static void AddPhoto(Model.DataBase_Photo photo)
{
Model.DataBase_Photo newPhoto = new Model.DataBase_Photo();
newPhoto.PhotoId = photo.PhotoId;
newPhoto.ProjectId = photo.ProjectId;
newPhoto.PhotoType = photo.PhotoType;
newPhoto.Date = photo.Date;
newPhoto.Place = photo.Place;
newPhoto.Person = photo.Person;
newPhoto.Subject = photo.Subject;
newPhoto.Background = photo.Background;
newPhoto.Photographer = photo.Photographer;
newPhoto.AttachUrl = photo.AttachUrl;
Funs.DB.DataBase_Photo.InsertOnSubmit(newPhoto);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改照片
/// </summary>
/// <param name="photo"></param>
public static void UpdatePhoto(Model.DataBase_Photo photo)
{
Model.DataBase_Photo newPhoto = Funs.DB.DataBase_Photo.FirstOrDefault(e => e.PhotoId == photo.PhotoId);
if (newPhoto != null)
{
newPhoto.Date = photo.Date;
newPhoto.Place = photo.Place;
newPhoto.Person = photo.Person;
newPhoto.Subject = photo.Subject;
newPhoto.Background = photo.Background;
newPhoto.Photographer = photo.Photographer;
newPhoto.AttachUrl = photo.AttachUrl;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据一个照片信息
/// </summary>
/// <param name="breakdownCode"></param>
public static void DeletePhotoById(string photoId)
{
Model.DataBase_Photo photo = Funs.DB.DataBase_Photo.FirstOrDefault(e => e.PhotoId == photoId);
if (photo != null)
{
if (!string.IsNullOrEmpty(photo.AttachUrl))
{
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, photo.AttachUrl);//删除附件
}
Funs.DB.DataBase_Photo.DeleteOnSubmit(photo);
Funs.DB.SubmitChanges();
}
}
}
}
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 开工报告
/// </summary>
public static class StartWorkReportService
{
/// <summary>
/// 根据主键获取开工报告
/// </summary>
/// <param name="StartWorkReportId"></param>
/// <returns></returns>
public static Model.DataBase_StartWorkReport GetStartWorkReportById(string StartWorkReportId)
{
return Funs.DB.DataBase_StartWorkReport.FirstOrDefault(e => e.StartWorkReportId == StartWorkReportId);
}
/// <summary>
/// 添加开工报告
/// </summary>
/// <param name="StartWorkReport"></param>
public static void AddStartWorkReport(Model.DataBase_StartWorkReport StartWorkReport)
{
Model.DataBase_StartWorkReport newStartWorkReport = new Model.DataBase_StartWorkReport();
newStartWorkReport.StartWorkReportId = StartWorkReport.StartWorkReportId;
newStartWorkReport.ProjectId = StartWorkReport.ProjectId;
newStartWorkReport.DataTypeProjectId = StartWorkReport.DataTypeProjectId;
newStartWorkReport.FileCode = StartWorkReport.FileCode;
newStartWorkReport.FileContent = StartWorkReport.FileContent;
newStartWorkReport.CNProfessionalId = StartWorkReport.CNProfessionalId;
newStartWorkReport.UnitWorkIds = StartWorkReport.UnitWorkIds;
newStartWorkReport.UnitIds = StartWorkReport.UnitIds;
newStartWorkReport.Remark = StartWorkReport.Remark;
newStartWorkReport.AttachUrl = StartWorkReport.AttachUrl;
newStartWorkReport.CompileMan = StartWorkReport.CompileMan;
newStartWorkReport.CompileDate = StartWorkReport.CompileDate;
Funs.DB.DataBase_StartWorkReport.InsertOnSubmit(newStartWorkReport);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改开工报告
/// </summary>
/// <param name="StartWorkReport"></param>
public static void UpdateStartWorkReport(Model.DataBase_StartWorkReport StartWorkReport)
{
Model.DataBase_StartWorkReport newStartWorkReport = Funs.DB.DataBase_StartWorkReport.FirstOrDefault(e => e.StartWorkReportId == StartWorkReport.StartWorkReportId);
if (newStartWorkReport != null)
{
newStartWorkReport.FileCode = StartWorkReport.FileCode;
newStartWorkReport.FileContent = StartWorkReport.FileContent;
newStartWorkReport.CNProfessionalId = StartWorkReport.CNProfessionalId;
newStartWorkReport.UnitWorkIds = StartWorkReport.UnitWorkIds;
newStartWorkReport.UnitIds = StartWorkReport.UnitIds;
newStartWorkReport.Remark = StartWorkReport.Remark;
newStartWorkReport.AttachUrl = StartWorkReport.AttachUrl;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除开工报告
/// </summary>
/// <param name="StartWorkReportId"></param>
public static void DeleteStartWorkReportById(string StartWorkReportId)
{
Model.DataBase_StartWorkReport StartWorkReport = Funs.DB.DataBase_StartWorkReport.FirstOrDefault(e => e.StartWorkReportId == StartWorkReportId);
if (StartWorkReport != null)
{
if (!string.IsNullOrEmpty(StartWorkReport.AttachUrl))
{
BLL.UploadAttachmentService.DeleteFile(Funs.RootPath, StartWorkReport.AttachUrl);//删除附件
}
Funs.DB.DataBase_StartWorkReport.DeleteOnSubmit(StartWorkReport);
Funs.DB.SubmitChanges();
}
}
}
}