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();
        }
        public XtraFormCountry(Country country)
        {
            InitializeComponent();

            this._country = country;
            lookUpEditCities.EditValue       = _country.City;
            textEditCountryName.Text         = _country.Name;
            checkEditIsActive.Checked        = _country.IsActive;
            barButtonItemCountrySave.Caption = "Güncelle";
            update = true;
        }
Exemple #3
0
        private void barButtonItemEditCountry_ItemClick(object sender, ItemClickEventArgs e)
        {
            Country selectedCountry = bindingSourceCountry.Current as Country;

            if (selectedCountry.IsNull())
            {
                Extensions.Extensions.ObjectNotSelectedForEdit();
                return;
            }
            XtraFormCountry formCountry = new XtraFormCountry(selectedCountry);

            formCountry.ShowDialog();
            bindingSourceCity_CurrentChanged(null, null);
        }
Exemple #4
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);
        }