Exemplo n.º 1
0
 /// <summary>
 /// 根据主键删除应知应会库
 /// </summary>
 /// <param name="knowledgeId"></param>
 public static void DeleteKnowledge(string knowledgeId)
 {
     Model.SUBHSSEDB          db        = Funs.DB;
     Model.Training_Knowledge knowledge = db.Training_Knowledge.FirstOrDefault(e => e.KnowledgeId == knowledgeId);
     if (knowledge != null)
     {
         db.Training_Knowledge.DeleteOnSubmit(knowledge);
         db.SubmitChanges();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 修改应知应会库
 /// </summary>
 /// <param name="knowledge"></param>
 public static void UpdateKnowledge(Model.Training_Knowledge knowledge)
 {
     Model.SUBHSSEDB          db           = Funs.DB;
     Model.Training_Knowledge newKnowledge = db.Training_Knowledge.FirstOrDefault(e => e.KnowledgeId == knowledge.KnowledgeId);
     if (newKnowledge != null)
     {
         newKnowledge.KnowledgeCode  = knowledge.KnowledgeCode;
         newKnowledge.KnowledgeName  = knowledge.KnowledgeName;
         newKnowledge.SupKnowledgeId = knowledge.SupKnowledgeId;
         newKnowledge.IsEndLever     = knowledge.IsEndLever;
         db.SubmitChanges();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// 添加应知应会库
 /// </summary>
 /// <param name="knowledge"></param>
 public static void AddKnowledge(Model.Training_Knowledge knowledge)
 {
     Model.SUBHSSEDB          db           = Funs.DB;
     Model.Training_Knowledge newKnowledge = new Model.Training_Knowledge
     {
         KnowledgeId    = knowledge.KnowledgeId,
         KnowledgeCode  = knowledge.KnowledgeCode,
         KnowledgeName  = knowledge.KnowledgeName,
         SupKnowledgeId = knowledge.SupKnowledgeId,
         IsEndLever     = knowledge.IsEndLever
     };
     db.Training_Knowledge.InsertOnSubmit(newKnowledge);
     db.SubmitChanges();
 }