85 lines
2.7 KiB
C#
85 lines
2.7 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Data.Linq;
|
|
using System.Web.Security;
|
|
using System.Web.UI.WebControls;
|
|
using Model;
|
|
using BLL;
|
|
using System.Collections.Generic;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class Base_PrintFileCodeService
|
|
{
|
|
public static Model.SGGLDB db = Funs.DB;
|
|
|
|
/// <summary>
|
|
/// 获取打印文件编号
|
|
/// </summary>
|
|
/// <param name="depId">部门Id</param>
|
|
/// <returns></returns>
|
|
public static Model.Base_PrintFileCode GetPrintFileCodeByFileId(string fileId)
|
|
{
|
|
return Funs.DB.Base_PrintFileCode.FirstOrDefault(x => x.FileId == fileId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加部门
|
|
/// </summary>
|
|
/// <param name="depCode"></param>
|
|
/// <param name="depHead"></param>
|
|
/// <param name="depName"></param>
|
|
/// <param name="remark"></param>
|
|
public static void AddPrintFileCode(Model.Base_PrintFileCode depart)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
string newKeyID = SQLHelper.GetNewID(typeof(Model.Base_PrintFileCode));
|
|
Model.Base_PrintFileCode code = new Model.Base_PrintFileCode();
|
|
code.Id = newKeyID;
|
|
code.ProjectId = depart.ProjectId;
|
|
code.FileType = depart.FileType;
|
|
code.FileCode = depart.FileCode;
|
|
code.FileId = depart.FileId;
|
|
code.FileCode2 = depart.FileCode2;
|
|
db.Base_PrintFileCode.InsertOnSubmit(code);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改打印文件编号
|
|
/// </summary>
|
|
/// <param name="depId">部门主键</param>
|
|
/// <param name="depCode"></param>
|
|
/// <param name="depHead"></param>
|
|
/// <param name="depName"></param>
|
|
/// <param name="remark"></param>
|
|
public static void UpdatePrintFileCode(Model.Base_PrintFileCode depart)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Base_PrintFileCode code = db.Base_PrintFileCode.FirstOrDefault(e => e.Id == depart.Id);
|
|
if (code != null)
|
|
{
|
|
code.FileType = depart.FileType;
|
|
code.FileCode = depart.FileCode;
|
|
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除部门
|
|
/// </summary>
|
|
/// <param name="depId"></param>
|
|
public static void DeletePrintFileCode(string Id)
|
|
{
|
|
Model.SGGLDB db = Funs.DB;
|
|
Model.Base_PrintFileCode dep = db.Base_PrintFileCode.First(e => e.Id == Id);
|
|
db.Base_PrintFileCode.DeleteOnSubmit(dep);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|