Esempio n. 1
0
 public ServerResponse<string, string, CommunityMemberVm> AddMember(CommunityMember cMemb)
 {
     try
     {
         baseRepo.Add<CommunityMember>(cMemb);
         CommunityMemberVm cmvm = new CommunityMemberVm(cMemb, false);
         return new ServerResponse<string, string, CommunityMemberVm>(ErrorMessages.SuccessString, null, cmvm);
     }
     catch (Exception e)
     {
         return new ServerResponse<string, string, CommunityMemberVm>(ErrorMessages.ErrorString, ErrorMessages.ErrMsg_Generic, null);
     }
 }
Esempio n. 2
0
 public ServerResponse<string, string, List<CommunityMemberVm>> getMembersList()
 {
     List<CommunityMemberVm> cmvmList = new List<CommunityMemberVm>();
        try
        {
         var members = baseRepo.getDb().Member.OrderBy(x => x.FirstName);
         if (members != null && members.Count() > 0)
         {
             foreach (var m in members)
             {
                 CommunityMemberVm cmvm = new CommunityMemberVm(m, false);
                 cmvmList.Add(cmvm);
             }
         }
         return new ServerResponse<string, string, List<CommunityMemberVm>>(ErrorMessages.SuccessString, null, cmvmList);
     }
     catch (Exception e)
     {
         return new ServerResponse<string, string, List<CommunityMemberVm>>(ErrorMessages.ErrorString, ErrorMessages.ErrMsg_Generic, null);
     }
 }
Esempio n. 3
0
 public ServerResponse<string, string, CommunityMemberVm> UpdateMember(CommunityMember model)
 {
     try
         {
             baseRepo.Update<CommunityMember>(model);
             CommunityMemberVm cmvm = new CommunityMemberVm(model, false);
             return new ServerResponse<string, string, CommunityMemberVm>(ErrorMessages.SuccessString, null, cmvm);
         }
         catch (Exception e)
         {
             return new ServerResponse<string, string, CommunityMemberVm>(ErrorMessages.ErrorString, ErrorMessages.ErrMsg_Generic, null);
         }
 }
Esempio n. 4
0
 public ServerResponse<string, string, CommunityMemberVm> GetMember(int id)
 {
     try
     {
         CommunityMemberVm cmvm = new CommunityMemberVm(baseRepo.getDb().Member.Find(id), true);
         return new ServerResponse<string, string, CommunityMemberVm>(ErrorMessages.SuccessString, null, cmvm);
     }
     catch (Exception e)
     {
         return new ServerResponse<string, string, CommunityMemberVm>(ErrorMessages.ErrorString, ErrorMessages.ErrMsg_Generic, null);
     }
 }