Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Event eventData = null;

            if (EventId.HasValue)
            {
                ProductOption.EventId                   = EventId.Value;
                OrderSummaryControl.EventId             = EventId.Value;
                OrderSummaryControl.RoleId              = (long)Roles.Customer;
                OrderSummaryControl.PackageId           = PackageId;
                OrderSummaryControl.TestIds             = TestIds;
                OrderSummaryControl.IsSourceCodeApplied = SourceCodeId > 0;
                OrderSummaryControl.SourceCodeAmount    = SourceCodeAmount;
                var eventRepository = IoC.Resolve <IEventRepository>();
                eventData = eventRepository.GetById(EventId.Value);
                EventType = eventData.EventType;
            }
            Page.Title = "Select Appointment And Fullfillment Option";
            var objmaster = (Customer_CustomerMaster)Master;

            objmaster.SetBreadcrumb = "<a href=\"/App/Customer/HomePage.aspx\">Home</a>";
            objmaster.SetPageView("EventRegistration");

            if (eventData != null && eventData.EventType == EventType.Retail)
            {
                ResultOtion.ShowFreeOption = false;
            }
            else if (eventData != null && eventData.EventType == EventType.Corporate)
            {
                ResultOtion.EventType = EventType.Corporate;
                ResultOtion.AccountId = eventData.AccountId.HasValue ? eventData.AccountId.Value : 0;
            }
            _ucEventAppointment1.PackageId = PackageId;
            _ucEventAppointment1.TestIds   = AddOnTestIds.IsNullOrEmpty() ? "" : string.Join(",", AddOnTestIds);
            if (!IsPostBack)
            {
                TotalAmount = PackageCost - SourceCodeAmount;
                if (EventId.HasValue)
                {
                    _ucEventAppointment1.EventId         = EventId;
                    _ucEventAppointment1.CurrentViewType = ViewType.CustomerPortal;
                    _ucEventAppointment1.SetAppointmentIds(AppointmentSlotIds);
                    _ucEventAppointment1.ScreeningTime = RegistrationFlow.ScreeningTime;
                }
                else
                {
                    ErrorDiv.InnerHtml = "Sorrry, Event detail not found. <a href =SearchEvent.aspx>Click </a> here to search event again ";
                    ErrorDiv.Visible   = true;
                }
            }
            else
            {
                if (Request.Params["__EVENTTARGET"] == "NextButton" && Request.Params["__EVENTARGUMENT"] == "Click")
                {
                    NextButtonClick();
                }
            }
        }
Exemplo n.º 2
0
        private void SetPackageData()
        {
            var currentPackageId = Convert.ToInt64(PackageIdHiddenControl.Value);

            var testIds = new List <long>();

            TestIdsHiddenControl.Value.Split(',').ToList().ForEach(t => testIds.Add(Convert.ToInt64(t)));
            TestIds = testIds;

            PackageCost = Decimal.Parse(hfPackageCost.Value);

            var addOnTestIds = new List <long>();

            IndependentTestIdsHiddenControl.Value.Split(',').ToList().ForEach(t => addOnTestIds.Add(Convert.ToInt64(t)));
            addOnTestIds.RemoveAll(t => t == 0);

            var isOrderChanged = currentPackageId != PackageId || (AddOnTestIds != null && (!addOnTestIds.All(AddOnTestIds.Contains) || !AddOnTestIds.All(addOnTestIds.Contains)));

            PackageId    = currentPackageId;
            AddOnTestIds = addOnTestIds;

            var eventPackageSelectorService = IoC.Resolve <IEventPackageSelectorService>();
            var screeningTime = eventPackageSelectorService.GetScreeningTime(EventId, PackageId, AddOnTestIds);

            if (!RegistrationFlow.AppointmentSlotIds.IsNullOrEmpty() && isOrderChanged)
            {
                var eventSchedulingSlotService = IoC.Resolve <IEventSchedulingSlotService>();

                var slots = eventSchedulingSlotService.AdjustAppointmentSlot(EventId, screeningTime, RegistrationFlow.AppointmentSlotIds, PackageId, AddOnTestIds, EventData.LunchStartTime, EventData.LunchDuration);
                RegistrationFlow.AppointmentSlotIds = slots.IsNullOrEmpty() ? null : slots.Select(s => s.Id).ToArray();
            }
            RegistrationFlow.ScreeningTime = screeningTime;

            var eligibilityService = IoC.Resolve <IEligibilityService>();

            RegistrationFlow.IsTestCoveredByInsurance = eligibilityService.CheckTestCoveredByinsurance(EventId, PackageId, AddOnTestIds);

            if (!RegistrationFlow.IsTestCoveredByInsurance)
            {
                RegistrationFlow.EligibilityId = 0;
            }

            RegistrationFlow.IsRetest           = RetestYes.Checked;
            RegistrationFlow.SingleTestOverride = SingleTestOverrideYes.Checked;
        }
Exemplo n.º 3
0
        private void NextButtonClick()
        {
            if (!EventValidation())
            {
                return;
            }

            SetPackageData();
            if (!string.IsNullOrEmpty(txtCouponCode.Text))
            {
                SetSourceCodeData();
            }
            else
            {
                SourceCodeId     = 0;
                SourceCode       = string.Empty;
                SourceCodeAmount = decimal.Zero;
            }

            TotalAmount = PackageCost - SourceCodeAmount;

            if (!string.IsNullOrWhiteSpace(hfQuestionAnsTestId.Value))
            {
                QuestionIdAnswerTestId = hfQuestionAnsTestId.Value;
            }
            else
            {
                QuestionIdAnswerTestId = string.Empty;
            }

            if (!string.IsNullOrWhiteSpace(hfDisqualifedTest.Value))
            {
                DisqualifiedTest = hfDisqualifedTest.Value;
            }
            else
            {
                DisqualifiedTest = string.Empty;
            }

            var isEawvPurchased = (TestIds.Any(x => x == (long)TestType.eAWV) || AddOnTestIds.Any(x => x == (long)TestType.eAWV));

            if (CustomerId > 0 && !RegistrationFlow.AwvVisitId.HasValue)
            {   // this was added so that Even if the user forgets to open the HRA Questionnaire Button - We push the User to Medicare.
                var account = AccountByEventId;

                QuestionnaireType questionnaireType = QuestionnaireType.None;
                if (account != null && EventData != null)
                {
                    var accountHraChatQuestionnaireHistoryServices = IoC.Resolve <IAccountHraChatQuestionnaireHistoryServices>();
                    questionnaireType = accountHraChatQuestionnaireHistoryServices.QuestionnaireTypeByAccountIdandEventDate(account.Id, EventData.EventDate);
                }


                if (account != null && account.IsHealthPlan && (questionnaireType == QuestionnaireType.HraQuestionnaire) && isEawvPurchased)
                {
                    try
                    {
                        var setting = IoC.Resolve <ISettings>();

                        if (setting.SyncWithHra)
                        {
                            var medicareService = IoC.Resolve <IMedicareService>();
                            var model           = medicareService.GetCustomerDetails(CustomerId);
                            model.Tag = account.Tag;
                            var medicareApiService = IoC.Resolve <IMedicareApiService>();


                            model.EventDetails = new MedicareEventEditModel {
                                EventId = EventId, VisitDate = EventData.EventDate
                            };
                            var result = medicareApiService.PostAnonymous <MedicareCustomerSetupViewModel>(setting.MedicareApiUrl + MedicareApiUrl.CreateUpdateCustomer, model);
                            if (result != null)
                            {
                                RegistrationFlow.AwvVisitId = result.PatientVisitId;
                            }
                        }
                    }
                    catch (Exception exception)
                    {
                        var logger = IoC.Resolve <ILogManager>().GetLogger <Global>();
                        logger.Error("Error occured in Medicare Customer Sync (In Existing Customer : Select appointment) for Customer : " + CustomerId +
                                     " Message: " + exception.Message + "\n stack Trace: " + exception.StackTrace);
                    }
                }
            }

            if (Request.QueryString["Eventid"] != null)
            {
                EventId = long.Parse(Request.QueryString["Eventid"]);
                Response.RedirectUser("/App/Common/RegisterCustomer/SelectAppointment.aspx?EventID=" + EventId + "&guid=" + GuId);
            }
            else if (CustomerType == CustomerType.Existing)
            {
                Response.RedirectUser("SelectAppointment.aspx?Customer=Existing" + "&guid=" + GuId);
            }
            else
            {
                Response.RedirectUser("SelectAppointment.aspx?guid=" + GuId);
            }
        }