Ejemplo n.º 1
0
        public static string GetInvoice(DefaultContext db, UserProfile userProfile, BankAccount bankAccountForClaAccess, DateTime currentDate, out string invoiceNumber)
        {
            invoiceNumber = PropertiesBagCache.GetClaAccessInvoiceNumber(db);

            var vocabulary = new Dictionary<string, string>
                                 {
                                     {"InvoiceNumber", invoiceNumber},
                                     {"VS", BankAccountHistory.GetVs(userProfile.LyonessId).ToString(CultureInfo.InvariantCulture)},
                                     {"ICO", userProfile.ICO},
                                     {"DIC", userProfile.DIC},
                                     {"Address", String.Format("{0} {1}\n{2}\n{3} {4}", userProfile.FirstName, userProfile.LastName, userProfile.Address, userProfile.PSC, userProfile.City)},
                                     {"AccountId", bankAccountForClaAccess.AccountId},
                                     {"IBAN", bankAccountForClaAccess.IBAN},
                                     {"SWIFT", bankAccountForClaAccess.SWIFT},
                                     {"Date", currentDate.ToString("dd.MM.yyyy")},
                                     {"Currency", userProfile.ClaAccessCurrency.ToString()},
                                     {"Price", userProfile.ClaAccessYearlyAccess.ToString(CultureInfo.InvariantCulture)}
                                 };

            string invoice = ProcessVocabulary(Properties.Resources.Invoice, vocabulary);
            return invoice;
        }
Ejemplo n.º 2
0
        private static DeleteResult Delete(DefaultContext db, UrlHelper urlHelper, int id, bool checkLeadedUser, out UserProfile userProfile, int userId = 0, bool isAdmin = false)
        {
            userProfile = GetDetail(db, id);
            if (userProfile == null)
                return DeleteResult.AuthorizationFailed;

            if (checkLeadedUser)
            {
                bool isUserLeader = GetLeadedUserIds(db, userId).Contains(userProfile.UserId);
                if (!isAdmin && !isUserLeader)
                {
                    return DeleteResult.AuthorizationFailed;
                }
            }

            string[] roles = Roles.GetRolesForUser(userProfile.UserName);
            try
            {
                UserProfile registrar = GetDetail(db, userProfile.RegistrarId.GetValueOrDefault());
                ModifyMeetingAttendees(db, urlHelper, userProfile, registrar);
                ModifyMeetings(db, urlHelper, userProfile, registrar);

                var parameter = new SqlParameter(UserIdSqlParameter, userProfile.UserId);
                db.Database.ExecuteSqlCommand(CascadeRemoveUserProcedureTemplate, parameter);
            }
            catch (Exception e)
            {
                if (!Roles.GetRolesForUser(userProfile.UserName).Any())
                    Roles.AddUserToRoles(userProfile.UserName, roles);

                Logger.SetLog(e);

                return DeleteResult.DbFailed;
            }

            try
            {
                var parameter = new SqlParameter(UserIdSqlParameter, userProfile.UserId);
                db.Database.ExecuteSqlCommand(CascadeRemoveUserProfileProcedureTemplate, parameter);
                return DeleteResult.Ok;
            }
            catch (Exception e)
            {
                Logger.SetLog(e);
                return DeleteResult.DbFailed;
            }
        }
Ejemplo n.º 3
0
        public CheckBillingInformation(DefaultContext db, int userId)
        {
            _userProfile = UserProfileCache.GetDetail(db, userId);
            if (_userProfile == null)
                return;

            UserId = _userProfile.UserId;
            FirstName = _userProfile.FirstName;
            LastName = _userProfile.LastName;
            Address = _userProfile.Address;
            City = _userProfile.City;
            PSC = _userProfile.PSC;
            DIC = _userProfile.DIC;
            ICO = _userProfile.ICO;
        }
Ejemplo n.º 4
0
 public SettingsProfile(UserProfile userProfile)
     : base(userProfile)
 {
     Address = userProfile.Address;
     PSC = userProfile.PSC;
     DIC = userProfile.DIC;
     ICO = userProfile.ICO;
     ReminderTime = userProfile.ReminderTime;
     IsEventsPrivate = userProfile.IsEventsPrivate;
 }
Ejemplo n.º 5
0
        private void SendEmail(UserProfile userProfile, string newPassword, ref ModelStateDictionary modelStateDictionary)
        {
            if (userProfile == null)
                return;

            string textBody = String.Format(MailResource.AccountController_PasswordRecovery_TextBody, newPassword);
            if (Mail.SendEmail(userProfile.Email1, MailResource.AccountController_PasswordRecovery_Subject, textBody, true, true))
                return;

            modelStateDictionary.AddModelError(BaseCache.UserNameField, ValidationResource.Account_CannotSendEmailForPasswordRecovery_ErrorMessage);
        }
Ejemplo n.º 6
0
        private void ValidateActiveUser(UserProfile userProfile, ref ModelStateDictionary modelStateDictionary)
        {
            if (userProfile != null && userProfile.Active)
                return;

            modelStateDictionary.AddModelError(BaseCache.UserNameField, ValidationResource.Account_LockedAccount_ErrorMessage);
        }
Ejemplo n.º 7
0
        private void ValidateClaAccess(ref ModelStateDictionary modelStateDictionary, DefaultContext db, UserProfile userProfile)
        {
            // Kontrola na platnost přístup s platbou za přístup
            if (userProfile.IsAdmin ||
                userProfile.ClaAccessExpired >= DateTime.Now)
                return;

            decimal amountRemains = userProfile.ClaAccessYearlyAccess - userProfile.ClaAccessAmount;
            string paymentInformation = BankAccountCache.GetPaymentInfo(db, userProfile.ClaAccessCurrency, userProfile.LyonessId, amountRemains);
            string errorMessage = String.Format(ValidationResource.Account_AccountAccessIsExpired_ErrorMessage, paymentInformation);

            modelStateDictionary.AddModelError(String.Empty, errorMessage);
        }
Ejemplo n.º 8
0
 public UserProfileLockedUnlocked(UserProfile userProfile)
 {
     UserName = userProfile.UserName;
     FirstName = userProfile.FirstName;
     LastName = userProfile.LastName;
 }
Ejemplo n.º 9
0
        protected UserProfileEditBase(UserProfile userProfile)
        {
            Role = userProfile.Role;
            UserId = userProfile.UserId;
            UserName = userProfile.UserName;
            LyonessId = userProfile.LyonessId;
            Title = userProfile.Title;
            LastName = userProfile.LastName;
            FirstName = userProfile.FirstName;
            City = userProfile.City;
            DistrictId = userProfile.DistrictId;
            PhoneNumberPrefix1Id = userProfile.PhoneNumberPrefix1Id;
            PhoneNumber1 = userProfile.PhoneNumber1;
            PhoneNumberPrefix2Id = userProfile.PhoneNumberPrefix2Id;
            PhoneNumber2 = userProfile.PhoneNumber2;
            Email1 = userProfile.Email1;
            Email2 = userProfile.Email2;
            Skype = userProfile.Skype;
            SmsEmail = userProfile.SmsEmail;
            UseMail = userProfile.UseMail;
            UseSms = userProfile.UseSms;
            GoogleCredentialsJson = userProfile.GoogleCredentialsJson;
            GoogleCalendarId = userProfile.GoogleCalendarId;
            UseGoogleCalendar = userProfile.UseGoogleCalendar;
            PremiumMembershipGranted = userProfile.PremiumMembershipGranted;
            MspCoach = userProfile.MspCoach;
            Ca = userProfile.Ca;
            Presenting = userProfile.Presenting;
            Tasks = userProfile.Tasks;
            Note = userProfile.Note;
            LCIDDropDownList = userProfile.LCID;
            AutomaticLogoutInterval = userProfile.AutomaticLogoutInterval;

            ClaAccessAmountWithCurrency = userProfile.ClaAccessAmountWithCurrency;
            ClaAccessYearlyAccesWithCurrency = userProfile.ClaAccessYearlyAccesWithCurrency;
            ClaAccessExpired = userProfile.IsAdmin ? null : userProfile.ClaAccessExpired;
        }
Ejemplo n.º 10
0
        private void Validate()
        {
            if (_userId == BaseController.UserId)
            {
                SetStatusMessage(ValidationResource.UserProfile_CannotPromoteYourself_ErrorMessage);
                return;
            }

            _userProfile = UserProfileCache.GetDetail(BaseController.Db, _userId);
            if (_userProfile != null && _userProfile.Role == RoleType.AuthGuest)
                return;

            SetStatusMessage(ValidationResource.UserProfile_CannotPromoteUser_ErrorMessage);
        }
Ejemplo n.º 11
0
        private bool IsEditable(UserProfile userProfile, int id)
        {
            if (userProfile == null || userProfile.IsPoliciesAccepted && !IsAdmin)
                return false;

            return IsAccess(id);
        }
Ejemplo n.º 12
0
        private bool IsAccess(UserProfile userProfile, int id)
        {
            if (userProfile == null)
                return false;

            return IsAccess(id);
        }
Ejemplo n.º 13
0
 private static void SetRole(ref UserProfile userProfile)
 {
     if (userProfile != null)
     {
         userProfile.Role = UserProfile.GetRoleForUser(userProfile.UserName);
     }
 }
Ejemplo n.º 14
0
        private static void ModifyMeetings(DefaultContext db, UrlHelper urlHelper, UserProfile userProfile, UserProfile registrar)
        {
            var meetings =
                db.Meetings.Where(
                    m =>
                    m.OrganizerId == userProfile.UserId || m.MainLeaderId == userProfile.UserId ||
                    m.SecondaryOrganizerId == userProfile.UserId || m.SecondaryLeaderId == userProfile.UserId).Include(
                        m => m.MainLeader).ToArray();

            DateTime currentDateTime = DateTime.Now;
            var mailMessages = new List<MailMessage>();
            bool modified = false;
            foreach (Meeting meeting in meetings)
            {
                string meetingUrl = Url.GetActionAbsoluteUrl(urlHelper, MeetingCache.GetMeetingAction(meeting), "Meeting", new { id = meeting.MeetingId });

                if (meeting.MainLeaderId == userProfile.UserId)
                {
                    if (registrar == null)
                        throw new Exception(RegistrarIsNullErrorMessage);

                    meeting.MainLeaderId = registrar.UserId;
                    meeting.MainLeader = registrar;
                    modified = true;

                    if (meeting.Finished > currentDateTime && registrar.UseMail)
                    {
                        string textBody = String.Format(MailResource.UserProfileController_MainLeaderChanged_TextBody, meeting.Title, meetingUrl);
                        var mailMessage = new MailMessage { Address = registrar.Email1, Subject = MailResource.UserProfileController_MainLeaderChanged_Subject, TextBody = textBody };
                        mailMessages.Add(mailMessage);
                    }
                }

                if (meeting.OrganizerId == userProfile.UserId)
                {
                    meeting.OrganizerId = meeting.MainLeaderId;
                    modified = true;

                    if (meeting.Finished > currentDateTime && meeting.MainLeader.UseMail)
                    {
                        string textBody = String.Format(MailResource.UserProfileController_OrganizerChanged_TextBody, meeting.Title, meetingUrl);
                        var mailMessage = new MailMessage { Address = meeting.MainLeader.Email1, Subject = MailResource.UserProfileController_OrganizerChanged_Subject, TextBody = textBody };
                        mailMessages.Add(mailMessage);
                    }
                }

                if (meeting.SecondaryOrganizerId == userProfile.UserId)
                {
                    meeting.SecondaryOrganizerId = null;
                    meeting.SecondaryOrganizer = null;
                    modified = true;
                }

                if (meeting.SecondaryLeaderId == userProfile.UserId)
                {
                    if (registrar == null)
                        throw new Exception(RegistrarIsNullErrorMessage);

                    meeting.SecondaryLeaderId = registrar.UserId;
                    meeting.SecondaryLeader = registrar;
                    modified = true;

                    if (meeting.Finished > currentDateTime && registrar.UseMail)
                    {
                        string textBody = String.Format(MailResource.UserProfileController_SecondaryLeaderChanged_TextBody, meeting.Title, meetingUrl);
                        var mailMessage = new MailMessage { Address = registrar.Email1, Subject = MailResource.UserProfileController_SecondaryLeaderChanged_Subject, TextBody = textBody };
                        mailMessages.Add(mailMessage);
                    }
                }
            }

            if (modified)
            {
                db.SaveChanges();
            }

            foreach (MailMessage mailMessage in mailMessages)
            {
                Mail.SendEmail(mailMessage.Address, mailMessage.Subject, mailMessage.TextBody, true, true);
            }
        }
Ejemplo n.º 15
0
        private static void ModifyMeetingAttendees(DefaultContext db, UrlHelper urlHelper, UserProfile userProfile, UserProfile registrar)
        {
            DateTime currentDateTime = DateTime.Now;
            bool modified = false;

            MeetingAttendee[] meetingAttendeesByRegistrar = db.MeetingAttendees.Where(ma => ma.RegistrarId == userProfile.UserId).ToArray();
            foreach (MeetingAttendee meetingAttendee in meetingAttendeesByRegistrar)
            {
                if (registrar == null)
                    throw new Exception(RegistrarIsNullErrorMessage);

                meetingAttendee.RegistrarId = registrar.UserId;
                meetingAttendee.Registrar = registrar;
                modified = true;
            }

            var mailMessages = new List<MailMessage>();
            MeetingAttendee[] meetingAttendeesByUserAttendee = db.MeetingAttendees.Where(ma => ma.UserAttendeeId == userProfile.UserId && ma.Meeting.Finished > currentDateTime && userProfile.UseMail).Include(ma => ma.Meeting).ToArray();
            // ReSharper disable LoopCanBeConvertedToQuery
            foreach (MeetingAttendee meetingAttendee in meetingAttendeesByUserAttendee)
            // ReSharper restore LoopCanBeConvertedToQuery
            {
                string meetingUrl = Url.GetActionAbsoluteUrl(urlHelper, MeetingCache.GetMeetingAction(meetingAttendee.Meeting), "Meeting", new { id = meetingAttendee.Meeting.MeetingId });
                string textBody = String.Format(MailResource.UserProfileController_UserAttendeeWasRemoved_TextBody, meetingAttendee.Meeting.Title, meetingUrl);
                var mailMessage = new MailMessage { Address = userProfile.Email1, Subject = MailResource.UserProfileController_UserAttendeeWasRemoved_Subject, TextBody = textBody };
                mailMessages.Add(mailMessage);
            }

            int userId = userProfile.UserId;
            IQueryable<int> peopleContactIds = db.PeopleContacts.Where(pc => pc.RegistrarId == userId).Select(pc => pc.PeopleContactId);
            MeetingAttendee[] meetingAttendeesByAttendee = db.MeetingAttendees.Where(ma => ma.AttendeeId != null && peopleContactIds.Contains(ma.AttendeeId.Value) && ma.Meeting.Finished > currentDateTime && userProfile.UseMail).Include(ma => ma.Meeting).ToArray();
            // ReSharper disable LoopCanBeConvertedToQuery
            foreach (MeetingAttendee meetingAttendee in meetingAttendeesByAttendee)
            // ReSharper restore LoopCanBeConvertedToQuery
            {
                string meetingUrl = Url.GetActionAbsoluteUrl(urlHelper, MeetingCache.GetMeetingAction(meetingAttendee.Meeting), "Meeting", new { id = meetingAttendee.Meeting.MeetingId });
                string textBody = String.Format(MailResource.UserProfileController_AttendeeWasRemoved_TextBody, meetingAttendee.Attendee.FullName, meetingAttendee.Meeting.Title, meetingUrl);
                var mailMessage = new MailMessage { Address = userProfile.Email1, Subject = MailResource.UserProfileController_AttendeeWasRemoved_Subject, TextBody = textBody };
                mailMessages.Add(mailMessage);
            }

            if (modified)
            {
                db.SaveChanges();
            }

            foreach (MailMessage mailMessage in mailMessages)
            {
                Mail.SendEmail(mailMessage.Address, mailMessage.Subject, mailMessage.TextBody, true, true);
            }
        }
Ejemplo n.º 16
0
 public UserProfileDelete(UserProfile userProfile)
 {
     UserName = userProfile.UserName;
     FirstName = userProfile.FirstName;
     LastName = userProfile.LastName;
     LyonessId = userProfile.LyonessId;
 }
Ejemplo n.º 17
0
        public static UserProfileDelete GetModelView(UserProfile userProfile)
        {
            if (userProfile == null)
                return null;

            var userProfileDelete = new UserProfileDelete(userProfile);
            return userProfileDelete;
        }
Ejemplo n.º 18
0
        protected void ValidateChangeClaAccessCurrency(UserProfile userProfile, Currency[] currencies, ref ModelStateDictionary modelStateDictionary)
        {
            ClaAccessAmountWithCurrency = userProfile.ClaAccessAmountWithCurrency;
            ClaAccessYearlyAccesWithCurrency = userProfile.ClaAccessYearlyAccesWithCurrency;
            ClaAccessExpired = userProfile.IsAdmin ? null : userProfile.ClaAccessExpired;
            OriginalClaAccessAmount = userProfile.ClaAccessAmount;
            OriginalClaAccessCurrency = userProfile.ClaAccessCurrency;

            if (ClaAccessChangedCurrency == null || ClaAccessChangedCurrency == userProfile.ClaAccessCurrency)
            {
                ClaAccessAmount = userProfile.ClaAccessAmount;
                ClaAccessYearlyAccess = userProfile.ClaAccessYearlyAccess;
                ClaAccessCurrency = userProfile.ClaAccessCurrency;
                return;
            }

            try
            {
                ClaAccessAmount = CurrencyHelper.ConvertTo(userProfile.ClaAccessAmount, userProfile.ClaAccessCurrency, ClaAccessChangedCurrency.Value, currencies);
                ClaAccessYearlyAccess = userProfile.ClaAccessFixCurrencyChange
                                            ? userProfile.GetClaAccessYearlyAccess(ClaAccessChangedCurrency.Value)
                                            : (int)
                                              Math.Round(CurrencyHelper.ConvertTo(userProfile.ClaAccessYearlyAccess,
                                                                                  userProfile.ClaAccessCurrency,
                                                                                  ClaAccessChangedCurrency.Value,
                                                                                  currencies));
            }
            catch (Exception e)
            {
                modelStateDictionary.AddModelError(BaseCache.ClaAccessChangedCurrencyField, e.Message);
                return;
            }

            ClaAccessCurrency = ClaAccessChangedCurrency.Value;
        }
Ejemplo n.º 19
0
        public static UserProfileLockedUnlocked GetModelView(UserProfile userProfile)
        {
            if (userProfile == null)
                return null;

            var userProfileLocked = new UserProfileLockedUnlocked(userProfile);
            return userProfileLocked;
        }
Ejemplo n.º 20
0
        public UserProfileEdit(UserProfile userProfile)
            : base(userProfile)
        {

        }
Ejemplo n.º 21
0
        private void ProcessLogin(ref ModelStateDictionary modelStateDictionary, UserProfile userProfile)
        {
            if (WebSecurity.IsAuthenticated)
            {
                WebSecurity.Logout();
            }

            if (modelStateDictionary.Count > 0)
                return;

            if (WebSecurity.Login(UserName, Password, RememberMe))
            {
                UserId = userProfile.UserId;
                return;
            }

            if (modelStateDictionary.Count > 0)
                return;

            int passwordFailuresSinceLastSuccess = Settings.Default.AllowedPasswordAttempts - WebSecurity.GetPasswordFailuresSinceLastSuccess(UserName);
            modelStateDictionary.AddModelError(String.Empty, String.Format(ValidationResource.Account_LoginFailed_ErrorMessage, passwordFailuresSinceLastSuccess));
        }
Ejemplo n.º 22
0
        private void ValidateChangeRole(UserProfile userProfile, ref ModelStateDictionary modelStateDictionary)
        {
            if (userProfile.Role == RoleType.AuthGuest && Role != RoleType.AuthGuest)
            {
                modelStateDictionary.AddModelError(BaseCache.RoleField, ValidationResource.Account_CannotChangeRole_ErrorMessage);
            }

            if (userProfile.Role != RoleType.AuthGuest && Role == RoleType.AuthGuest)
            {
                modelStateDictionary.AddModelError(BaseCache.RoleField, ValidationResource.Account_CannotChangeRoleToAuthGuest_ErrorMessage);
            }
        }
Ejemplo n.º 23
0
        private void ResetPassword(UserProfile userProfile, string newPassword, ref ModelStateDictionary modelStateDictionary)
        {
            if (userProfile == null)
                return;

            string passwordResetToken = WebSecurity.GeneratePasswordResetToken(userProfile.UserName);
            if (WebSecurity.ResetPassword(passwordResetToken, newPassword))
                return;

            modelStateDictionary.AddModelError(BaseCache.UserNameField, ValidationResource.Account_PasswordRecoveryFailed_ErrorMessage);
        }
Ejemplo n.º 24
0
        private void AddAdditionalInformation(bool isAdmin, UserProfile userProfile)
        {
            if (!isAdmin)
            {
                Role = userProfile.Role;
            }

            UserName = userProfile.UserName;
        }
Ejemplo n.º 25
0
 private void SetDefaultData(UserProfile registrar)
 {
     DateTime currentDateTime = DateTime.Now;
     AccessGranted = currentDateTime;
     RegistrarId = registrar.UserId;
     ClaAccessExpired = DateTime.MaxValue;
     ClaAccessYearlyAccessCZK = registrar.ClaAccessYearlyAccessCZK;
     ClaAccessYearlyAccessEUR = registrar.ClaAccessYearlyAccessEUR;
     ClaAccessYearlyAccessUSD = registrar.ClaAccessYearlyAccessUSD;
     ClaAccessTrial = false;
     ClaAccessFixCurrencyChange = registrar.ClaAccessFixCurrencyChange;
     LCID = registrar.LCID;
 }
Ejemplo n.º 26
0
 public UserProfileDetails(UserProfile userProfile)
 {
     UserId = userProfile.UserId;
     UserName = userProfile.UserName;
     FirstName = userProfile.FirstName;
     LastName = userProfile.LastName;
     BillingInformation = SetBillingInformation(userProfile);
     Role = UserProfile.GetRoleTypeDisplayName(userProfile.Role);
     IsAdmin = userProfile.IsAdmin;
     Title = userProfile.Title;
     City = userProfile.City;
     District = DistrictDetails.GetModelView(userProfile.District);
     PhoneNumberPrefix1 = PhoneNumberPrefixDetails.GetModelView(userProfile.PhoneNumberPrefix1);
     PhoneNumber1 = userProfile.PhoneNumber1;
     PhoneNumberPrefix2 = PhoneNumberPrefixDetails.GetModelView(userProfile.PhoneNumberPrefix2);
     PhoneNumber2 = userProfile.PhoneNumber2;
     Email1 = userProfile.Email1;
     Email2 = userProfile.Email2;
     GoogleCredentialsJson = userProfile.GoogleCredentialsJson;
     GoogleCalendarId = userProfile.GoogleCalendarId;
     PremiumMembershipGranted = userProfile.PremiumMembershipGranted;
     AccessGranted = userProfile.AccessGranted;
     RegistredPeopleQuota = userProfile.RegistredPeopleQuota;
     RegistredPeopleQuotaLastMonth = userProfile.RegistredPeopleQuotaLastMonth;
     PremiumPartnersQuota = userProfile.PremiumPartnersQuota;
     PremiumPartnersQuotaLastMonth = userProfile.PremiumPartnersQuotaLastMonth;
     BuyersQuota = userProfile.BuyersQuota;
     ContactedPeopleCount = userProfile.ContactedPeopleCount;
     ContactedPeopleCountLastMonth = userProfile.ContactedPeopleCountLastMonth;
     Ca = userProfile.Ca;
     Presenting = userProfile.Presenting;
     MspCoach = userProfile.MspCoach;
     LastAccessed = userProfile.LastAccessed;
     Active = userProfile.Active;
     LyonessId = userProfile.LyonessId;
     Note = userProfile.Note;
     Tasks = userProfile.Tasks;
     Skype = userProfile.Skype;
     ClaAccessExpired = userProfile.ClaAccessExpired;
     ClaAccessAmountWithCurrency = userProfile.ClaAccessAmountWithCurrency;
     ClaAccessYearlyAccesWithCurrency = userProfile.ClaAccessYearlyAccesWithCurrency;
     IsPoliciesAccepted = userProfile.IsPoliciesAccepted;
 }
Ejemplo n.º 27
0
        private void AddAdditionalInformation(UserProfile userProfile, bool isAdmin)
        {
            Role = userProfile.Role;
            UserName = userProfile.UserName;

            if (!isAdmin)
            {
                PremiumMembershipGranted = userProfile.PremiumMembershipGranted;
                Ca = userProfile.Ca;
                Presenting = userProfile.Presenting;
                MspCoach = userProfile.MspCoach;
            }
        }
Ejemplo n.º 28
0
        public static UserProfileDetails GetModelView(UserProfile userProfile)
        {
            if (userProfile == null)
                return null;

            var userProfileDetails = new UserProfileDetails(userProfile);
            return userProfileDetails;
        }
Ejemplo n.º 29
0
        private void ValidateActiveAccount(ref ModelStateDictionary modelStateDictionary, UserProfile userProfile)
        {
            // Kontrola na zamknutí účtu kvůli neaktivnímu účtu.
            if (userProfile.Active)
                return;

            modelStateDictionary.AddModelError(String.Empty, ValidationResource.Account_AccountIsLocked_ErrorMessage);
        }
Ejemplo n.º 30
0
 private string SetBillingInformation(UserProfile userProfile)
 {
     var billingInformation = new StringBuilder();
     billingInformation.AppendLine(String.Format("{0} {1}", userProfile.FirstName, userProfile.LastName));
     billingInformation.AppendLine(userProfile.Address);
     billingInformation.AppendLine(String.Format("{0} {1}\n", userProfile.PSC, userProfile.City));
     billingInformation.AppendLine(String.Format("{0}: {1}", FieldResource.Global_ICO_Name, userProfile.ICO));
     billingInformation.AppendLine(String.Format("{0}: {1}", FieldResource.Global_DIC_Name, userProfile.DIC));
     return billingInformation.ToString();
 }