private void Btn_save_Click(object sender, RoutedEventArgs e)
        {
            if (txt_DisasterName.Text == "" || txt_DisasterDescription.Text == "" || txt_Priority.Text == "" || txt_Region.Text == "" || txt_Victims.Text == "" ||
                txt_expiryDate.Text == "" || txt_CCV.Text == "" || txt_accountNo.Text == "" || txt_category.Text == "")
            {
                MessageBox.Show("Fill all the fields!");
                return;
            }

            bool created = false;

            DisasterReferences.DisasterB disaster = new DisasterReferences.DisasterB();
            disaster.Name        = txt_DisasterName.Text;
            disaster.Description = txt_DisasterDescription.Text;
            disaster.Priority    = Int32.Parse(txt_Priority.Text);
            disaster.Victims     = Int32.Parse(txt_Victims.Text);
            disaster.Region      = txt_Region.Text;
            disaster.CategoryId  = categoryB.CatogoryId;

            if (CheckBankAccount())
            {
                disaster.DisasterBankAccountId = GetIdOfTheBankAccount();
            }
            else
            {
                MessageBox.Show("There is no bank account with this information!");
            }


            created = disClient.CreateDisaster(disaster);
            if (created)
            {
                MessageBox.Show("The disaster was created!");
            }
            else
            {
                MessageBox.Show("The name of the disaster already exists!");
                return;
            }

            txt_DisasterDescription.Text = "";
            txt_DisasterName.Text        = "";
            txt_expiryDate.Text          = "";
            txt_CCV.Text       = "";
            txt_Priority.Text  = "";
            txt_Region.Text    = "";
            txt_Victims.Text   = "";
            txt_accountNo.Text = "";
            txt_AllDisasters.Items.Clear();
            txt_category.Text = "";
            loadAllDisasters();
        }
        private void Btn_update_Click(object sender, RoutedEventArgs e)
        {
            DisasterReferences.DisasterB disasterUpdated = new DisasterReferences.DisasterB();
            disasterUpdated.DisasterId  = disaster.DisasterId;
            disasterUpdated.Name        = txt_DisasterName.Text;
            disasterUpdated.Description = txt_DisasterDescription.Text;

            disasterUpdated.Priority   = Int32.Parse(txt_Priority.Text);
            disasterUpdated.Victims    = Int32.Parse(txt_Victims.Text);
            disasterUpdated.CategoryId = catId;
            disasterUpdated.Region     = txt_Region.Text;
            if (txt_DisasterName.Text != disaster.Name)
            {
                if (!disClient.CheckNameIfExists(txt_DisasterName.Text))
                {
                    disaster.Name = txt_DisasterName.Text;
                }
                else
                {
                    MessageBox.Show("This name already exists!");
                    return;
                }
            }
            else
            {
                disasterUpdated.Name = txt_DisasterName.Text;
            }

            bool updated = disClient.UpdateDisaster(disasterUpdated);

            if (updated)
            {
                MessageBox.Show("disaster was updated!");
            }
            else
            {
                MessageBox.Show("Something went wrong!");
            }
            txt_AllDisasters.Items.Clear();
            loadAllDisasters();
            txt_DisasterDescription.Text = "";
            txt_DisasterName.Text        = "";
            txt_expiryDate.Text          = "";
            txt_CCV.Text       = "";
            txt_Priority.Text  = "";
            txt_Region.Text    = "";
            txt_Victims.Text   = "";
            txt_accountNo.Text = "";
            txt_category.Text  = "";
        }
        private void ListBox_allDis_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (listBox_allDis.SelectedItem != null)
            {
                disSelect            = (string)listBox_allDis.SelectedItem;
                d                    = disClient.GetDisasterByName(disSelect);
                txt_description.Text = d.Description;
                txt_category.Text    = d.CategoryId.ToString();
                txt_priority.Text    = d.Priority.ToString();
                txt_region.Text      = d.Region;
                txt_victims.Text     = d.Victims.ToString();

                disasterAcc = bankClient.GetBankAccountById(d.DisasterBankAccountId);
            }
        }
        private void Txt_AllDisasters_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (txt_AllDisasters.SelectedItem != null)
            {
                disSelect    = (string)txt_AllDisasters.SelectedItem;
                disaster     = disClient.GetDisasterByName(disSelect);
                disAccountId = disaster.DisasterBankAccountId;
                GetAccountInfo(disAccountId);
                txt_DisasterName.Text        = disaster.Name;
                txt_DisasterDescription.Text = disaster.Description;
                txt_Priority.Text            = disaster.Priority.ToString();
                txt_Victims.Text             = disaster.Victims.ToString();
                txt_Region.Text     = disaster.Region;
                txt_accountNo.Text  = disAccNo.ToString();
                txt_expiryDate.Text = disAccDate.ToString();
                txt_CCV.Text        = disAccCCV.ToString();

                string nameOfCat = categoryClient.GetCategoryNameById(disaster.CategoryId);
                txt_category.Text = nameOfCat;
            }
        }