public MeetingBusinessInfoDetail(Meeting meeting, DefaultContext db, int userId, bool isAdmin) : base(meeting, db, userId, isAdmin) { if (meeting == null || meeting.MeetingType != MeetingType.Lgs) return; City = meeting.City; AddressLine1 = meeting.AddressLine1; MeetingType = MeetingType.Lgs; MeetingKind = MeetingKind.Public; Date = meeting.Started.Date; StartTime = meeting.Started.ToString("HH:mm"); FinishTime = meeting.Finished.ToString("HH:mm"); var attendees = new List<MeetingDetailAttendee>(); foreach (MeetingAttendee meetingAttendee in meeting.MeetingAttendees.Where(ma => ma.AttendeeId.HasValue || ma.UserAttendeeId.HasValue)) { MeetingDetailAttendee attendee; if (meetingAttendee.AttendeeId.HasValue) { bool showContactAcronym = ShowContactAcronym(db, userId, meetingAttendee.Attendee.RegistrarId); attendee = new MeetingDetailAttendee { MeetingAttendeeId = meetingAttendee.MeetingAttendeeId, FirstName = showContactAcronym ? meetingAttendee.Attendee.FirstNameAcronym : meetingAttendee.Attendee.FirstName, LastName = showContactAcronym ? meetingAttendee.Attendee.LastNameAcronym : meetingAttendee.Attendee.LastName, City = meetingAttendee.Attendee.CityIndexView, LyonessId = meetingAttendee.Attendee.LyonessId, Leader = meetingAttendee.Attendee.Registrar.FullNameWithoutLyonessId, AccessUnsign = isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId || meetingAttendee.Attendee.RegistrarId == userId }; } else { attendee = new MeetingDetailAttendee { MeetingAttendeeId = meetingAttendee.MeetingAttendeeId, FirstName = meetingAttendee.UserAttendee.FirstName, LastName = meetingAttendee.UserAttendee.LastName, City = meetingAttendee.UserAttendee.CityIndexView, LyonessId = meetingAttendee.UserAttendee.LyonessId, Leader = meetingAttendee.UserAttendee.Registrar == null ? NullDisplayText : meetingAttendee.UserAttendee.Registrar.FullNameWithoutLyonessId, AccessUnsign = isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId || meetingAttendee.UserAttendeeId == userId }; } attendees.Add(attendee); } MeetingAttendees = attendees.ToArray(); }
public static DeleteResult Delete(DefaultContext db, int id, out Meeting meeting) { meeting = GetDetail(db, id); if (meeting == null) return DeleteResult.AuthorizationFailed; try { var parameter = new SqlParameter(MeetingIdSqlParameter, meeting.MeetingId); db.Database.ExecuteSqlCommand(CascadeRemoveMeetingProcedureTemplate, parameter); return DeleteResult.Ok; } catch (Exception e) { Logger.SetLog(e); return DeleteResult.DbFailed; } }
public static string GetPaymentInfo(DefaultContext db, Meeting meeting, string lyonessId) { if (meeting.BankAccount == null) return String.Format(" {0}", MailResource.MeetingModelView_NoPaymentInfo_Text); var stringBuilder = new StringBuilder(); string paymentInfo = String.Format(MailResource.MeetingModelView_PaymentInfo_Text, meeting.BankAccount.AccountId, meeting.BankAccount.IBAN, meeting.BankAccount.SWIFT, meeting.SpecificSymbol, BankAccountHistory.GetVs(lyonessId), meeting.Price.GetValueOrDefault(), meeting.BankAccount != null ? meeting.BankAccount.CurrencyType : default(CurrencyType)); string[] paymentInfoRows = paymentInfo.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); foreach (string paymentInfoRow in paymentInfoRows) { stringBuilder.AppendLine(String.Format(" {0}", paymentInfoRow)); } if (meeting.SecondBankAccount == null) { return stringBuilder.ToString(); } stringBuilder.AppendLine(String.Format("\n{0}\n", ViewResource.Meeting_PaymentInfoOr_Text)); string secondPaymentInfo = String.Format(MailResource.MeetingModelView_PaymentInfo_Text, meeting.SecondBankAccount.AccountId, meeting.SecondBankAccount.IBAN, meeting.SecondBankAccount.SWIFT, meeting.SpecificSymbol, BankAccountHistory.GetVs(lyonessId), meeting.SecondPrice.GetValueOrDefault(), meeting.SecondBankAccount.CurrencyType); paymentInfoRows = secondPaymentInfo.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); foreach (string paymentInfoRow in paymentInfoRows) { stringBuilder.AppendLine(String.Format(" {0}", paymentInfoRow)); } return stringBuilder.ToString(); }
private MeetingOstatniEdit(Meeting meeting) : base(meeting) { City = meeting.City; AddressLine1 = meeting.AddressLine1; MeetingTitleTypeId = meeting.MeetingTitleTypeId.GetValueOrDefault(); MeetingKind = MeetingKind.Public; Date = meeting.Started.Date; Price = meeting.Price; SecondPrice = meeting.SecondPrice; BankAccountId = meeting.BankAccountId; SecondBankAccountId = meeting.SecondBankAccountId; RegisterDeadline = meeting.RegisterDeadline; }
public static string GetMeetingDetail(Meeting meeting) { var stringBuilder = new StringBuilder(); string meetingDetail = String.Format(MailResource.MeetingModelView_MeetingDetail_Text, meeting.Title, meeting.Started, meeting.Finished, meeting.City, meeting.AddressLine1, meeting.PrimaryAndSecondaryOrganizerFullName, meeting.Lecturer, !String.IsNullOrEmpty(meeting.BringYourOwn) ? meeting.BringYourOwn : BaseModelView.NullDisplayText, HtmlToText.ConvertHtml(meeting.Note)); string[] meetingDetailRows = meetingDetail.Split(new[] { Environment.NewLine }, StringSplitOptions.None); foreach (string meetingDetailRow in meetingDetailRows) { stringBuilder.AppendLine(String.Format(" {0}", meetingDetailRow)); } return stringBuilder.ToString(); }
public static string GetMeetingAction(Meeting meeting) { switch (meeting.MeetingType) { case MeetingType.Lgs: return "BusinessInfoDetails"; case MeetingType.SetkaniTymu: return "SetkaniTymuDetails"; case MeetingType.SkoleniDavidaKotaska: return "SkoleniDavidaKotaskaDetails"; case MeetingType.Ostatni: return "OstatniDetails"; case MeetingType.MspEvening: return "MspEveningDetails"; default: throw new ArgumentOutOfRangeException(); } }
public static bool Update(DefaultContext db, ref Meeting meeting) { Meeting dbMeeting = GetDetail(db, meeting.MeetingId); if (dbMeeting == null) return false; dbMeeting.CopyFrom(meeting); db.SaveChanges(); meeting = dbMeeting; return true; }
protected void ProcessUserSignUsign(Meeting meeting, DefaultContext db, int id, bool isAdmin, int userId, string searchString, string searchStringAccording, string sortOrder, string signedSortOrder, int pageNumber, int pageSize, int signedPageNumber) { if (!_availableForProcess) return; _availableForProcess = false; if (meeting.RegisterDeadline.GetValueOrDefault(DateTime.MaxValue) < DateTime.Now) return; IEnumerable<UserProfileIndex> userProfiles = isAdmin ? UserProfileIndex.GetUserProfileIndexForAdmin(db, userId, searchString, searchStringAccording, sortOrder) : UserProfileIndex.GetUserProfileIndex(db, userId, searchString, searchStringAccording, sortOrder); var attendees = new List<MeetingSignUnsignAttendee>(); var signedAttendees = new List<MeetingSignUnsignAttendee>(); foreach (UserProfileIndex userProfile in userProfiles) { bool signed = false; if (meeting.MeetingAttendees != null && meeting.MeetingAttendees.Any()) { signed = meeting.MeetingAttendees.Any(ma => ma.UserAttendeeId == userProfile.UserId); } if (!signed) { var attendee = new MeetingSignUnsignAttendee { AttendeeId = userProfile.UserId, Signed = false, FirstName = userProfile.FirstName, LastName = userProfile.LastName, City = userProfile.City }; attendees.Add(attendee); } else { var signedAttendee = new MeetingSignUnsignAttendee { AttendeeId = userProfile.UserId, Signed = true, FirstName = userProfile.FirstName, LastName = userProfile.LastName, City = userProfile.City }; signedAttendees.Add(signedAttendee); } } MeetingCache.ProcessSearchingAndSorting(ref attendees, ref signedAttendees, searchString, searchStringAccording, sortOrder, signedSortOrder); Attendees = attendees.ToPagedList(pageNumber, pageSize); SignedAttendees = signedAttendees.ToPagedList(signedPageNumber, pageSize); UserProfile user = UserProfileCache.GetDetail(db, userId); UserAttendee = new MeetingSignUnsignAttendee { AttendeeId = user.UserId, City = user.City, FirstName = user.FirstName, LastName = user.LastName, Signed = meeting.MeetingAttendees != null && meeting.MeetingAttendees.Any(ma => ma.UserAttendeeId == user.UserId) }; _availableForProcess = true; }
private MeetingBusinessInfoEdit(Meeting meeting) : base(meeting) { City = meeting.City; AddressLine1 = meeting.AddressLine1; MeetingType = MeetingType.Lgs; MeetingKind = MeetingKind.Public; Date = meeting.Started.Date; }
public static MeetingSkoleniDavidaKotaskaEdit GetModelView(Meeting meeting) { if (meeting == null || meeting.MeetingType != MeetingType.SkoleniDavidaKotaska) return null; var meetingViewSkoleniDavidaKotaska = new MeetingSkoleniDavidaKotaskaEdit(meeting); return meetingViewSkoleniDavidaKotaska; }
public MeetingSkoleniDavidaKotaskaSignUnsign(Meeting meeting, DefaultContext db, int id, bool isAdmin, int registrarId, string searchString, string searchStringAccording, string sortOrder, string signedSortOrder, int pageNumber, int pageSize, int signedPageNumber) : base(meeting, db, id, isAdmin) { IQueryable<PeopleContact> peopleContacts = PeopleContactCache.GetIndex(db, registrarId) .Where(pc => !String.IsNullOrEmpty(pc.LyonessId) && !String.IsNullOrEmpty(pc.PhoneNumber1) && !String.IsNullOrEmpty(pc.Email1)); ProcessSignUsign(meeting, peopleContacts, db, id, isAdmin, registrarId, searchString, searchStringAccording, sortOrder, signedSortOrder, pageNumber, pageSize, signedPageNumber); }
public MeetingSkoleniDavidaKotaskaDetail(Meeting meeting, DefaultContext db, int userId, bool isAdmin) : base(meeting, db, userId, isAdmin) { if (meeting == null || meeting.MeetingType != MeetingType.SkoleniDavidaKotaska) return; City = meeting.City; AddressLine1 = meeting.AddressLine1; MeetingType = MeetingType.SkoleniDavidaKotaska; MeetingKind = MeetingKind.Public; Title = meeting.Title; Date = meeting.Started.Date; StartTime = meeting.Started.ToString("HH:mm"); FinishTime = meeting.Finished.ToString("HH:mm"); Price = meeting.Price.HasValue && meeting.BankAccount != null ? String.Format("{0:N0} {1}", meeting.Price.GetValueOrDefault(), meeting.BankAccount.CurrencyType) : NullDisplayText; SecondPrice = meeting.SecondPrice.HasValue && meeting.SecondBankAccount != null ? String.Format("{0:N0} {1}", meeting.SecondPrice.GetValueOrDefault(), meeting.SecondBankAccount.CurrencyType) : NullDisplayText; RegisterDeadline = meeting.RegisterDeadline.GetValueOrDefault(); AccountId = meeting.BankAccount != null ? meeting.BankAccount.AccountId : NullDisplayText; SecondAccountId = meeting.SecondBankAccount != null ? meeting.SecondBankAccount.AccountId : NullDisplayText; Ss = meeting.MeetingId; BringYourOwn = meeting.BringYourOwn; AccessSignUnsign &= DateTime.Now <= meeting.RegisterDeadline.GetValueOrDefault(); int[] currentUserDownlineUserIds = UserProfileCache.GetDownlineUserIdsWithoutAdmins(db, userId) ?? new int[0]; var attendees = new List<MeetingDetailAttendee>(); foreach (MeetingAttendee meetingAttendee in meeting.MeetingAttendees.Where(ma => ma.AttendeeId.HasValue || ma.UserAttendeeId.HasValue)) { var formattingClass = new StringBuilder(); formattingClass.AppendFormat("{0} ", !meetingAttendee.Registered.HasValue ? MeetingAttendeeReservedClass : MeetingAttendeeRegisteredClass); formattingClass.Append(meetingAttendee.Reserved.GetValueOrDefault().Date == DateTime.MaxValue.Date ? MeetingAttendeeFreezedClass : String.Empty); string paidAmmount = String.Format("{0:N0} {1}", meetingAttendee.PaidAmount, meeting.BankAccount != null ? meeting.BankAccount.CurrencyType : default(CurrencyType)); if (meeting.SecondBankAccountId != null) { paidAmmount += String.Format(", {0:N0} {1}", meetingAttendee.SecondPaidAmount, meeting.SecondBankAccount.CurrencyType); } MeetingDetailAttendee attendee; if (meetingAttendee.AttendeeId.HasValue) { attendee = new MeetingDetailAttendee { MeetingAttendeeId = meetingAttendee.MeetingAttendeeId, FirstName = meetingAttendee.Attendee.FirstName, LastName = meetingAttendee.Attendee.LastName, LyonessId = meetingAttendee.Attendee.LyonessId, PaidAmmount = paidAmmount, FormattingClass = formattingClass.ToString(), City = meetingAttendee.Attendee.CityIndexView, Leader = meetingAttendee.Attendee.Registrar.FullNameWithoutLyonessId, AccessUnsign = isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId || !meetingAttendee.Registered.HasValue && meetingAttendee.Reserved.GetValueOrDefault().Date != DateTime.MaxValue.Date && meetingAttendee.Attendee.RegistrarId == userId, AccessLocking = !meetingAttendee.Registered.HasValue && (isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId), IsReservationLocked = meetingAttendee.Reserved.GetValueOrDefault().Date == DateTime.MaxValue.Date }; } else { attendee = new MeetingDetailAttendee { MeetingAttendeeId = meetingAttendee.MeetingAttendeeId, FirstName = meetingAttendee.UserAttendee.FirstName, LastName = meetingAttendee.UserAttendee.LastName, LyonessId = meetingAttendee.UserAttendee.LyonessId, PaidAmmount = paidAmmount, FormattingClass = formattingClass.ToString(), City = meetingAttendee.UserAttendee.CityIndexView, Leader = meetingAttendee.UserAttendee.Registrar == null ? NullDisplayText : meetingAttendee.UserAttendee.Registrar.FullNameWithoutLyonessId, AccessUnsign = isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId || !meetingAttendee.Registered.HasValue && meetingAttendee.Reserved.GetValueOrDefault().Date != DateTime.MaxValue.Date && (meetingAttendee.UserAttendeeId == userId || currentUserDownlineUserIds.Contains(meetingAttendee.UserAttendeeId.GetValueOrDefault())), AccessLocking = !meetingAttendee.Registered.HasValue && (isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId), IsReservationLocked = meetingAttendee.Reserved.GetValueOrDefault().Date == DateTime.MaxValue.Date }; } attendees.Add(attendee); } MeetingAttendees = attendees.ToArray(); }
private MeetingSkoleniDavidaKotaskaEdit(Meeting meeting) : base(meeting) { City = meeting.City; AddressLine1 = meeting.AddressLine1; MeetingType = MeetingType.SkoleniDavidaKotaska; MeetingKind = MeetingKind.Public; Title = meeting.Title; Date = meeting.Started.Date; Price = meeting.Price.GetValueOrDefault(); SecondPrice = meeting.SecondPrice; BankAccountId = meeting.BankAccountId.GetValueOrDefault(); SecondBankAccountId = meeting.SecondBankAccountId; RegisterDeadline = meeting.RegisterDeadline.GetValueOrDefault(); BringYourOwn = meeting.BringYourOwn; }
public static MeetingBusinessInfoEdit GetModelView(Meeting meeting) { if (meeting == null || meeting.MeetingType != MeetingType.Lgs) return null; var meetingBusinessInfo = new MeetingBusinessInfoEdit(meeting); return meetingBusinessInfo; }
public static MeetingSetkaniTymuEdit GetModelView(Meeting meeting) { if (meeting == null || meeting.MeetingType != MeetingType.SetkaniTymu) return null; var meetingViewSetkaniTymu = new MeetingSetkaniTymuEdit(meeting); return meetingViewSetkaniTymu; }
private MeetingSetkaniTymuEdit(Meeting meeting) : base(meeting) { City = meeting.City; AddressLine1 = meeting.AddressLine1; MeetingTitleTypeId = meeting.MeetingTitleTypeId.GetValueOrDefault(); MeetingKind = MeetingKind.Public; Title = meeting.Title; DateStartTime = meeting.Started.Date; DateFinishTime = meeting.Finished.Date; InvitationCardUrl = meeting.InvitationCardUrl; Price = meeting.Price.GetValueOrDefault(); SecondPrice = meeting.SecondPrice; BankAccountId = meeting.BankAccountId.GetValueOrDefault(); SecondBankAccountId = meeting.SecondBankAccountId; RegisterDeadline = meeting.RegisterDeadline.GetValueOrDefault(); BringYourOwn = meeting.BringYourOwn; }
protected MeetingDetail(Meeting meeting, DefaultContext db, int userId, bool isAdmin) { if (meeting == null) return; MeetingId = meeting.MeetingId; Finished = meeting.Finished; Organizer = meeting.Organizer.FullNameWithoutLyonessId; if (meeting.SecondaryOrganizerId.HasValue) { Organizer = String.Format("{0}, {1}", Organizer, meeting.SecondaryOrganizer.FullNameWithoutLyonessId); } FreeCapacity = meeting.Capacity - meeting.MeetingAttendees.Count; Capacity = meeting.Capacity; MainLeader = meeting.MainLeader.FullNameWithoutLyonessId; MainLeaderId = meeting.MainLeaderId; SecondaryLeader = meeting.SecondaryLeaderId.HasValue ? meeting.SecondaryLeader.FullNameWithoutLyonessId : String.Empty; SecondaryLeaderId = meeting.SecondaryLeaderId; OrganizerId = meeting.OrganizerId; Lecturer = meeting.Lecturer; Note = meeting.Note; SignedAttendees = new PagedList<MeetingSignUnsignAttendee>(new MeetingSignUnsignAttendee[0], 1, 1); IsArchive = meeting.Finished <= DateTime.Now; int[] downlineUsersIdsWithoutAdmins = UserProfileCache.GetDownlineUserIdsWithoutAdmins(db, meeting.MainLeaderId, SecondaryLeaderId); AccessSignUnsign = isAdmin || downlineUsersIdsWithoutAdmins.Contains(userId); AccessEdit = isAdmin || meeting.OrganizerId == userId || meeting.SecondaryOrganizerId == userId; _availableForProcess = true; }
protected MeetingEdit(Meeting meeting) : this() { if (meeting == null) return; MeetingId = meeting.MeetingId; OrganizerId = meeting.OrganizerId; SecondaryOrganizerId = meeting.SecondaryOrganizerId; StartTime = meeting.Started.ToString("HH:mm"); FinishTime = meeting.Finished.ToString("HH:mm"); Capacity = meeting.Capacity; MainLeaderId = meeting.MainLeaderId; SecondaryLeaderId = meeting.SecondaryLeaderId; Lecturer = meeting.Lecturer; Note = meeting.Note; Private = meeting.Private; }
protected void ProcessSignUsign(Meeting meeting, IQueryable<PeopleContact> peopleContacts, DefaultContext db, int id, bool isAdmin, int registrarId, string searchString, string searchStringAccording, string sortOrder, string signedSortOrder, int pageNumber, int pageSize, int signedPageNumber) { if (!_availableForProcess) return; _availableForProcess = false; if (meeting.RegisterDeadline.GetValueOrDefault(DateTime.MaxValue) < DateTime.Now) return; var attendees = new List<MeetingSignUnsignAttendee>(); var signedAttendees = new List<MeetingSignUnsignAttendee>(); foreach (PeopleContact peopleContact in peopleContacts) { bool signed = false; if (meeting.MeetingAttendees != null && meeting.MeetingAttendees.Any()) { signed = meeting.MeetingAttendees.Any(ma => ma.AttendeeId == peopleContact.PeopleContactId); } if (!signed) { var attendee = new MeetingSignUnsignAttendee { AttendeeId = peopleContact.PeopleContactId, Signed = false, FirstName = peopleContact.FirstName, LastName = peopleContact.LastName, City = peopleContact.City }; attendees.Add(attendee); } else { var signedAttendee = new MeetingSignUnsignAttendee { AttendeeId = peopleContact.PeopleContactId, Signed = true, FirstName = peopleContact.FirstName, LastName = peopleContact.LastName, City = peopleContact.City }; signedAttendees.Add(signedAttendee); } } MeetingCache.ProcessSearchingAndSorting(ref attendees, ref signedAttendees, searchString, searchStringAccording, sortOrder, signedSortOrder); Attendees = attendees.ToPagedList(pageNumber, pageSize); SignedAttendees = signedAttendees.ToPagedList(signedPageNumber, pageSize); UserProfile userProfile = UserProfileCache.GetDetail(db, registrarId); UserAttendee = new MeetingSignUnsignAttendee { AttendeeId = registrarId, City = userProfile.City, FirstName = userProfile.FirstName, LastName = userProfile.LastName, Signed = meeting.MeetingAttendees != null && meeting.MeetingAttendees.Any(ma => ma.UserAttendeeId == registrarId) }; _availableForProcess = true; }
private static bool RegisterAttendee(DefaultContext db, MeetingAttendee[] meetingAttendees, string bankAccountHistoryLyonessId, string bankAccountHistoryNote, Meeting meeting, int paidAmount, DateTime currentDateTime, bool isSecondBankAccount, ref int freeCapacity) { int meetingPrice = isSecondBankAccount ? meeting.SecondPrice.GetValueOrDefault() : meeting.Price.GetValueOrDefault(); string maxReservationDate = MeetingAttendeeCache.GetMaxReservationDate(currentDateTime); // Registrace nebo akumulace nižší platby přihlášeného uživatele IEnumerable<MeetingAttendee> userMeetingAttendees = meetingAttendees.Where(ma => ma.UserAttendeeId.HasValue); MeetingAttendee meetingAttendee = userMeetingAttendees.FirstOrDefault(ua => ua.UserAttendee.LyonessId == bankAccountHistoryLyonessId); if (meetingAttendee != null) { if (meetingAttendee.Registered.HasValue) return false; int totalPaidAmount = (isSecondBankAccount ? meetingAttendee.SecondPaidAmount : meetingAttendee.PaidAmount) + paidAmount; string totalBankAccountHistoryNote = String.IsNullOrEmpty(meetingAttendee.BankAccountHistoryNote) ? bankAccountHistoryNote : String.Format("{0}\n\n{1}", bankAccountHistoryNote, meetingAttendee.BankAccountHistoryNote); if (isSecondBankAccount) { meetingAttendee.SecondPaidAmount = totalPaidAmount; } else { meetingAttendee.PaidAmount = totalPaidAmount; } meetingAttendee.Reserved = currentDateTime; meetingAttendee.BankAccountHistoryNote = totalBankAccountHistoryNote; string meetingDetail = MeetingCommon.GetMeetingDetail(meeting); string paymentInfo = MeetingCommon.GetPaymentInfo(db, meeting, bankAccountHistoryLyonessId); string textBody; if (totalPaidAmount < meetingPrice) { textBody = String.Format(MailResource.MeetingController_PaymentIsLow_TextBody, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meetingAttendee.UserAttendee.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerPaymentIsLow_TextBody, meetingAttendee.UserAttendee.FullName, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); } } else if (totalPaidAmount > meetingPrice) { meetingAttendee.MeetingAttendeeType = MeetingAttendeeType.Registred; meetingAttendee.Registered = currentDateTime; textBody = String.Format(MailResource.MeetingController_PaymentIsHigh_TextBody, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meetingAttendee.UserAttendee.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(meetingAttendee.UserAttendee.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerPaymentIsHigh_TextBody, meetingAttendee.UserAttendee.FullName, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); } } else { meetingAttendee.MeetingAttendeeType = MeetingAttendeeType.Registred; meetingAttendee.Registered = currentDateTime; textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(meetingAttendee.UserAttendee.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } return true; } // Registrace nebo akumulace nižší platby přihlášeného kontaktu var peopleContactMeetingAttendees = meetingAttendees.Where(ma => ma.AttendeeId.HasValue); meetingAttendee = peopleContactMeetingAttendees.FirstOrDefault(a => a.Attendee.LyonessId == bankAccountHistoryLyonessId); if (meetingAttendee != null) { if (meetingAttendee.Registered.HasValue) return false; int totalPaidAmount = (isSecondBankAccount ? meetingAttendee.SecondPaidAmount : meetingAttendee.PaidAmount) + paidAmount; string totalBankAccountHistoryNote = String.IsNullOrEmpty(meetingAttendee.BankAccountHistoryNote) ? bankAccountHistoryNote : String.Format("{0}\n\n{1}", bankAccountHistoryNote, meetingAttendee.BankAccountHistoryNote); if (isSecondBankAccount) { meetingAttendee.SecondPaidAmount = totalPaidAmount; } else { meetingAttendee.PaidAmount = totalPaidAmount; } meetingAttendee.Reserved = currentDateTime; meetingAttendee.BankAccountHistoryNote = totalBankAccountHistoryNote; string meetingDetail = MeetingCommon.GetMeetingDetail(meeting); string paymentInfo = MeetingCommon.GetPaymentInfo(db, meeting, bankAccountHistoryLyonessId); string textBody; if (totalPaidAmount < meetingPrice) { if (!String.IsNullOrEmpty(meetingAttendee.Attendee.Email1)) { textBody = String.Format(MailResource.MeetingController_PaymentIsLow_TextBody, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meetingAttendee.Attendee.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); } textBody = String.Format(MailResource.MeetingController_OwnerPaymentIsLow_TextBody, meetingAttendee.Attendee.FullName, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meetingAttendee.Attendee.Registrar.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerContactPaymentIsLow_TextBody, meetingAttendee.Attendee.FullName, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); } } else if (totalPaidAmount > meetingPrice) { meetingAttendee.MeetingAttendeeType = MeetingAttendeeType.Registred; meetingAttendee.Registered = currentDateTime; if (!String.IsNullOrEmpty(meetingAttendee.Attendee.Email1)) { textBody = String.Format(MailResource.MeetingController_PaymentIsHigh_TextBody, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meetingAttendee.Attendee.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(meetingAttendee.Attendee.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } textBody = String.Format(MailResource.MeetingController_OwnerPaymentIsHigh_TextBody, meetingAttendee.Attendee.FullName, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meetingAttendee.Attendee.Registrar.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OwnerRegisteredContact_TextBody, meetingAttendee.Attendee.FullName, meeting.Title, meetingDetail); Mail.SendEmail(meetingAttendee.Attendee.Registrar.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerContactPaymentIsHigh_TextBody, meetingAttendee.Attendee.FullName, meeting.Title, meetingDetail, paymentInfo, totalPaidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); } } else { meetingAttendee.MeetingAttendeeType = MeetingAttendeeType.Registred; meetingAttendee.Registered = currentDateTime; if (!String.IsNullOrEmpty(meetingAttendee.Attendee.Email1)) { textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(meetingAttendee.Attendee.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } textBody = String.Format(MailResource.MeetingController_OwnerRegisteredContact_TextBody, meetingAttendee.Attendee.FullName, meeting.Title, meetingDetail); Mail.SendEmail(meetingAttendee.Attendee.Registrar.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } return true; } if (freeCapacity <= 0) return false; meetingAttendee = new MeetingAttendee { MeetingId = meeting.MeetingId, MeetingAttendeeType = paidAmount >= meetingPrice ? MeetingAttendeeType.Registred : MeetingAttendeeType.Reserved, PaidAmount = isSecondBankAccount ? 0 : paidAmount, SecondPaidAmount = isSecondBankAccount ? paidAmount : 0, Reserved = currentDateTime, Registered = paidAmount >= meetingPrice ? currentDateTime : new DateTime?(), BonusLyonessId = bankAccountHistoryLyonessId, BankAccountHistoryNote = bankAccountHistoryNote }; // Registrace nebo rezervace nepřihlášeného uživatele UserProfile[] userProfiles = db.UserProfiles.Where(up => up.LyonessId == bankAccountHistoryLyonessId).ToArray(); if (userProfiles.Length == 1) { freeCapacity--; UserProfile userProfile = userProfiles[0]; meetingAttendee.UserAttendeeId = userProfile.UserId; meetingAttendee.RegistrarId = userProfile.UserId; db.MeetingAttendees.Add(meetingAttendee); string meetingDetail = MeetingCommon.GetMeetingDetail(meeting); string paymentInfo = MeetingCommon.GetPaymentInfo(db, meeting, bankAccountHistoryLyonessId); string textBody; if (paidAmount < meetingPrice) { textBody = String.Format(MailResource.MeetingController_Signed_TextBody, meeting.Title, maxReservationDate, meetingDetail, paymentInfo); Mail.SendEmail(userProfile.Email1, MailResource.MeetingController_Signed_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_PaymentIsLow_TextBody, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(userProfile.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerPaymentIsLow_TextBody, userProfile.FullName, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); } } else if (paidAmount > meetingPrice) { textBody = String.Format(MailResource.MeetingController_PaymentIsHigh_TextBody, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(userProfile.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(userProfile.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerPaymentIsHigh_TextBody, userProfile.FullName, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); } } else { textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(userProfile.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } return true; } // Registrace nebo rezervace nepřihlášeného kontaktu var peopleContacts = db.PeopleContacts.Where(pc => pc.LyonessId == bankAccountHistoryLyonessId).ToArray(); if (peopleContacts.Length == 1) { freeCapacity--; PeopleContact peopleContact = peopleContacts[0]; meetingAttendee.AttendeeId = peopleContact.PeopleContactId; meetingAttendee.RegistrarId = peopleContact.RegistrarId; db.MeetingAttendees.Add(meetingAttendee); string meetingDetail = MeetingCommon.GetMeetingDetail(meeting); string paymentInfo = MeetingCommon.GetPaymentInfo(db, meeting, bankAccountHistoryLyonessId); string textBody; if (paidAmount < meetingPrice) { if (!String.IsNullOrEmpty(peopleContact.Email1)) { textBody = String.Format(MailResource.MeetingController_Signed_TextBody, meeting.Title, maxReservationDate, meetingDetail, paymentInfo); Mail.SendEmail(peopleContact.Email1, MailResource.MeetingController_Signed_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_PaymentIsLow_TextBody, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(peopleContact.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); } textBody = String.Format(MailResource.MeetingController_OwnerSignedContact_TextBody, peopleContact.FullName, meeting.Title, maxReservationDate, meetingDetail, paymentInfo); Mail.SendEmail(peopleContact.Registrar.Email1, MailResource.MeetingController_Signed_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OwnerPaymentIsLow_TextBody, peopleContact.FullName, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(peopleContact.Registrar.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerContactPaymentIsLow_TextBody, peopleContact.FullName, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsLow_Subject, textBody, true, true); } } else if (paidAmount > meetingPrice) { if (!String.IsNullOrEmpty(peopleContact.Email1)) { textBody = String.Format(MailResource.MeetingController_PaymentIsHigh_TextBody, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(peopleContact.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(peopleContact.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } textBody = String.Format(MailResource.MeetingController_OwnerPaymentIsHigh_TextBody, peopleContact.FullName, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(peopleContact.Registrar.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OwnerRegisteredContact_TextBody, peopleContact.FullName, meeting.Title, meetingDetail); Mail.SendEmail(peopleContact.Registrar.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); textBody = String.Format(MailResource.MeetingController_OrganizerContactPaymentIsHigh_TextBody, peopleContact.FullName, meeting.Title, meetingDetail, paymentInfo, paidAmount); Mail.SendEmail(meeting.Organizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); if (meeting.SecondaryOrganizerId.HasValue) { Mail.SendEmail(meeting.SecondaryOrganizer.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); } } else { if (!String.IsNullOrEmpty(peopleContact.Email1)) { textBody = String.Format(MailResource.MeetingController_Registered_TextBody, meeting.Title, meetingDetail); Mail.SendEmail(peopleContact.Email1, MailResource.MeetingController_Registered_Subject, textBody, true, true); } textBody = String.Format(MailResource.MeetingController_OwnerRegisteredContact_TextBody, peopleContact.FullName, meeting.Title, meetingDetail); Mail.SendEmail(peopleContact.Registrar.Email1, MailResource.MeetingController_PaymentIsHigh_Subject, textBody, true, true); } return true; } return false; }
public MeetingWebinarDetail(Meeting meeting, DefaultContext db, int userId, bool isAdmin, string sortOrder) : this(meeting, db, userId, isAdmin) { MeetingAttendees = MeetingCache.ProcessSorting(MeetingAttendees, sortOrder); }
public static MeetingOstatniEdit GetModelView(Meeting meeting) { if (meeting == null || meeting.MeetingType != MeetingType.Ostatni) return null; var meetingViewOstatni = new MeetingOstatniEdit(meeting); return meetingViewOstatni; }
protected Meeting GetCommonModel(int userId) { var meeting = new Meeting { OrganizerId = OrganizerId.HasValue ? OrganizerId.GetValueOrDefault() : userId, SecondaryOrganizerId = SecondaryOrganizerId, Capacity = Capacity, MainLeaderId = MainLeaderId, SecondaryLeaderId = SecondaryLeaderId, Lecturer = Lecturer, Note = Note, Private = Private }; if (MeetingId.HasValue) { meeting.MeetingId = MeetingId.GetValueOrDefault(); } return meeting; }
private MeetingWebinarEdit(Meeting meeting) : base(meeting) { MeetingType = MeetingType.Webinar; MeetingKind = MeetingKind.Public; Date = meeting.Started.Date; WebinarUrl = meeting.WebinarUrl; }
public void CopyFrom(Meeting meeting) { OrganizerId = meeting.OrganizerId; SecondaryOrganizerId = meeting.SecondaryOrganizerId; MainLeaderId = meeting.MainLeaderId; SecondaryLeaderId = meeting.SecondaryLeaderId; MeetingTitleTypeId = meeting.MeetingTitleTypeId; Title = meeting.Title; MeetingKind = meeting.MeetingKind; MeetingType = meeting.MeetingType; City = meeting.City; AddressLine1 = meeting.AddressLine1; AddressLine2 = meeting.AddressLine2; Chargeable = meeting.Chargeable; Price = meeting.Price; SecondPrice = meeting.SecondPrice; BankAccountId = meeting.BankAccountId; SecondBankAccountId = meeting.SecondBankAccountId; WithAccommodation = meeting.WithAccommodation; PriceWithAccommodation = meeting.PriceWithAccommodation; Started = meeting.Started; Finished = meeting.Finished; BringYourOwn = meeting.BringYourOwn; Capacity = meeting.Capacity; AccomodationCapacity = meeting.AccomodationCapacity; RegisterDeadline = meeting.RegisterDeadline; Lecturer = meeting.Lecturer; InvitationCardUrl = meeting.InvitationCardUrl; Note = meeting.Note; Private = meeting.Private; WebinarUrl = meeting.WebinarUrl; }
public static MeetingWebinarEdit GetModelView(Meeting meeting) { if (meeting == null || meeting.MeetingType != MeetingType.Webinar) return null; var meetingWebinar = new MeetingWebinarEdit(meeting); return meetingWebinar; }
public MeetingBusinessInfoSignUnsign(Meeting meeting, DefaultContext db, int id, bool isAdmin, int registrarId, string searchString, string searchStringAccording, string sortOrder, string signedSortOrder, int pageNumber, int pageSize, int signedPageNumber) : base(meeting, db, id, isAdmin) { IQueryable<PeopleContact> peopleContacts = PeopleContactCache.GetIndex(db, registrarId); ProcessSignUsign(meeting, peopleContacts, db, id, isAdmin, registrarId, searchString, searchStringAccording, sortOrder, signedSortOrder, pageNumber, pageSize, signedPageNumber); }
public MeetingBusinessInfoUserSignUnsign(Meeting meeting, DefaultContext db, int id, bool isAdmin, int userId, string searchString, string searchStringAccording, string sortOrder, string signedSortOrder, int pageNumber, int pageSize, int signedPageNumber) : base(meeting, db, id, isAdmin) { ProcessUserSignUsign(meeting, db, id, isAdmin, userId, searchString, searchStringAccording, sortOrder, signedSortOrder, pageNumber, pageSize, signedPageNumber); }
private bool IsAccess(Meeting meeting, IMeetingEdit meetingEdit) { if (meeting == null || (!IsAdmin && meeting.OrganizerId != UserId && meeting.SecondaryOrganizerId != UserId) || meeting.Finished <= DateTime.Now) { return false; } return meetingEdit != null; }
public static MeetingMspEveningEdit GetModelView(Meeting meeting) { if (meeting == null || meeting.MeetingType != MeetingType.MspEvening) return null; var meetingMspEvening = new MeetingMspEveningEdit(meeting); return meetingMspEvening; }