/// <summary> /// 删除所有方案模板 /// </summary> /// <param name="solutionTemplateId"></param> public static void DeleteSolutionTemplateById(string solutionTemplateId) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_SolutionTemplate solutionTemplate = db.Solution_SolutionTemplate.FirstOrDefault(e => e.SolutionTemplateId == solutionTemplateId); if (solutionTemplate != null) { CodeRecordsService.DeleteCodeRecordsByDataId(solutionTemplateId); //删除编号 CommonService.DeleteAttachFileById(solutionTemplateId); //删除附件 CommonService.DeleteFlowOperateByID(solutionTemplateId); //删除流程 db.Solution_SolutionTemplate.DeleteOnSubmit(solutionTemplate); db.SubmitChanges(); } }
/// <summary> /// 修改方案模板 /// </summary> /// <param name="solutionTemplate"></param> public static void UpdateSolutionTemplate(Model.Solution_SolutionTemplate solutionTemplate) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_SolutionTemplate newSolutionTemplate = db.Solution_SolutionTemplate.FirstOrDefault(e => e.SolutionTemplateId == solutionTemplate.SolutionTemplateId); if (newSolutionTemplate != null) { newSolutionTemplate.SolutionTemplateCode = solutionTemplate.SolutionTemplateCode; newSolutionTemplate.SolutionTemplateName = solutionTemplate.SolutionTemplateName; newSolutionTemplate.SolutionTemplateType = solutionTemplate.SolutionTemplateType; newSolutionTemplate.CompileMan = solutionTemplate.CompileMan; newSolutionTemplate.CompileDate = solutionTemplate.CompileDate; newSolutionTemplate.FileContents = solutionTemplate.FileContents; db.SubmitChanges(); } }
/// <summary> /// 添加方案模板 /// </summary> /// <param name="solutionTemplate"></param> public static void AddSolutionTemplate(Model.Solution_SolutionTemplate solutionTemplate) { Model.SUBHSSEDB db = Funs.DB; Model.Solution_SolutionTemplate newSolutionTemplate = new Model.Solution_SolutionTemplate { SolutionTemplateId = solutionTemplate.SolutionTemplateId, ProjectId = solutionTemplate.ProjectId, SolutionTemplateCode = solutionTemplate.SolutionTemplateCode, SolutionTemplateName = solutionTemplate.SolutionTemplateName, SolutionTemplateType = solutionTemplate.SolutionTemplateType, FileContents = solutionTemplate.FileContents, CompileMan = solutionTemplate.CompileMan, CompileDate = solutionTemplate.CompileDate }; db.Solution_SolutionTemplate.InsertOnSubmit(newSolutionTemplate); db.SubmitChanges(); //暂时不取统一编号,自己手动编号 //CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(Const.SolutionTemplateMenuId, newSolutionTemplate.ProjectId, null, solutionTemplate.SolutionTemplateId, solutionTemplate.CompileDate); }