Esempio n. 1
0
        public RegistrationFormViewModel CreateMember(int id)
        {
            RegistrationFormViewModel model = new RegistrationFormViewModel();

            using (var unitOfWork = new UnitOfWork(_dbContext))
            {
                var m = unitOfWork.Members.Get(id);
                if (m != null)
                {
                    model.Id             = m.Id;
                    model.LocationId     = m.LocationId;
                    model.MembershipType = m.MembershipType;
                    model.ReferredBy     = m.ReferredBy;
                    model.IsNew          = false;
                }
                else
                {
                    model.IsNew = true;
                }
                model.Locations  = unitOfWork.Locations.GetLocationFeeDropDown(unitOfWork);
                model.Categories = unitOfWork.Categories.GetDropDown(unitOfWork);
                model.Referrers  = unitOfWork.Referrers.GetDropDown(unitOfWork);
                model.Modes      = unitOfWork.Modes.GetDropDown(unitOfWork);
            };

            return(model);
        }
Esempio n. 2
0
        public ActionResult Register(RegistrationFormViewModel vm)
        {
            if (!ModelState.IsValid)
            {
                return(CurrentUmbracoPage());
            }

            var member = Members.CreateRegistrationModel();

            member.Name            = vm.Name;
            member.Email           = vm.Email;
            member.Password        = vm.Password;
            member.UsernameIsEmail = true;
            MembershipCreateStatus status;

            Members.RegisterMember(member, out status);
            if (!status.Equals(MembershipCreateStatus.Success))
            {
                return(CurrentUmbracoPage());
            }

            var email = new EmailDetail
            {
                To = new List <string> {
                    member.Email
                },
                Subject    = "Registraion confirmation",
                IsBodyHtml = false
            };

            _mailer.Send(email);

            return(RedirectToCurrentUmbracoPage());
        }
Esempio n. 3
0
        public RegistrationFormViewModel GetRegistrationViewModels(int id)
        {
            RegistrationFormViewModel model = new RegistrationFormViewModel();

            using (var unitOfWork = new UnitOfWork(_dbContext))
            {
                Member member = unitOfWork
                                .Members.Get(id);
                if (member != null)
                {
                    model.Member = member.Adapt <MemberViewModels>();
                }

                SpouseViewModels spouse = unitOfWork
                                          .Spouses
                                          .GetSpouseByMemberId(id)
                                          .Adapt <SpouseViewModels>();

                model.Spouse = (spouse != null)
                    ? spouse
                    : null;

                List <DependentViewModels> dependents = unitOfWork
                                                        .Dependents
                                                        .GetDependentsByMemberId(id)
                                                        .Adapt <List <DependentViewModels> >();
                if (dependents.Count > 0)
                {
                    model.Dependent = dependents;
                }

                PaymentViewModel payment = unitOfWork
                                           .Payments
                                           .GetPaymentByMemberId(id)
                                           .Adapt <PaymentViewModel>();
                if (payment != null)
                {
                    model.Payment = payment;
                    List <ChequeViewModels> cheques = unitOfWork
                                                      .Cheques
                                                      .GetChequesByPaymentId(payment.Id)
                                                      .Adapt <List <ChequeViewModels> >();
                    if (cheques.Count > 0)
                    {
                        model.Payment.Cheques = cheques;
                    }

                    FeeViewModels fee = unitOfWork
                                        .Fees
                                        .Get(payment.MembershipFeeId)
                                        .Adapt <FeeViewModels>();
                }

                model.Member.Locations  = unitOfWork.Locations.GetDropDown(unitOfWork);
                model.Member.Categories = unitOfWork.Categories.GetDropDown(unitOfWork);
                model.Member.Referrers  = unitOfWork.Referrers.GetDropDown(unitOfWork);
                model.Payment.Modes     = unitOfWork.Modes.GetDropDown(unitOfWork);
            }
            return(model);
        }
        public ActionResult Register(RegistrationFormViewModel user)
        {
            ViewBag.Roles = new SelectList(IUserBL.GetRoles(), "RoleID", "RoleName");

            if (!ModelState.IsValid)
            {
                return(View("Register", user));
            }
            else
            {
                var     config  = new MapperConfiguration(cfg => { cfg.CreateMap <RegistrationFormViewModel, User>(); });
                IMapper iMapper = config.CreateMapper();
                User    _user   = iMapper.Map <RegistrationFormViewModel, User>(user);

                ViewBag.Alert = IUserBL.AddUser(_user);

                if (ViewBag.Alert == null)
                {
                    ViewBag.Message = "Registration Successfull";
                    ViewBag.Alert   = null;
                }
            }

            return(View(user));
        }
Esempio n. 5
0
        // GET: RegistrationForms/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            if (_context.UserBadges.Where(a => a.UserId == _userManager.GetUserId(User)).Count() == 0)
            {
                ViewData["BadgeStatus"] = "false";
            }
            ;
            var XViewModel = new RegistrationFormViewModel
            {
                RegistrationForm = await _context.RegistrationForms
                                   .Include(r => r.ApplicationUser)
                                   .Include(r => r.EmailContent)
                                   .Include(r => r.EmailContentReminder)
                                   .SingleOrDefaultAsync(m => m.Id == id),
                UserExpressInterests = _context.UserExpressInterests.Where(a => a.RegistrationFormId == id).Include(a => a.ApplicationUser)
            };

            //var registrationForm = await _context.RegistrationForm
            //    .Include(r => r.ApplicationUser)
            //    .Include(r => r.EmailContent)
            //    .Include(r => r.EmailContentReminder)
            //    .SingleOrDefaultAsync(m => m.Id == id);
            //if (registrationForm == null)
            //{
            //    return NotFound();
            //}

            return(View(XViewModel));
        }
Esempio n. 6
0
 private RegistrationFormViewModel FillDropDowns(IUnitOfWork unitOfWork, RegistrationFormViewModel model)
 {
     model.Locations  = unitOfWork.Locations.GetDropDown(unitOfWork);
     model.Categories = unitOfWork.Categories.GetDropDown(unitOfWork);
     model.Referrers  = unitOfWork.Referrers.GetDropDown(unitOfWork);
     model.Modes      = unitOfWork.Modes.GetDropDown(unitOfWork);
     return(model);
 }
Esempio n. 7
0
        public ActionResult Edit(string customerId)
        {
            ViewData["CurrentItem"] = "Identitas Pasien";
            RegistrationFormViewModel viewModel =
                RegistrationFormViewModel.CreateRegistrationFormViewModel(_mCustomerRepository, customerId);

            return(View(viewModel));
        }
Esempio n. 8
0
        public RegistrationForm()
        {
            this.InitializeComponent();
            var vm = new RegistrationFormViewModel();

            this.DataContext = vm;
            if (vm.CloseAction == null)
            {
                vm.CloseAction = new Action(this.Close);
            }
        }
Esempio n. 9
0
        private MemberViewModels MemberBuilder(string accountNumber, RegistrationFormViewModel r)
        {
            MemberViewModels model = new MemberViewModels();

            model.LocationId     = r.LocationId;
            model.MembershipType = r.MembershipType;
            model.ReferredBy     = r.ReferredBy;
            model.AccountId      = accountNumber;
            model.CardId         = accountNumber;
            model.IsNew          = r.IsNew;
            return(model);
        }
Esempio n. 10
0
        public ActionResult Registration()
        {
            ViewData["CurrentItem"] = "Identitas Pasien";
            RegistrationFormViewModel viewModel =
                RegistrationFormViewModel.CreateRegistrationFormViewModel(_mCustomerRepository, null);

            //if (usePopup.HasValue)
            //{
            //    if (usePopup.Value)
            //        return View("Registration", "MasterPopup", viewModel);
            //}
            return(View(viewModel));
        }
Esempio n. 11
0
        private PaymentViewModel PaymentBuilder(Fee fee, short membershipType, RegistrationFormViewModel r)
        {
            PaymentViewModel model = new PaymentViewModel();

            model.FeeBreakUp = fee.Adapt <FeeViewModels>();

            int GST = Convert.ToInt32(fee.GSTRate);

            model.MembershipFee   = MembershipFee(fee, membershipType);
            model.GST             = fee.GSTRate;
            model.TaxAmount       = (model.MembershipFee * GST / 100);
            model.TotalAmount     = model.MembershipFee + model.TaxAmount;
            model.MembershipFeeId = fee.Id;
            model.Modes           = r.Modes;
            return(model);
        }
Esempio n. 12
0
        public ActionResult Registration(RegistrationFormViewModel entity)
        {
            if (!ViewData.ModelState.IsValid)
            {
                return entity.Iframe != null && entity.Iframe.Value ? View("Iframe", _eventService.Value.FillDictionaries(entity)) : View(_eventService.Value.FillDictionaries(entity));
            }

            try
            {
                _eventService.Value.Registration(entity);

                ViewBag.Message = "Благодарим за заявку! В ближайшее время Вы получите приглашение на ваш адрес электронной почты.";
            }
            catch
            {
                ViewBag.Message = "Ошибка отправки формы. Обновите страницу и повторно заполните форму.";
            }

            return entity.Iframe != null && entity.Iframe.Value ? View("Send") : View("RegistrationResult");
        }
Esempio n. 13
0
        public RegistrationFormViewModel CreateRegistration(RegistrationFormViewModel model)
        {
            using (var unitOfWork = new UnitOfWork(_dbContext))
            {
                string accountNumber = GetAccountNumber(unitOfWork, model.LocationId);
                Fee    fee           = unitOfWork.Fees.GetFeeByLocationId(model.LocationId);

                model.Member = MemberBuilder(accountNumber, model);
                model.Spouse = SpouseBuilder(accountNumber);

                model.Dependent       = DependentsBuilder(accountNumber);
                model.Payment         = PaymentBuilder(fee, model.MembershipType, model);
                model.Payment.Cheques = ChequeBuilder();

                model.Member.Locations  = model.Locations;
                model.Member.Categories = model.Categories;
                model.Member.Referrers  = model.Referrers;
            }

            return(model);
        }
Esempio n. 14
0
        public IActionResult AddMember(RegistrationFormViewModel m)
        {
            RegistrationFormViewModel model;

            using (var unitOfWork = new UnitOfWork(_dbContext))
            {
                if (m.IsNew == false)
                {
                    model                = unitOfWork.Members.GetRegistrationViewModels(m.Id);
                    model.LocationId     = m.LocationId;
                    model.MembershipType = m.MembershipType;
                    model.ReferredBy     = m.ReferredBy;
                }
                else
                {
                    model           = FillDropDowns(unitOfWork, m);
                    model           = unitOfWork.Members.CreateRegistration(m);
                    model.CreatedBy = User.Identity.Name;
                }
            }
            return(View("Registration", model));
        }
Esempio n. 15
0
 public RegistrationViewModel()
 {
     Form = new RegistrationFormViewModel();
 }
 public async Task <IViewComponentResult> InvokeAsync(RegistrationFormViewModel registrationFormViewModel)
 {
     return(View(registrationFormViewModel));
 }
Esempio n. 17
0
 public RegisterFormPage(RegistrationFormViewModel model)
 {
     InitializeComponent();
     Context     = model;
     DataContext = Context;
 }