Exemplo n.º 1
0
 public static void Add(List <string> ids, List <string> codes)
 {
     using (pm2Entities entities = new pm2Entities())
     {
         if ((ids != null) && (codes != null))
         {
             PrjMember member = new PrjMember();
             foreach (string str in ids)
             {
                 Guid          guid = new Guid(str);
                 List <string> list = (from m in entities.PT_PrjMember
                                       where m.PrjGuid == guid
                                       select m.PT_yhmc.v_yhdm).ToList <string>();
                 foreach (string str2 in codes)
                 {
                     if (!list.Contains(str2))
                     {
                         member.AddSign(guid, str2, entities);
                     }
                 }
             }
             entities.SaveChanges();
         }
     }
 }
Exemplo n.º 2
0
 public static void Update(PrjMember model)
 {
     using (pm2Entities entities = new pm2Entities())
     {
         PT_PrjMember member = (from m in entities.PT_PrjMember
                                where m.PrjMemberId == model.PrjMemberId
                                select m).FirstOrDefault <PT_PrjMember>();
         if (member != null)
         {
             member.Post = model.Post;
             member.PostAndCompetency     = model.PostAndCompetency;
             member.PastPerformance       = model.PastPerformance;
             member.Technical             = model.Technical;
             member.TrainingInformation   = model.TrainingInformation;
             member.EducationalBackground = model.EducationalBackground;
             entities.SaveChanges();
         }
     }
 }
Exemplo n.º 3
0
 public static void Add(string id, List <string> codes)
 {
     using (pm2Entities entities = new pm2Entities())
     {
         Guid          guid   = new Guid(id);
         PrjMember     member = new PrjMember();
         List <string> list   = GetCodes(id);
         using (List <string> .Enumerator enumerator = list.GetEnumerator())
         {
             string code;
             while (enumerator.MoveNext())
             {
                 code = enumerator.Current;
                 if (!codes.Contains(code))
                 {
                     PT_PrjMember entity = (from m in entities.PT_PrjMember
                                            where (m.PrjGuid == guid) && (m.PT_yhmc.v_yhdm == code)
                                            select m).FirstOrDefault <PT_PrjMember>();
                     if (entity != null)
                     {
                         entities.DeleteObject(entity);
                         DelFile(entity.PrjMemberId);
                     }
                 }
             }
         }
         foreach (string str in codes)
         {
             if (!list.Contains(str))
             {
                 member.AddSign(guid, str, entities);
             }
         }
         entities.SaveChanges();
     }
 }