去除静态变量Funs.DB
This commit is contained in:
@@ -8,8 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class AccidentTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取事故类型
|
||||
/// </summary>
|
||||
|
||||
@@ -11,10 +11,7 @@ namespace BLL
|
||||
|
||||
public static class Base_CompanytemplateService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
@@ -25,7 +22,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Base_CompanyTemplate> GetBase_CompanyTemplateByModle(Model.Base_CompanyTemplate table)
|
||||
{
|
||||
var q= from x in db.Base_CompanyTemplate
|
||||
var q= from x in Funs.DB.Base_CompanyTemplate
|
||||
where
|
||||
( string.IsNullOrEmpty(table.TemplateId)||x.TemplateId.Contains(table.TemplateId)) &&
|
||||
( string.IsNullOrEmpty(table.Code)||x.Code.Contains(table.Code)) &&
|
||||
@@ -68,16 +65,16 @@ namespace BLL
|
||||
|
||||
public static Model.Base_CompanyTemplate GetBase_CompanyTemplateById(string TemplateId)
|
||||
{
|
||||
return db.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId);
|
||||
return Funs.DB.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId);
|
||||
}
|
||||
public static Model.Base_CompanyTemplate GetBase_CompanyTemplateByCode(string Code)
|
||||
{
|
||||
return db.Base_CompanyTemplate.FirstOrDefault(x => x.Code== Code);
|
||||
return Funs.DB.Base_CompanyTemplate.FirstOrDefault(x => x.Code== Code);
|
||||
}
|
||||
public static bool IsExitCode(string Code)
|
||||
{
|
||||
bool result = false;
|
||||
var q= (from x in db.Base_CompanyTemplate where x.Code ==Code select x ).FirstOrDefault();
|
||||
var q= (from x in Funs.DB.Base_CompanyTemplate where x.Code ==Code select x ).FirstOrDefault();
|
||||
if (q!=null)
|
||||
{
|
||||
result = true;
|
||||
@@ -95,22 +92,22 @@ namespace BLL
|
||||
FilePath=newtable.FilePath,
|
||||
Remarks=newtable.Remarks,
|
||||
};
|
||||
db.Base_CompanyTemplate.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_CompanyTemplate.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkBase_CompanyTemplate(List<Model.Base_CompanyTemplate> newtables)
|
||||
{
|
||||
|
||||
db.Base_CompanyTemplate.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_CompanyTemplate.InsertAllOnSubmit(newtables);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateBase_CompanyTemplate(Model.Base_CompanyTemplate newtable)
|
||||
{
|
||||
|
||||
Model.Base_CompanyTemplate table = db.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==newtable.TemplateId);
|
||||
Model.Base_CompanyTemplate table = Funs.DB.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==newtable.TemplateId);
|
||||
if (table != null)
|
||||
{
|
||||
table.TemplateId=newtable.TemplateId;
|
||||
@@ -118,28 +115,28 @@ namespace BLL
|
||||
table.Name=newtable.Name;
|
||||
table.FilePath=newtable.FilePath;
|
||||
table.Remarks=newtable.Remarks;
|
||||
db.SubmitChanges();
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteBase_CompanyTemplateById (string TemplateId)
|
||||
{
|
||||
|
||||
Model.Base_CompanyTemplate table =db.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId);
|
||||
Model.Base_CompanyTemplate table =Funs.DB.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Base_CompanyTemplate.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_CompanyTemplate.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLBase_CompanyTemplate ()
|
||||
{
|
||||
if( db.Base_CompanyTemplate !=null)
|
||||
if( Funs.DB.Base_CompanyTemplate !=null)
|
||||
{
|
||||
db.Base_CompanyTemplate.DeleteAllOnSubmit( db.Base_CompanyTemplate);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_CompanyTemplate.DeleteAllOnSubmit( Funs.DB.Base_CompanyTemplate);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static void InitBase_CompanyTemplateDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
|
||||
@@ -11,9 +11,6 @@ namespace BLL
|
||||
|
||||
public static class Base_FactoryService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -25,7 +22,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Base_Factory> GetBase_FactoryByModle(Model.Base_Factory table)
|
||||
{
|
||||
var q = from x in db.Base_Factory
|
||||
var q = from x in Funs.DB.Base_Factory
|
||||
where
|
||||
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
@@ -39,7 +36,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Base_Factory> GetBase_FactoryList()
|
||||
{
|
||||
var q = (from x in db.Base_Factory orderby x.FactoryCode select x).ToList();
|
||||
var q = (from x in Funs.DB.Base_Factory orderby x.FactoryCode select x).ToList();
|
||||
|
||||
|
||||
return q;
|
||||
@@ -74,14 +71,14 @@ namespace BLL
|
||||
|
||||
public static Model.Base_Factory GetBase_FactoryById(string FactoryId)
|
||||
{
|
||||
return db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId);
|
||||
return Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId);
|
||||
}
|
||||
public static string GetBase_FactoryNameById(object FactoryId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (FactoryId!=null)
|
||||
{
|
||||
var model = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId.ToString());
|
||||
var model = Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId.ToString());
|
||||
if (model != null)
|
||||
{
|
||||
name = model.FactoryName;
|
||||
@@ -92,7 +89,7 @@ namespace BLL
|
||||
}
|
||||
public static Model.Base_Factory GetBase_FactoryByCode(string FactoryCode)
|
||||
{
|
||||
return db.Base_Factory.FirstOrDefault(x => x.FactoryCode == FactoryCode);
|
||||
return Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryCode == FactoryCode);
|
||||
}
|
||||
public static void AddBase_Factory(Model.Base_Factory newtable)
|
||||
{
|
||||
@@ -106,22 +103,22 @@ namespace BLL
|
||||
Address = newtable.Address,
|
||||
MapCoordinates= newtable.MapCoordinates,
|
||||
};
|
||||
db.Base_Factory.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_Factory.InsertOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkBase_Factory(List<Model.Base_Factory> newtables)
|
||||
{
|
||||
|
||||
db.Base_Factory.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_Factory.InsertAllOnSubmit(newtables);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateBase_Factory(Model.Base_Factory newtable)
|
||||
{
|
||||
|
||||
Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == newtable.FactoryId);
|
||||
Model.Base_Factory table = Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == newtable.FactoryId);
|
||||
if (table != null)
|
||||
{
|
||||
table.FactoryId = newtable.FactoryId;
|
||||
@@ -130,28 +127,28 @@ namespace BLL
|
||||
table.FactoryName = newtable.FactoryName;
|
||||
table.Address = newtable.Address;
|
||||
table.MapCoordinates = newtable.MapCoordinates;
|
||||
db.SubmitChanges();
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteBase_FactoryById(string FactoryId)
|
||||
{
|
||||
|
||||
Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId);
|
||||
Model.Base_Factory table = Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Base_Factory.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_Factory.DeleteOnSubmit(table);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLBase_Factory()
|
||||
{
|
||||
if (db.Base_Factory != null)
|
||||
if (Funs.DB.Base_Factory != null)
|
||||
{
|
||||
db.Base_Factory.DeleteAllOnSubmit(db.Base_Factory);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_Factory.DeleteAllOnSubmit(Funs.DB.Base_Factory);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static void InitBase_FactoryDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
|
||||
@@ -7,8 +7,6 @@ namespace BLL
|
||||
{
|
||||
public class CNProfessionalService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取实体集合
|
||||
/// </summary>
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
{
|
||||
public static class CQMSTrainObjectService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训对象
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class CQMSTrainTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训类型
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class CertificateService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取特岗证书
|
||||
/// </summary>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -10,8 +11,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class CheckTemplateService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
@@ -25,7 +24,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.ProjectSupervision_CheckTemplate> getDataLists = from x in db.ProjectSupervision_CheckTemplate
|
||||
private static IQueryable<Model.ProjectSupervision_CheckTemplate> getDataLists = from x in Funs.DB.ProjectSupervision_CheckTemplate
|
||||
select x;
|
||||
|
||||
/// 获取分页列表
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class ConstructionTestTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取施工试验类型
|
||||
/// </summary>
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class CostTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取费用类型
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace BLL
|
||||
{
|
||||
public class DesignProfessionalService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取实体集合
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace BLL
|
||||
{
|
||||
public static class EmergencyTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace BLL
|
||||
{
|
||||
public class HSSEStandardListTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 获取标准规范类别信息
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class LawsRegulationsTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取法律法规类型信息
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class LicenseTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取许可证类型
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class ManageRuleTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取管理规定分类
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class MaterialTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取材料类型
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class NoticeAndSupervisionTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取告知和监检类型
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class PictureTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取项目图片分类
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class PositionService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取主键
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace BLL
|
||||
{
|
||||
public static class PostTitleService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace BLL
|
||||
{
|
||||
public static class PracticeCertificateService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取执业资格证书
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
public static class ProjectTypeService
|
||||
{
|
||||
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class PunishTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取处罚定义
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace BLL
|
||||
{
|
||||
public class QualityQuestionTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取实体集合
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class RewardTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取奖励定义
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class RulesRegulationsTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取规章制度类别
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class SafetyMeasuresService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取安全措施
|
||||
@@ -50,8 +50,8 @@ namespace BLL
|
||||
SafetyMeasures = SafetyMeasures.SafetyMeasures,
|
||||
LicenseType = SafetyMeasures.LicenseType
|
||||
};
|
||||
db.Base_SafetyMeasures.InsertOnSubmit(newSafetyMeasures);
|
||||
db.SubmitChanges();
|
||||
Funs.DB.Base_SafetyMeasures.InsertOnSubmit(newSafetyMeasures);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -8,8 +9,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class SolutionTempleteTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取施工方案模板类型
|
||||
/// </summary>
|
||||
@@ -33,6 +32,7 @@ namespace BLL
|
||||
Remark = solutionTempleteType.Remark,
|
||||
SortIndex = solutionTempleteType.SortIndex
|
||||
};
|
||||
var db = Funs.DB;
|
||||
db.Base_SolutionTempleteType.InsertOnSubmit(newSolutionTempleteType);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -43,6 +43,7 @@ namespace BLL
|
||||
/// <param name="solutionTempleteType"></param>
|
||||
public static void UpdateSolutionTempleteType(Model.Base_SolutionTempleteType solutionTempleteType)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
Model.Base_SolutionTempleteType newSolutionTempleteType = db.Base_SolutionTempleteType.FirstOrDefault(e => e.SolutionTempleteTypeCode == solutionTempleteType.SolutionTempleteTypeCode);
|
||||
if (newSolutionTempleteType != null)
|
||||
{
|
||||
@@ -59,6 +60,7 @@ namespace BLL
|
||||
/// <param name="solutionTempleteTypeCode"></param>
|
||||
public static void DeleteSolutionTempleteTypeById(string solutionTempleteTypeCode)
|
||||
{
|
||||
var db = Funs.DB;
|
||||
var solutionTemplate = db.Base_SolutionTempleteType.FirstOrDefault(e => e.SolutionTempleteTypeCode == solutionTempleteTypeCode);
|
||||
if (solutionTemplate != null)
|
||||
{
|
||||
@@ -73,7 +75,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_SolutionTempleteType> GetSolutionTempleteType()
|
||||
{
|
||||
return (from x in db.Base_SolutionTempleteType orderby x.SortIndex select x).ToList();
|
||||
return (from x in Funs.DB.Base_SolutionTempleteType orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取类别下拉项
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class SpecialEquipmentService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取机具设备
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace BLL
|
||||
{
|
||||
public static class SpecialSchemeTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainLevelService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取主键
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class TrainTypeService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取培训类型
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace BLL
|
||||
public static class UnitTypeService
|
||||
{
|
||||
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace BLL
|
||||
{
|
||||
public static class WorkPostService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取信息
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Model;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -8,8 +9,6 @@ namespace BLL
|
||||
/// </summary>
|
||||
public static class WorkStageService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取工作阶段
|
||||
/// </summary>
|
||||
@@ -36,7 +35,7 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static List<Model.Base_WorkStage> GetWorkStageList()
|
||||
{
|
||||
return (from x in db.Base_WorkStage orderby x.WorkStageCode select x).ToList();
|
||||
return (from x in Funs.DB.Base_WorkStage orderby x.WorkStageCode select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -52,8 +51,9 @@ namespace BLL
|
||||
WorkStageName = workStage.WorkStageName,
|
||||
Remarks = workStage.Remarks
|
||||
};
|
||||
db.Base_WorkStage.InsertOnSubmit(newWorkStage);
|
||||
db.SubmitChanges();
|
||||
var db1 = Funs.DB;
|
||||
db1.Base_WorkStage.InsertOnSubmit(newWorkStage);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -62,13 +62,14 @@ namespace BLL
|
||||
/// <param name="workStage"></param>
|
||||
public static void UpdateWorkStage(Model.Base_WorkStage workStage)
|
||||
{
|
||||
Model.Base_WorkStage newWorkStage = db.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStage.WorkStageId);
|
||||
var db1 = Funs.DB;
|
||||
Model.Base_WorkStage newWorkStage = db1.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStage.WorkStageId);
|
||||
if (newWorkStage != null)
|
||||
{
|
||||
newWorkStage.WorkStageCode = workStage.WorkStageCode;
|
||||
newWorkStage.WorkStageName = workStage.WorkStageName;
|
||||
newWorkStage.Remarks = workStage.Remarks;
|
||||
db.SubmitChanges();
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,11 +79,12 @@ namespace BLL
|
||||
/// <param name="workStageId"></param>
|
||||
public static void DeleteWorkStageById(string workStageId)
|
||||
{
|
||||
Model.Base_WorkStage workStage = db.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStageId);
|
||||
var db1 = Funs.DB;
|
||||
Model.Base_WorkStage workStage = db1.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStageId);
|
||||
if (workStage != null)
|
||||
{
|
||||
db.Base_WorkStage.DeleteOnSubmit(workStage);
|
||||
db.SubmitChanges();
|
||||
db1.Base_WorkStage.DeleteOnSubmit(workStage);
|
||||
db1.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user