Beispiel #1
0
        private void AddMoreInformation(string userCode, PT_PrjMember member)
        {
            DataTable oldInfo = this.GetOldInfo(userCode);

            if ((oldInfo != null) && (oldInfo.Rows.Count > 0))
            {
                member.Post = oldInfo.Rows[0]["Post"].ToString();
                member.EducationalBackground = oldInfo.Rows[0]["EducationalBackground"].ToString() + oldInfo.Rows[0]["Specialty"].ToString();
                member.Technical             = oldInfo.Rows[0]["Technical"].ToString();
                member.PastPerformance       = oldInfo.Rows[0]["PastPerformance"].ToString();
                member.PostAndCompetency     = oldInfo.Rows[0]["PostAndCompetency"].ToString();
                member.TrainingInformation   = oldInfo.Rows[0]["Courses"].ToString();
            }
        }
Beispiel #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();
         }
     }
 }
Beispiel #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();
     }
 }