public DomainResponse SetEmailTemplateThanksAttended(Template template) { if (template.Type != TemplateTypeEnum.EmailTemplateThanksAttended) { return(DomainResponse.Error()); } EmailTemplateThanksAttended = template; return(DomainResponse.Ok()); }
public DomainResponse SetEmailTemplateThanksSponsors(Template template) { if (template.Type != TemplateTypeEnum.EmailTemplateThanksSponsors) { return(DomainResponse.Error()); } EmailTemplateThanksSponsors = template; return(DomainResponse.Ok()); }
public DomainResponse AssignBadge(Badge badge) { if (Badges.Any(x => x.BadgeId == badge.Id)) { return(DomainResponse.Error("Este miembro ya tiene el badge")); } Badges.Add(new BadgeMember(badge, this)); AddDomainEvent(new AssignedBadgeToMember(this.Id, badge.Id)); return(DomainResponse.Ok()); }
public DomainResponse AddPath(Path path, Limit limit) { var enableToAddPaht = Limits.Contain(limit) && !limit.HasPath(); if (!enableToAddPaht) { return(DomainResponse.Error()); } limit.AddPath(path); return(DomainResponse.Ok()); }
public DomainResponse AssignBadge(Badge badge) { if (GroupCodeBadges.Any(x => x.Badge.Id == badge.Id)) { return(DomainResponse.Error("El badge que esta intentando asignar, ya se encuentra asignado")); } foreach (var groupCodeMember in Members) { groupCodeMember.Member.AssignBadge(badge); } GroupCodeBadges.Add(new GroupCodeBadge(this, badge)); return(DomainResponse.Ok()); }
public DomainResponse AssignBadgeToAttended(Badge badge) { if (!Done) { return(DomainResponse.Error("El evento debe estar en Done antes de asignar Badges")); } foreach (var item in Attendees) { if (item.Attended) { badge.Members.Add(new BadgeMember { BadgeId = badge.Id, MemberId = item.MemberId }); AddDomainEvent(new AssignedBadgeToMember(item.MemberId, badge.Id)); } } return(DomainResponse.Ok()); }
public DomainResponse AssignBadgeToAttended(Badge badge, Member member) { if (!Done) { return(DomainResponse.Error("El evento debe estar en Done antes de asignar Badges")); } var attended = Attendees.FirstOrDefault(a => a.MemberId == member.Id && a.Attended); if (attended == null) { return(DomainResponse.Error("El miembro tiene que estar como que asistio al evento")); } badge.Members.Add(new BadgeMember { BadgeId = badge.Id, MemberId = member.Id }); AddDomainEvent(new AssignedBadgeToMember(member.Id, badge.Id)); return(DomainResponse.Ok()); }