using FineUIPro; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; namespace BLL { /// /// 消防安全组织体系 /// public static class SafetyorganizationService { /// ///获取消防安全组织体系 /// /// public static Model.FireGasSafety_SafetyOrganization GetSafetyOrganizationById(string Id) { return Funs.DB.FireGasSafety_SafetyOrganization.FirstOrDefault(e => e.Id == Id); } /// ///获取消防安全组织体系 /// /// public static List GetSafetyOrganizationListByProjectId(string projectId) { using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { return (from x in db.FireGasSafety_SafetyOrganization where x.ProjectId == projectId orderby x.CompileDate ascending select x).ToList(); } } /// /// 添加安全组织体系 /// /// public static void AddSafetyOrganization(Model.FireGasSafety_SafetyOrganization model) { Model.SUBQHSEDB db = Funs.DB; //Model.FireGasSafety_SafetyOrganization newModel = new Model.FireGasSafety_SafetyOrganization(); //newModel.Id = model.Id; //newModel.ProjectId = model.ProjectId; //newModel.UnitName = model.UnitName; //newModel.OrganizationPic = model.OrganizationPic; //newModel.CompileDate = model.CompileDate; //newModel.CompileMan = model.CompileMan; //db.FireGasSafety_SafetyOrganization.InsertOnSubmit(newModel); db.FireGasSafety_SafetyOrganization.InsertOnSubmit(model); db.SubmitChanges(); } /// /// 修改安全组织体系 /// /// public static void UpdateSafetyOrganization(Model.FireGasSafety_SafetyOrganization model) { Model.SUBQHSEDB db = Funs.DB; Model.FireGasSafety_SafetyOrganization newIns = model; //Model.Project_Installation newIns = db.Project_Installation.First(e => e.InstallationId == installation.InstallationId); //newIns.InstallationCode = installation.InstallationCode; //newIns.InstallationName = installation.InstallationName; //newIns.SuperInstallationId = installation.SuperInstallationId; //newIns.StartDate = installation.StartDate; //newIns.EndDate = installation.EndDate; //newIns.Weights = installation.Weights; //newIns.WeightsMoney = installation.WeightsMoney; //newIns.Def = installation.Def; //newIns.SortIndex = installation.SortIndex; //newIns.UnitId = installation.UnitId; db.SubmitChanges(); } /// /// 根据Id删除组织体系 /// /// public static void DeleteSafetyOrganization(string id) { Model.SUBQHSEDB db = Funs.DB; Model.FireGasSafety_SafetyOrganization WS = db.FireGasSafety_SafetyOrganization.First(e => e.Id == id); db.FireGasSafety_SafetyOrganization.DeleteOnSubmit(WS); db.SubmitChanges(); } } }