[chore:] implemented union (combiner) and its usage
This commit is contained in:
@@ -240,14 +240,14 @@ public partial class MainWindow : Window
|
||||
}
|
||||
}
|
||||
|
||||
private async void StartDifference(List<KasAddressList> address_lists, int owner_id)
|
||||
private async void StartCombine(List<KasAddressList> address_lists, int owner_id, string type)
|
||||
{
|
||||
var progressWindow = new ProgressWindow();
|
||||
|
||||
progressWindow.Show(_instance);
|
||||
|
||||
var processor = new CombineAddresses(progressWindow);
|
||||
var result = await processor.Perform(address_lists, "difference");
|
||||
var result = await processor.Perform(address_lists, type);
|
||||
|
||||
result.owner_id = owner_id;
|
||||
Settings._instance.addressSets.addresses.Add(result);
|
||||
@@ -258,6 +258,7 @@ public partial class MainWindow : Window
|
||||
//new ResultWindow(result, addresSetID).Show();
|
||||
}
|
||||
|
||||
|
||||
private void BtnSettingsAddCustomer_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
Settings._instance.customers.customers.Add(new Customer());
|
||||
@@ -499,6 +500,16 @@ public partial class MainWindow : Window
|
||||
list.Add(Settings._instance.addressSets.GetAddressSetByID(
|
||||
Convert.ToInt32(item.ToString().Split(" - ")[0])));
|
||||
|
||||
StartDifference(list, Convert.ToInt32(LstCustomers.SelectedItem.ToString().Split(" - ")[0]));
|
||||
StartCombine(list, Convert.ToInt32(LstCustomers.SelectedItem.ToString().Split(" - ")[0]), "difference");
|
||||
}
|
||||
|
||||
private void BtnCombineUnion_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var list = new List<KasAddressList>();
|
||||
foreach (var item in LstCustomerAdressSets.SelectedItems)
|
||||
list.Add(Settings._instance.addressSets.GetAddressSetByID(
|
||||
Convert.ToInt32(item.ToString().Split(" - ")[0])));
|
||||
|
||||
StartCombine(list, Convert.ToInt32(LstCustomers.SelectedItem.ToString().Split(" - ")[0]), "union");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user