Ejemplo n.º 1
0
        private void GetCountriesList()
        {
            CountryList?.Clear();
            var items = AsyncHelper.RunSync <IList <Country> >(() => CitySelectorService.
                                                               GetCountries());

            CountryList = items.OrderBy(x => x.Name).ToList();
        }
Ejemplo n.º 2
0
 private CountryList GetCountries(Boolean refresh)
 {
     if (_countries.IsNull() || refresh)
     {
         _countries = CoreData.CountryManager.GetCountries(GetUserContext());
     }
     return(_countries);
 }
Ejemplo n.º 3
0
    static public void Main(string[] args)
    {
        CountryList cLst = (CountryList)Activator.GetObject(typeof(CountryList),
                                                            "http://localhost:8086/CountryList",
                                                            WellKnownObjectMode.Singleton);

        cLst.AddCountry("Australia");
    }
Ejemplo n.º 4
0
        private void button1_Click(object sender, System.EventArgs e)
        {
            CountryList cLst = (CountryList)Activator.GetObject(typeof(CountryList),
                                                                "http://" + pcName + ":8086/CountryList",
                                                                WellKnownObjectMode.Singleton);

            listBox1.DataSource = cLst.GetList();
        }
        /// <summary>
        /// Binds the countries list.
        /// </summary>
        /// <param name="shippingRow">The shipping row.</param>
        private void BindCountriesList(ShippingMethodDto.ShippingMethodRow shippingRow)
        {
            List <CountryDto.CountryRow> leftCountries  = new List <CountryDto.CountryRow>();
            List <CountryDto.CountryRow> rightCountries = new List <CountryDto.CountryRow>();

            CountryDto dto = CountryManager.GetCountries(true);

            bool allToLeft = false;             // if true, then add all countries to the left list

            if (shippingRow != null)
            {
                ShippingMethodDto.ShippingCountryRow[] restrictedCountryRows = shippingRow.GetShippingCountryRows();
                if (restrictedCountryRows != null && restrictedCountryRows.Length > 0)
                {
                    foreach (CountryDto.CountryRow countryRow in dto.Country)
                    {
                        bool found = false;
                        foreach (ShippingMethodDto.ShippingCountryRow restrictedCountryRow in restrictedCountryRows)
                        {
                            if (countryRow.CountryId == restrictedCountryRow.CountryId)
                            {
                                found = true;
                                break;
                            }
                        }

                        if (found)
                        {
                            rightCountries.Add(countryRow);
                        }
                        else
                        {
                            leftCountries.Add(countryRow);
                        }
                    }

                    CountryList.LeftDataSource  = leftCountries;
                    CountryList.RightDataSource = rightCountries;
                }
                else
                {
                    // add all countries to the left list
                    allToLeft = true;
                }
            }
            else
            {
                allToLeft = true;
            }

            if (allToLeft)
            {
                // add all countries to the left list
                CountryList.LeftDataSource = dto.Country;
            }

            CountryList.DataBind();
        }
Ejemplo n.º 6
0
        protected override async Task MapEditedItemToEditor(Branch item)
        {
            SelectedCountry = CountryList.FirstOrDefault(e => e.Id == item.CountryId);
            await OnCountrySelected(SelectedCountry);

            SelectedCity    = CityList.FirstOrDefault(e => e.Id == item.CityId);
            SelectedCompany = CompanyList.FirstOrDefault(e => e.Id == item.CompanyId);
            await base.MapEditedItemToEditor(item);
        }
Ejemplo n.º 7
0
        // Get country by alpha3, case sensitive.
        public static Country GetCountryByAlpha3(string code)
        {
            if (string.IsNullOrWhiteSpace(code))
            {
                return(null);
            }

            return(CountryList.FirstOrDefault(c => c.Alpha3 != CountryCodeAlpha3.None && c.Alpha3.ToString() == code));
        }
Ejemplo n.º 8
0
 public void ChooseContinent(string continent)
 {
     if (continent != "Все")
     {
         List <Country> countries = GetCountriesByContinent(continent);
         CountryList.Clear();
         CountryList.AddRange(countries);
     }
 }
Ejemplo n.º 9
0
        // Get country by alpha3 code.
        public static Country GetCountryByAlpha3(CountryCodeAlpha3 code)
        {
            if (code == CountryCodeAlpha3.None)
            {
                return(null);
            }

            return(CountryList.FirstOrDefault(c => c.Alpha3 == code));
        }
Ejemplo n.º 10
0
 public Catalog()
 {
     countryList          = new CountryList();
     labelList            = new LabelList();
     aviaCompanyList      = new AviaCompanyList();
     aviaCompanyUnionList = new AviaCompanyUnionList();
     personList           = new PersonList();
     countryUnionList     = new CountryUnionList();
 }
Ejemplo n.º 11
0
        // Get all countries by Active Directory name that partially match given input. Case insensitive.
        public static List <Country> GetCountryByPartialActiveDirectoryName(string countryName)
        {
            if (string.IsNullOrWhiteSpace(countryName))
            {
                return(new List <Country>());
            }

            return(CountryList.Where(c => c.ActiveDirectoryName != null && CultureInfo.CurrentCulture.CompareInfo.IndexOf(c.ActiveDirectoryName, countryName, CompareOptions.OrdinalIgnoreCase) >= 0).ToList());
        }
Ejemplo n.º 12
0
        // GET: Verifizierungs
        public ActionResult Verifizierung()
        {
            VerifiVM vm = new VerifiVM();
            //daten aus datenbank mache ich zu einer liste(ToList)
            var list = db.Country.ToList();

            vm.CountryList = CountryList.FilCountryList(list);
            return(View(vm));
        }
Ejemplo n.º 13
0
        // Get country by numeric.
        public static Country GetCountryByNumeric(int?code)
        {
            if (code == null)
            {
                return(null);
            }

            return(CountryList.FirstOrDefault(c => c.Numeric != null && c.Numeric == code));
        }
Ejemplo n.º 14
0
        // Get country by Active Directory name, case sensitive.
        public static Country GetCountryByActiveDirectoryName(string name)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                return(null);
            }

            return(CountryList.FirstOrDefault(c => c.ActiveDirectoryName != null && c.ActiveDirectoryName == name));
        }
Ejemplo n.º 15
0
 public CountryList Deserialize()
 {
     using (StreamReader sr = new StreamReader(path))
     {
         countries = (CountryList)serializer.Deserialize(sr);
         sr.Close();
     }
     return countries;
 }
    public ucTreeView()
    {
        InitializeComponent();
        country_List = new ObservableCollection <CountryList>();
        CountryList cList = new CountryList();

        country_List     = cList.getCountries;    //retrieve country list
        this.DataContext = this
    }
Ejemplo n.º 17
0
        public override List <GeneralParserPhrase> Parse(string inputText)
        {
            InitLexer(inputText);
            var parser  = new CountryList(CommonTokenStream, Output, ErrorOutput);
            var context = parser.countries();
            var visitor = new CountryListVisitor(this);

            visitor.Visit(context);
            return(visitor.Lines);
        }
Ejemplo n.º 18
0
        private bool IsDublicatedSubmitted(string country)
        {
            var SearchCountry = CountryList.SingleOrDefault(p => p.Country == country);

            if (SearchCountry is null)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 19
0
        public async void Read_SearchCountryByName()
        {
            string search = "Deutschland";

            CountryList countryList = new CountryList();
            string      result      = await countryList.SearchShortCountryCode(search);

            Assert.IsType <string>(result);
            Assert.Equal("DE", result);
        }
Ejemplo n.º 20
0
        public ActionResult resellersignup()
        {
            ViewBag.Country  = CountryList.ToArray();
            ViewBag.MetaData = new CMSPage();
            User user = new Domain.User();

            user.SiteID = Site.ID;;

            ViewBag.UserName = (User.Identity.IsAuthenticated) ? loginuser.Details.FirstName + " " + loginuser.Details.LastName : "";
            return(View("resellersignup", user));
        }
Ejemplo n.º 21
0
 public void PopulatePicker(CountryList clist)
 {
     foreach (string country in clist.Countries)
     {
         if (country.ToUpper() != country)
         {
             PickerOne.Items.Add(country);
             PickerTwo.Items.Add(country);
         }
     }
 }
Ejemplo n.º 22
0
 public JsonResult BuildPaganationCountryList(CountryList model)
 {
     try
     {
         return(Json(new { NOP = (new CountryModel()).BuildPaganationCountryList(model) }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new { error = ex.Message }, JsonRequestBehavior.AllowGet));
     }
 }
Ejemplo n.º 23
0
 public JsonResult GetCountryList(CountryList model)
 {
     try
     {
         return(Json((new CountryModel()).GetCountryList(model), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(new { model = ex.Message }, JsonRequestBehavior.AllowGet));
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        UserSession us = Session["User"] as UserSession;

        try
        {
            UserSession.IsAuthorized(defined, Session["User"] as UserSession);
        }
        catch (UnauthorizedAccessException)
        {
            Response.Redirect(UserManager.GetDefaultPage(UserType.Invalid));
            return;
        }

        if (!IsPostBack)
        {
            DataTable dt = LearningManagementSystem.Components.User.GetRegisteredCountryList();

            CountryList.DataSource     = dt;
            CountryList.DataTextField  = "Country";
            CountryList.DataValueField = "Country_Id";
            CountryList.DataBind();

            CountryList1.DataSource     = dt;
            CountryList1.DataTextField  = "Country";
            CountryList1.DataValueField = "Country_Id";
            CountryList1.DataBind();

            CountryList2.DataSource     = dt;
            CountryList2.DataTextField  = "Country";
            CountryList2.DataValueField = "Country_Id";
            CountryList2.DataBind();

            CountryList3.DataSource     = dt;
            CountryList3.DataTextField  = "Country";
            CountryList3.DataValueField = "Country_Id";
            CountryList3.DataBind();

            CountryList4.DataSource     = dt;
            CountryList4.DataTextField  = "Country";
            CountryList4.DataValueField = "Country_Id";
            CountryList4.DataBind();

            CountryList5.DataSource     = dt;
            CountryList5.DataTextField  = "Country";
            CountryList5.DataValueField = "Country_Id";
            CountryList5.DataBind();

            CountryList6.DataSource     = dt;
            CountryList6.DataTextField  = "Country";
            CountryList6.DataValueField = "Country_Id";
            CountryList6.DataBind();
        }
    }
Ejemplo n.º 25
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        public ActionResult AddEditUser(int userId = 0)
        {
            //var datataaa = EmailDesigner.GetAccountActivationEmail("asd","IDSISSSSSSS");

            var userModel = new UserViewModel();


            var countryList = CountryList.GetCountryList();

            if (countryList.Any())
            {
                if (countryList.Count > 0)
                {
                    ViewBag.DropDownForCountry =
                        countryList.Select(c => new SerializableSelectListItem
                    {
                        Text  = c.CountryName,
                        Value = c.CountryId.ToString(CultureInfo.InvariantCulture)
                    });
                }
            }



            if (SessionManager.GetSessionInfo() != null && (SessionManager.IsAdminLoggedIn() || SessionManager.GetSessionInfo().Id == userId))
            {
                if (userId > 0)
                {
                    userModel = UserManager.GetUserById(userId);
                }

                if (userModel.Country != 0)
                {
                    ViewBag.StateInfo = StateList.GetStateByCountry(userModel.Country);
                }



                if (SessionManager.IsAdminLoggedIn())
                {
                    ViewBag.Roles = NewsIndiaBAL.RoleManager.GetRoles();
                }
            }
            else if (SessionManager.GetSessionInfo() != null)
            {
                return(RedirectToAction("Index", "Home"));
            }


            ViewBag.IsAddRequest = userModel.UserId == 0;

            return(View(userModel));
            //  return RedirectToAction("Index", "Home");
        }
Ejemplo n.º 26
0
        private async void GetCountries()
        {
            var response = await RestCountryApi.GetCountries();

            CountryList.Clear();

            foreach (var country in response)
            {
                CountryList.Add(country);
            }
        }
Ejemplo n.º 27
0
        public static string GetFlag(this CurrencyFiat currency)
        {
            var currencyCode = CountryList.GetAll().FirstOrDefault(x => x.Currency.Code == currency.Code);

            if (currencyCode == null)
            {
                return("");
                // throw new CurrencyCodeException(currency.Code);
            }
            return(currency.Code != "EUR" ? currencyCode.CodeIso3.Code : "eun");
        }
Ejemplo n.º 28
0
        public async Task Init()
        {
            APIService.Username = "******";
            APIService.Password = "******";

            var countries = await _countryService.Get <List <CountryModel> >(null);

            foreach (var x in countries)
            {
                CountryList.Add(x);
            }
        }
Ejemplo n.º 29
0
        //
        // GET: /Account/Register
        public ActionResult Register(string hashEmail)
        {
            var model = new AccountDetailsModel {
                EmailAddress = "", Password = ""
            };

            //Get list country
            var listCountry = CountryList.GetCountryList("default");

            ViewBag.ListCountry = listCountry;
            return(View(model));
        }
        /// <summary>
        /// Get countries from web countries.
        /// </summary>
        /// <param name="userContext">User context.</param>
        /// <param name="webCountries">Web countries.</param>
        /// <returns>Countries.</returns>
        private CountryList GetCountries(IUserContext userContext,
                                         List <WebCountry> webCountries)
        {
            CountryList countries;

            countries = new CountryList();
            foreach (WebCountry webCountry in webCountries)
            {
                countries.Add(GetCountry(userContext, webCountry));
            }
            return(countries);
        }
Ejemplo n.º 31
0
        public async Task Init()
        {
            if (CountryList.Count == 0)
            {
                var countryList = await _countryService.GetAll <List <Country> >();

                foreach (var country in countryList)
                {
                    CountryList.Add(country);
                }
            }
        }
Ejemplo n.º 32
0
 public Gamestate()
 {
     score = 0;
     defcon = 5;
     turn = 0;
     round = 0; //headline phase
     usMilOps = 0;
     ussrMilOps = 0;
     usSpaceRace = 0;
     ussrSpaceRace = 0;
     usSrPlayed = false;
     ussrSrPlayed = false;
     usSrSecond = false;
     ussrSrSecond = false;
     gameOver = false;
     victor = "N/A";
     countryLst = new CountryList();
     cards = new CardList();
     //permanent status markers
     DeGualleLeadsFrance = false;
     WarsawPactFormed = false;
     USJapanMutualDefensePact = false;
     NORAD = false;
     MarshallPlan = false;
     NATO = false;
     FormosanResolution = false;
     BearTrap = false;
     WillyBrandt = false;
     CampDavidAccords = false;
     ShuttleDiplomacy = false;
     FlowerPower = false;
     Quagmire = false;
     JohnPaulIIElectedPope = false;
     IranianHostageCrisis = false;
     AnEvilEmpire = false;
     AwacsSaleToSaudis = false;
     TearDownThisWall = false;
     TheIronLady = false;
     NorthSeaOil = false;
     TheReformer = false;
 }
Ejemplo n.º 33
0
 public CountrySerializer(CountryList array, string path)
 {
     serializer = new XmlSerializer(typeof(CountryList));
     this.path = path;
     countries = array;
 }
Ejemplo n.º 34
0
 public CountrySerializer(CountryList array)
 {
     serializer = new XmlSerializer(typeof(CountryList));
     path = XML_PATH;
     countries = array;
 }
Ejemplo n.º 35
0
 public CountrySerializer(string path)
 {
     serializer = new XmlSerializer(typeof(CountryList));
     this.path = path;
     countries = null;
 }
Ejemplo n.º 36
0
 public CountrySerializer()
 {
     serializer = new XmlSerializer(typeof(CountryList));
     path = XML_PATH;
     countries = null;
 }