Пример #1
0
        public bool SetForSearch(Cities inCities, Countries inCountries, out string result)
        {
            string method = MethodBase.GetCurrentMethod().Name;

            result = string.Empty;

            try
            {
                btn.Visible = true;
                btn.Text    = "Search";

                #region City

                if (inCities != null)
                {
                    cities = inCities;
                    foreach (City city in cities.CitiesList())
                    {
                        cboCity.Items.Add(city.Name);
                    }
                }

                #endregion

                #region Country

                if (inCountries != null)
                {
                    countries = inCountries;
                    foreach (Country country in countries.CountriesList())
                    {
                        cboCountry.Items.Add(country.Name);
                    }
                }

                #endregion

                #region Birth Date

                cboYear.Items.Clear();
                cboYear.Items.Add(string.Empty);
                for (int year = 1900; year < 2030; year++)
                {
                    cboYear.Items.Add(year.ToString());
                }

                cboMonth.Items.Clear();
                cboMonth.Items.Add(string.Empty);
                for (int month = 1; month < 13; month++)
                {
                    string monthString = (month > 9) ? month.ToString() : $"0{month}";
                    cboMonth.Items.Add(monthString);
                }

                cboDay.Items.Clear();
                cboDay.Items.Add(string.Empty);
                for (int day = 1; day < 32; day++)
                {
                    string dayString = (day > 9) ? day.ToString() : $"0{day}";
                    cboDay.Items.Add(dayString);
                }

                #endregion

                #region Sex

                cboSex.Items.Clear();
                cboSex.Items.Add("זכר");
                cboSex.Items.Add("נקבה");
                cboSex.Items.Add(string.Empty);

                #endregion

                return(true);
            }
            catch (Exception e)
            {
                Audit(e.Message, method, LINE(), AuditSeverity.Error);

                return(false);
            }
        }