public string UpdateEmailId(string Id, string GroupId, string NewEmailId) { try { int ret = 0; int ret1 = 0; if (!userrepo.IsUserExist(NewEmailId)) { ret = userrepo.UpdateEmailId(Guid.Parse(Id), NewEmailId); ret1 = objTeamRepository.UpdateEmailIdbyGroupId(Guid.Parse(Id), Guid.Parse(GroupId), NewEmailId); if (ret == 1 && ret1 == 1) { return("Updated Successfully"); } else { return("Failed"); } } else { return("Email Id alredy Exist"); } } catch (Exception ex) { Console.WriteLine(ex.Message); return(null); } }
public string UpdateEmailId(string Id, string GroupId, string NewEmailId, string access_token) { //if (!User.Identity.IsAuthenticated) //{ // return "Unauthorized access"; //} try { int ret = 0; int ret1 = 0; if (!userrepo.IsUserExist(NewEmailId)) { ret = userrepo.UpdateEmailId(Guid.Parse(Id), NewEmailId); ret1 = objTeamRepository.UpdateEmailIdbyGroupId(Guid.Parse(Id), Guid.Parse(GroupId), NewEmailId); if (ret == 1 && ret1 == 1) { return("Updated Successfully"); } else { return("Failed"); } } else { return("Email Id alredy Exist"); } } catch (Exception ex) { Console.WriteLine(ex.Message); return(null); } }