private void GetSelectionArea(FormType formType, SubStateReportType subStateType)
        {
            if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) &&
                (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
            {
                Agencies = AgencyLogic.GetAgencies(DefaultState.Code);
                var _agencies = new List <KeyValuePair <string, string> >();
                _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value)))));
                DynamicSubStateRegions = _agencies;
            }

            else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) &&
                     (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
            {
                DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code);
            }


            else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) &&
                     (formType == FormType.ClientContact))
            {
                IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code);
                var _zips = new List <KeyValuePair <string, string> >();
                _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode)))));
                DynamicSubStateRegions = _zips;
            }
        }
Ejemplo n.º 2
0
        public bool IsAuthorized()
        {
            if (!AgencyLogic.IsAgencyUserActive(ViewData.AgencyId, AccountInfo.UserId))
            {
                return(false);
            }

            ReviewerUserId = (Logic.IsUserClientContactReviewer(ViewData.Id, AccountInfo.UserId))
                                 ? (int?)AccountInfo.UserId
                                 : null;

            if (ViewData.SubmitterUserId == AccountInfo.UserId || ViewData.CounselorUserId == AccountInfo.UserId)
            {
                return(true);
            }

            var descriptors = UserBLL.GetDescriptorsForUser(AccountInfo.UserId, ViewData.AgencyId);

            foreach (var descriptor in descriptors)
            {
                if (descriptor == (int)Descriptor.DataSubmitter ||
                    descriptor == (int)Descriptor.ShipDirector)
                {
                    return(true);
                }
            }

            return(ReviewerUserId.HasValue);
        }
Ejemplo n.º 3
0
        protected DataTable GetAgencyLocationDetails(int AgencyLocationId)
        {
            DataTable dtAgencyLocation = new DataTable();

            dtAgencyLocation = AgencyLogic.GetAgencyLocationForGeoSearch(AgencyLocationId);

            return(dtAgencyLocation);
        }
Ejemplo n.º 4
0
        protected void BindFormData()
        {
            //OLD logic
            //Counselors = AgencyLogic.GetAgencyUsers(ViewData.AgencyId, Descriptor.Counselor, true).OrderBy(p => p.Value);

            Counselors = GetCounselors(ViewData.AgencyId);

            CMSSpecialFields   = Logic.GetCMSSpecialFields();
            StateSpecialFields = Logic.GetStateSpecialFields(ViewData.AgencyState);
            CounselorCounties  = AgencyLogic.GetCounties(ViewData.AgencyState.Code);
            ClientCounties     = LookupBLL.GetCountiesForZipCode(ViewData.ClientZIPCode);
            CounselorCounties  = CounselorCounties;
            CounselorZipCodes  = LookupBLL.GetZipCodeForCountyFips2(ViewData.CounselorCountyCode);
        }
Ejemplo n.º 5
0
        protected void dropDownListFormType_SelectedIndexChanged(object sender, EventArgs e)
        {
            //change the ccf/pam type for the type dropdown
            int      _formType = Convert.ToInt32(((DropDownList)sender).SelectedValue);
            FormType formType  = (FormType)_formType;

            ReportSubStateReportType = Logic.GetSubStateReportType(formType);

            DynamicSubStateRegions = null;

            States = AgencyLogic.GetStates();

            BindFormView();
        }
Ejemplo n.º 6
0
        protected void dropDownListCounselor_SelectedIndexChanged(object sender, EventArgs e)
        {
            var dropDownListCounselor = (DropDownList)sender;
            var counselorIdSelected   = (!string.IsNullOrEmpty(dropDownListCounselor.SelectedValue))
                                          ? Convert.ToInt32(dropDownListCounselor.SelectedValue)
                                          : 0;

            if (counselorIdSelected == 0)
            {
                return;
            }

            var counselor = UserBLL.GetUserAccount(counselorIdSelected);

            if (counselor == null)
            {
                return;
            }

            var dropDownListCounselorCounty = formViewEditClientContact.FindControl("dropDownListCounselorCounty") as DropDownList;

            dropDownListCounselorCounty.DataSource = AgencyLogic.GetCounties(ViewData.AgencyState.Code);
            dropDownListCounselorCounty.DataBind();
            dropDownListCounselorCounty.Items.Insert(0, new ListItem("-- Select a County --", ""));

            var county = dropDownListCounselorCounty.Items.FindByValue(counselor.CounselingCounty);

            if (county != null)
            {
                county.Selected = true;
            }

            var dropDownListCounselorZipCode = formViewEditClientContact.FindControl("dropDownListCounselorZipCode") as DropDownList;

            dropDownListCounselorZipCode.DataSource = LookupBLL.GetZipCodeForCountyFips(counselor.CounselingCounty);
            dropDownListCounselorZipCode.DataBind();
            dropDownListCounselorZipCode.Items.Insert(0, new ListItem("-- Select a Zip Code --", ""));

            var zip = dropDownListCounselorZipCode.Items.FindByText(counselor.CounselingLocation);

            if (zip != null)
            {
                zip.Selected = true;
            }

            dropDownListCounselorCounty.Focus();
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Binds the dependent data for the form.
        /// </summary>
        protected void BindDependentData()
        {
            DynamicSubStateRegions = null;
            States = AgencyLogic.GetStates();

            DropDownList ctrlForm  = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListFormType");
            int          _formType = Convert.ToInt32(ctrlForm.SelectedValue);


            DropDownList ctrlGroup  = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListGroupype");
            int          _groupType = Convert.ToInt32(ctrlGroup.SelectedValue);

            if (_groupType > 0 && _formType > 0)
            {
                FormType           formType     = (FormType)_formType;
                SubStateReportType subStateType = (SubStateReportType)_groupType;


                if ((subStateType == SubStateReportType.Agency || subStateType == SubStateReportType.AgencyPam) &&
                    (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
                {
                    Agencies = AgencyLogic.GetAgencies(DefaultState.Code);
                    var _agencies = new List <KeyValuePair <string, string> >();
                    _agencies.AddRange(Agencies.Select((pair => (new KeyValuePair <string, string>(pair.Key.ToString(), pair.Value)))));
                    DynamicSubStateRegions = _agencies;
                }

                else if ((subStateType == SubStateReportType.CountycodeOfClientRes || subStateType == SubStateReportType.CountyOfCounselorLocation || subStateType == SubStateReportType.CountycodeOfEvent) &&
                         (formType == FormType.ClientContact || formType == FormType.PublicMediaActivity))
                {
                    DynamicSubStateRegions = AgencyLogic.GetCounties(DefaultState.Code);
                }


                else if ((subStateType == SubStateReportType.ZIPCodeOfClientRes || subStateType == SubStateReportType.ZIPCodeOfCounselorLocation) &&
                         (formType == FormType.ClientContact))
                {
                    IEnumerable <ZipCountyView> zipCode = LookupBLL.GetZipCodesAndCountyFIPSForState(DefaultState.Code);
                    var _zips = new List <KeyValuePair <string, string> >();
                    _zips.AddRange(zipCode.Select((pair => (new KeyValuePair <string, string>(pair.Zipcode.ToString(), pair.Zipcode)))));
                    DynamicSubStateRegions = _zips;
                }
            }
        }
Ejemplo n.º 8
0
        public bool IsAuthorized()
        {
            if (AccountInfo.IsCMSLevel == true)
            {
                return(true);
            }

            //for cms or shipDirector return true so that they can see the delete button
            if (ApproverRulesBLL.IsApproverAtCMS(this.AccountInfo) || this.AccountInfo.IsShipDirector)
            {
                return(true);
            }

            if (!AgencyLogic.IsAgencyUserActive(ViewData.AgencyId, AccountInfo.UserId))
            {
                return(false);
            }

            ReviewerUserId = (Logic.IsUserClientContactReviewer(ViewData.Id, AccountInfo.UserId))
                                ? (int?)AccountInfo.UserId
                                : null;

            if (ViewData.SubmitterUserId == AccountInfo.UserId || ViewData.CounselorUserId == AccountInfo.UserId)
            {
                return(true);
            }

            var descriptors = UserBLL.GetDescriptorsForUser(AccountInfo.UserId, ViewData.AgencyId);

            foreach (var descriptor in descriptors)
            {
                if (descriptor == (int)Descriptor.DataSubmitter ||
                    descriptor == (int)Descriptor.ShipDirector)
                {
                    return(true);
                }
            }

            return(ReviewerUserId.HasValue);
        }
Ejemplo n.º 9
0
        public void SetUPAgency()
        {
            this.agenList = new List <Agency>()
            {
                new Agency()
                {
                    AgenId = 1, AgenName = "PegasTouristic"
                },
                new Agency()
                {
                    AgenId = 2, AgenName = "AmediaTour"
                },
                new Agency()
                {
                    AgenId = 3, AgenName = "StarTravel"
                },
            };

            this.agenRepo = new Mock <IAgencyRepository>(MockBehavior.Loose);
            this.agenRepo.Setup(repo => repo.GetAll()).Returns(this.agenList.AsQueryable);
            this.agenLogici = new AgencyLogic(this.agenRepo.Object);
        }
Ejemplo n.º 10
0
        private void StateBindCall()
        {
            DropDownList ctrlFormtype = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListFormType");

            if (DefaultState.Code == null)
            {
                ReportFromeType = null;
            }
            else
            {
                ReportFromeType = Logic.GetFromeType();
            }

            ctrlFormtype.Focus();

            //bind group type with null
            ReportSubStateReportType = null;

            DynamicSubStateRegions = null;

            States = AgencyLogic.GetStates();

            BindFormView();
        }
Ejemplo n.º 11
0
        private static void AgencyBusinessLogicMenu()
        {
            AgencyLogic agencyLogic = new AgencyLogic();

            Console.Clear();
            Console.WriteLine("Choose an action:");
            Console.WriteLine("1) List all agencies");
            Console.WriteLine("2) Update agency");
            Console.WriteLine("3) Create new agency");
            Console.WriteLine("4) Delete agency");
            Console.WriteLine("5) Show more successful agencies");
            Console.WriteLine("6) Show num of applicants of agency");
            Console.Write("\r\nSelect an option: ");

            switch (Console.ReadLine())
            {
            case "1":
                Console.WriteLine("Table agency:");
                foreach (Agency item in agencyLogic.GetAllAgencies().ToList())
                {
                    Console.WriteLine($"agen_id: {item.AgenId}, agen_name: {item.AgenName}, agen_address: {item.AgenAddress}, agen_email: {item.AgenEmail}");
                }

                Console.ReadLine();
                break;

            case "2":
                Console.WriteLine("Update agency:");
                Console.WriteLine("Type id of the agency which needs to modify:");
                int takeId = int.Parse(Console.ReadLine());
                Console.WriteLine("Type contact email address of the agency");
                string newMail = Console.ReadLine();
                agencyLogic.ChangeAgencyEmail(takeId, newMail);
                break;

            case "3":
                try
                {
                    Console.WriteLine("Create new travel agency");
                    Console.WriteLine("Create new id (id should be more than 7):");
                    int newId = int.Parse(Console.ReadLine());
                    Console.WriteLine("Create a name of agency:");
                    string newName = Console.ReadLine();
                    Console.WriteLine("Write a location of the agency");
                    string newgender = Console.ReadLine();
                    Console.WriteLine("Enter new email address: ");
                    string newEmail = Console.ReadLine();
                    agencyLogic.CreateNewAgency(newId, newName, newgender, newEmail);
                }
                catch (Exception ex)
                {
                    string message = string.Empty;
                    Console.ForegroundColor = ConsoleColor.Red;
                    if (ex is FormatException)
                    {
                        message = " Incorrect form";
                    }
                    else
                    {
                        Console.WriteLine(ex.Message);
                    }

                    Console.WriteLine(message);
                }

                break;

            case "4":
                Console.WriteLine("Delete agency by id:");
                Console.WriteLine("Enter id:");
                int delId = int.Parse(Console.ReadLine());
                agencyLogic.DeleteAgency(delId);
                Console.WriteLine("Agency deleted successfully!");
                break;

            case "5":
                Console.WriteLine("Show agency successful visas");
                var successAg = agencyLogic.GetAgencyWithApprovedVisas();
                foreach (var v in successAg)
                {
                    Console.WriteLine($" AgName: {v.AgenName}, IsApproved:{v.Approved}, ClientJob: {v.Job}, ClientName:{v.ClientName} ");
                }

                Console.WriteLine("task output:");
                Task <IList <AgencySuccessful> > agTask = agencyLogic.GetAgencyWithApprovedVisasAsync();
                agTask.Wait();
                if (agTask.IsCompletedSuccessfully)
                {
                    foreach (var task in agTask.Result)
                    {
                        Console.WriteLine($" AgName: {task.AgenName}, IsApproved:{task.Approved}, ClientJob: {task.Job}, ClientName:{task.ClientName}");
                    }
                }

                Console.ReadLine();
                break;

            case "6":
                Console.WriteLine("Show number of applicants for the specified agency ...enter name:(eg. TravelAround, CCUnated)");
                string newname      = Console.ReadLine();
                var    agencyWanted = agencyLogic.GetAgencyByName(newname);
                Console.WriteLine($" AgName: {agencyWanted.AgenName}, NumberOfApplicants:{agencyWanted.Number} ");

                Console.ReadLine();
                break;
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Binds the dependent data for the form.
        /// </summary>
        protected void BindDependentData()
        {
            #region drop down population logic.
            //switch (Scope)
            //{
            //    case Scope.CMS:
            //        {
            //            Counselors = Logic.GetClientContactCounselors();
            //            Submitters = Logic.GetClientContactSubmitters();

            //            break;
            //        }
            //    case Scope.State:
            //        {

            //            Counselors = Logic.GetClientContactCounselors(DefaultState);
            //            Submitters = Logic.GetClientContactSubmitters(DefaultState);

            //            break;
            //        }
            //    default :
            //        {
            //            //Determine if the current user is a super data editor.
            //            if (AgencyLogic.IsSuperDataEditor(UserId))
            //            {
            //                Counselors = Logic.GetCounselorsForSuperDataEditor(UserId);
            //                Submitters = Logic.GetSubmittersForSuperDataEditor(UserId);
            //            }
            //            else
            //            {
            //                //Set the Descriptors needed to determine form population and options.
            //                var isCounselor = IsDescriptor(Descriptor.Counselor);
            //                var isSubmitter = IsDescriptor(Descriptor.DataSubmitter);
            //                var isReviewer = IsDescriptor(Descriptor.DataEditor_Reviewer);

            //                if (isCounselor && isSubmitter)
            //                {
            //                    IsCounselorOnly = false;
            //                    IsSubmitterOnly = false;

            //                    //Get the Counselors for where the current user is a DataSubmitter.
            //                    Counselors = Logic.GetCounselors(Scope, (from id in GetAgencies(Descriptor.DataSubmitter) select id).ToList());

            //                    //Check if the current user is in the counselors list; otherwise add them manually.
            //                    if (
            //                        (from counselor in Counselors where counselor.Key == UserId select counselor.Key).Count() == 0)
            //                    {
            //                        var profile = UserBLL.GetUserProfile(UserId);
            //                        Counselors = new List<KeyValuePair<int, string>>
            //                                         {
            //                                             (new KeyValuePair<int, string>(UserId,
            //                                                 string.Format("{0} {1}", profile.FirstName, profile.LastName)))
            //                                         };
            //                    }

            //                    //Get the Submitters for where the current user is a Counselor.
            //                    Submitters = Logic.GetSubmitters(Scope, (from id in GetAgencies(Descriptor.Counselor) select id).ToList());

            //                    //Check if the current user is in the submitter list; otherwise add them manually.
            //                    if ((from submitter in Submitters where submitter.Key == UserId select submitter.Key).Count() == 0)
            //                    {
            //                        var profile = UserBLL.GetUserProfile(UserId);
            //                        Submitters = new List<KeyValuePair<int, string>>
            //                                         {
            //                                             (new KeyValuePair<int, string>(UserId,
            //                                                 string.Format("{0} {1}", profile.FirstName, profile.LastName)))
            //                                         };
            //                    }
            //                }
            //                else if (isCounselor)
            //                {
            //                    //check if the current user is a reviewer too.
            //                    if (isReviewer)
            //                    {
            //                        //Get submitters from agencies in which the current user is a counselor.
            //                        //No Counselors are to be retrieved.
            //                        Counselors = null;
            //                        //Get the submitters for whom the current user is a counselor.
            //                        Submitters = Logic.GetSubmitters(Scope, (from id in GetAgencies(Descriptor.Counselor) select id).ToList());
            //                    }
            //                    else
            //                    {
            //                        IsCounselorOnly = true;
            //                        //Get the Counselors for where the current user is a DataSubmitter.
            //                        Counselors = Logic.GetCounselors(Scope, (from id in GetAgencies(Descriptor.DataSubmitter) select id).ToList());

            //                        //Check if the current user is in the counselors list; otherwise add them manually.
            //                        if (
            //                            (from counselor in Counselors where counselor.Key == UserId select counselor.Key).Count() == 0)
            //                        {
            //                            var profile = UserBLL.GetUserProfile(UserId);
            //                            Counselors = new List<KeyValuePair<int, string>>
            //                                             {
            //                                                 (new KeyValuePair<int, string>(UserId,
            //                                                     string.Format("{0} {1}", profile.FirstName, profile.LastName)))
            //                                             };
            //                        }

            //                        //Get the Submitters for the current user's agencies.
            //                        Submitters = Logic.GetSubmitters(Scope, (from id in ActiveAgencyDescriptors.Keys select id).ToList());
            //                    }
            //                }
            //                else if (isSubmitter)
            //                {
            //                    //check if the current user is a reviewer too.
            //                    if (isReviewer)
            //                    {
            //                        //Get the counselors for whom the curent user is a submitter
            //                        Counselors = Logic.GetCounselors(Scope, (from id in GetAgencies(Descriptor.DataSubmitter) select id).ToList());
            //                        //Get the submitters for whom the current user is a supervisor.
            //                        Submitters = Logic.GetReviewerSubmitters(Scope, (from id in GetAgencies(Descriptor.DataEditor_Reviewer) select id).ToList(), UserId);
            //                    }
            //                    else
            //                    {
            //                        IsSubmitterOnly = true;
            //                        //Get the Counselors for the current user's agencies.
            //                        Counselors = Logic.GetCounselors(Scope, (from id in ActiveAgencyDescriptors.Keys select id).ToList());
            //                        //Get the Submitters for where the current user is a Counselor.
            //                        Submitters = Logic.GetSubmitters(Scope, (from id in GetAgencies(Descriptor.Counselor) select id).ToList());

            //                        //Check if the current user is in the submitter list; otherwise add them manually.
            //                        if (
            //                            (from submitter in Submitters where submitter.Key == UserId select submitter.Key).Count() == 0)
            //                        {
            //                            var profile = UserBLL.GetUserProfile(UserId);
            //                            Submitters = new List<KeyValuePair<int, string>>
            //                                             {
            //                                                 (new KeyValuePair<int, string>(UserId, string.Format("{0} {1}", profile.FirstName, profile.LastName)))
            //                                             };
            //                        }
            //                    }
            //                }
            //                else if (isReviewer) //not a counselor or submitter.
            //                {
            //                    IsReviewerOnly = true;
            //                    //No Counselors are to be retrieved.
            //                    Counselors = null;
            //                    //Get the submitters for whom the current user is a supervisor.
            //                    Submitters = Logic.GetReviewerSubmitters(Scope, (from id in GetAgencies(Descriptor.DataEditor_Reviewer) select id).ToList(), UserId);
            //                }
            //            }

            //            break;
            //        }
            //}

            #endregion

            //PopulateCounselorDropDown();
            //PopulateSubmitterDropDown();


            //if user is Cms Regional user populate only his states
            if (AccountInfo.Scope == Scope.CMSRegional)
            {
                IEnumerable <KeyValuePair <string, string> > StatesData = AgencyLogic.GetStates();

                IEnumerable <KeyValuePair <string, string> > StatesForUser = null;

                List <string> StateFIPSForCMSRegions             = new List <string>();
                IEnumerable <UserRegionalAccessProfile> profiles = UserCMSBLL.GetUserCMSRegionalProfiles(AccountInfo.UserId, false);
                foreach (UserRegionalAccessProfile profile in profiles)
                {
                    IEnumerable <string> CMSStateFIPS = LookupBLL.GetStatesForCMSRegion(profile.RegionId);
                    if (CMSStateFIPS != null)
                    {
                        StateFIPSForCMSRegions.AddRange(CMSStateFIPS);
                    }
                }
                if (StateFIPSForCMSRegions.Count > 0)
                {
                    StatesForUser = (
                        from stFIPS in StatesData
                        from cmsStFIPS in StateFIPSForCMSRegions
                        where stFIPS.Key == State.GetState(cmsStFIPS).Key
                        select stFIPS
                        );
                }
                States = StatesForUser;
            }
            else
            {
                States = AgencyLogic.GetStates();
            }


            aAddCCF.DataBind();


            //check the correct authorization
            if (AccountInfo.IsStateAdmin ||
                (AccountInfo.IsCMSScope && AccountInfo.IsAdmin) ||
                AccountInfo.IsShipDirector)
            {
                aAddSpecialField.Visible = true;
                aAddSpecialField.DataBind();
            }

            //9/11/2013- commented the below line-  Bimal noticed that the NPR code is searching for all a user’s recent records the moment that the CC tab is clicked.
            //Since many users may not actually need a prior client search (i.e. they may click the “Add a new client never seen here before “link), Bimal will move the search from a default to a specific request if the user makes any of the three search selections (by agency counselor submitter).
            //It appears that the database has reached a size that even with indexing the default background search is consuming too many system resources and risks not only the spinning and slow load but also a timeout and error page as well.


            panelSearchCriteria.DataBind();
            if (Scope.IsLowerOrEqualTo(Scope.State))
            {
                BindStateDependentData(new State(dropDownListState.SelectedValue));
            }
        }
Ejemplo n.º 13
0
        public void TestGetAgencyByName()
        {
            Mock <IApplicantRepository> mockApplicRepo  = new Mock <IApplicantRepository>(MockBehavior.Loose);
            Mock <IPaymentRepository>   mockPaymentRepo = new Mock <IPaymentRepository>(MockBehavior.Loose);
            Mock <IAgencyRepository>    mockAgRepo      = new Mock <IAgencyRepository>(MockBehavior.Loose);
            Mock <IVisaRepository>      mockVisaRepo    = new Mock <IVisaRepository>(MockBehavior.Loose);

            List <Agency> agencyList = new List <Agency>()
            {
                new Agency()
                {
                    AgenId = 1, AgenName = "PegasTouristic"
                },
                new Agency()
                {
                    AgenId = 5, AgenName = "TravelAround"
                },
            };

            List <Applicant> appList = new List <Applicant>()
            {
                new Applicant()
                {
                    ApplId = 1, ApplName = "Aplicant1"
                },
                new Applicant()
                {
                    ApplId = 2, ApplName = "Aplicant2"
                },
                new Applicant()
                {
                    ApplId = 3, ApplName = "Aplicant3"
                },
            };

            List <Payment> payList = new List <Payment>()
            {
                new Payment()
                {
                    PayId = 1, PayAgenId = 1, PayApplId = 2
                },
                new Payment()
                {
                    PayId = 2, PayAgenId = 5, PayApplId = 3
                },
                new Payment()
                {
                    PayId = 3, PayAgenId = 5, PayApplId = 1
                },
            };

            List <Visa> listvisa = new List <Visa>()
            {
                new Visa()
                {
                    VisaId = 1, VisaApplId = 2, VisaIsapproved = "approved"
                },
                new Visa()
                {
                    VisaId = 2, VisaApplId = 1, VisaIsapproved = "approved"
                },
            };

            mockApplicRepo.Setup(rep => rep.GetAll()).Returns(appList.AsQueryable());
            mockPaymentRepo.Setup(rep => rep.GetAll()).Returns(payList.AsQueryable());
            mockAgRepo.Setup(rep => rep.GetAll()).Returns(agencyList.AsQueryable());
            mockVisaRepo.Setup(rep => rep.GetAll()).Returns(listvisa.AsQueryable());

            AgencyLogic logic = new AgencyLogic(mockAgRepo.Object, mockApplicRepo.Object, mockPaymentRepo.Object, mockVisaRepo.Object);

            var result = logic.GetAgencyByName("TravelAround");

            Assert.That(result.Number, Is.EqualTo(2));
            mockAgRepo.Verify(repo => repo.GetAll(), Times.Once);
        }
        protected void BindFormData()
        {
            States = AgencyLogic.GetStates();

            DefaultState = ViewData.State;
            DropDownList ctrlState = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListState");
            var          state     = ctrlState.Items.FindByValue(DefaultState.StateAbbr);

            if (state != null)
            {
                state.Selected = true;
            }


            ReportFromeType = Logic.GetFromeType();

            DropDownList ctrlForm = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListFormType");

            ctrlForm.DataSource = ReportFromeType;
            ctrlForm.DataBind();
            ctrlForm.Items.Insert(0, "-- Select Form Type --");

            var reportType = ctrlForm.Items.FindByValue(((int)ViewData.ReprotFormType).ToString());

            if (reportType != null)
            {
                reportType.Selected = true;
            }


            FormType _formType = (FormType)ViewData.ReprotFormType;

            ReportSubStateReportType = Logic.GetSubStateReportType(_formType);


            DropDownList ctrlGroup = (DropDownList)formViewSubStateRegionForReport.FindControl("dropDownListGroupype");

            ctrlGroup.DataSource = ReportSubStateReportType;
            ctrlGroup.DataBind();
            ctrlGroup.Items.Insert(0, "-- Select Report Group Type --");

            var groupType = ctrlGroup.Items.FindByValue(((int)ViewData.Type).ToString());

            if (groupType != null)
            {
                groupType.Selected = true;
            }



            SubStateReportType _type = (SubStateReportType)ViewData.Type;

            GetSelectionArea(_formType, _type);


            ListBox ctrlCounties = (ListBox)formViewSubStateRegionForReport.FindControl("listBoxCounties");
            ListBox ctrlSvc      = (ListBox)formViewSubStateRegionForReport.FindControl("listBoxServiceAreas");

            ctrlCounties.DataSource = DynamicSubStateRegions;
            ctrlSvc.DataSource      = DynamicSubStateRegions;
            ctrlCounties.DataBind();
            ctrlSvc.DataBind();
        }