public static void AddTeamByGroupIdUserId(Guid userId, string userEmailId, Guid groupId) { Domain.Socioboard.Domain.Team teams = new Domain.Socioboard.Domain.Team(); TeamRepository objTeamRepository = new TeamRepository(); teams.Id = Guid.NewGuid(); teams.GroupId = groupId; teams.UserId = userId; teams.EmailId = userEmailId; objTeamRepository.addNewTeam(teams); }
public string AddTeam(string UserId, string InviteStatus, string FirstName, string LastName, string EmailId, string AccessLevel, string GroupId, string useremail, string username) { try { if (!teamrepo.checkTeamExists(EmailId, Guid.Parse(UserId), Guid.Parse(GroupId))) { Domain.Socioboard.Domain.Groups _Groups = objGroupsRepository.getGroupDetailsbyId(Guid.Parse(UserId), Guid.Parse(GroupId)); team.Id = Guid.NewGuid(); team.UserId = Guid.Parse(UserId); team.InviteStatus = Convert.ToInt32(InviteStatus); team.InviteDate = DateTime.Now; team.StatusUpdateDate = DateTime.Now; team.GroupId = Guid.Parse(GroupId); team.StatusUpdateDate = DateTime.Now; team.FirstName = FirstName; team.LastName = LastName; team.EmailId = EmailId; team.AccessLevel = AccessLevel; teamrepo.addNewTeam(team); string check = team.Id.ToString(); string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/GroupInvitation.html"); string html = File.ReadAllText(mailpath); html = html.Replace("[group_name]", _Groups.GroupName); html = html.Replace("[join link]", "Home/Index?teamid=" + team.Id.ToString()); //string usernameSend = ConfigurationManager.AppSettings["Mandrillusername"]; //string host = ConfigurationManager.AppSettings["Mandrillhost"]; //string port = ConfigurationManager.AppSettings["Mandrillport"]; //string pass = ConfigurationManager.AppSettings["Mandrillpassword"]; //GlobusMailLib.MailHelper objMailHelper = new GlobusMailLib.MailHelper(); //objMailHelper.SendMailByMandrill(host, Convert.ToInt32(port), useremail, username, "", EmailId, "", "", "Group Invitation", html, usernameSend, pass); MailSender objMailSender = new MailSender(); string ret = objMailSender.SendChangePasswordMail(EmailId, html, "Group Invitation"); return(new JavaScriptSerializer().Serialize(team)); } else { return(""); } } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return("Something Went Wrong"); } }