private void barButtonItemCountrySave_ItemClick(object sender, ItemClickEventArgs e)
        {
            Extensions.Extensions.ShowWaitForm(description: "İlçe kaydediliyor");
            CountrySolClient client = Extensions.Extensions.GetCountrySolService();

            if (client == null)
            {
                return;
            }

            if (_country == null)
            {
                _country = new Country
                {
                    CityId   = Convert.ToInt32(lookUpEditCities.EditValue),
                    Name     = textEditCountryName.Text,
                    IsActive = checkEditIsActive.Checked
                };
            }
            else
            {
                _country.CityId   = Convert.ToInt32(lookUpEditCities.EditValue);
                _country.Name     = textEditCountryName.Text;
                _country.IsActive = checkEditIsActive.Checked;
            }

            ProcessResult processResult = update ? client.Update(_country) : client.Insert(_country);

            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            Close();
        }
Beispiel #2
0
        public static void GetCountries()
        {
            if (GlobalVariables.Countries.IsNotNull())
            {
                return;
            }
            CountrySolClient client = Extensions.Extensions.GetCountrySolService();

            GlobalVariables.Countries = client.IsNull() ? null : client.AllCountries(true).ToList();
        }
Beispiel #3
0
        private void SelectionChangedNewCity(object sender, SelectionChangedEventArgs e)
        {
            City selectedCity = bindingSourceCity.Current as City;

            if (selectedCity.IsNull())
            {
                return;
            }

            CountrySolClient client1 = Extensions.Extensions.GetCountrySolService();

            bindingSourceCountry.DataSource = client1.Countries(selectedCity.Id, selectedCity.IsActive);
            client1.Close();
        }
Beispiel #4
0
        private void bindingSourceCity_CurrentChanged(object sender, EventArgs e)
        {
            CountrySolClient client = Extensions.Extensions.GetCountrySolService();

            if (client == null)
            {
                return;
            }

            BloodGroupService.City city = bindingSourceCity.Current as BloodGroupService.City;

            if (city == null)
            {
                return;
            }

            bindingSourceCountry.DataSource = client.Countries(city.Id, true);
            client.Close();
        }
Beispiel #5
0
        private void barButtonItemDeleteCountry_ItemClick(object sender, ItemClickEventArgs e)
        {
            Country country = bindingSourceCountry.Current as Country;

            if (country.IsNull())
            {
                Extensions.Extensions.ObjectNotSelectedForDelete();
                return;
            }
            if (Extensions.Extensions.DeletingAlert(country.Name) != DialogResult.Yes)
            {
                return;
            }

            Extensions.Extensions.ShowWaitForm(description: "İlçe siliniyor...");
            CountrySolClient client = Extensions.Extensions.GetCountrySolService();

            CounrtyService.ProcessResult processResult = client.Delete(country.Id);
            SplashScreenManager.CloseForm(false);
            Extensions.Extensions.ProcessResultMessage(processResult.Errors, (int)processResult.Result);
            bindingSourceCity_CurrentChanged(null, null);
        }
Beispiel #6
0
        public static CountrySolClient GetCountrySolService()
        {
            CountrySolClient client;

            try
            {
                client = new CountrySolClient(binding,
                                              new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "CountryService.svc")));
                client.Select(-1);
            }
            catch (Exception)
            {
                bool b = Program.TestService();
                if (!b)
                {
                    Application.Exit();
                }
                client = new CountrySolClient(binding,
                                              new EndpointAddress(String.Format(GlobalVariables.ServiceRoot + "/{0}", "CountryService.svc")));
            }

            return(client);
        }