[feat:] implemented renaming functionality
This commit is contained in:
@@ -887,4 +887,31 @@ public partial class MainWindow : Window
|
|||||||
MessageBox.Show(this, ex.StackTrace, "Fehler");
|
MessageBox.Show(this, ex.StackTrace, "Fehler");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void MnIAdSetRename_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (LstCustomerAdressSets.SelectedItems.Count > 0)
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var result = await NamingWindow.Show(this);
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
var id = KasAddressList.GetIDByAddressSetListItem(LstCustomerAdressSets.SelectedItems[0]
|
||||||
|
.ToString());
|
||||||
|
var cus_id = Customer.GetIDByCustomerListItem(LstCustomers.SelectedItems[0].ToString());
|
||||||
|
foreach (var set in Settings._instance.addressSets.addresses)
|
||||||
|
if (set.ID == id)
|
||||||
|
{
|
||||||
|
set.Name = result;
|
||||||
|
Settings.Save();
|
||||||
|
RefreshAddressSetListItems(cus_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show(this, ex.StackTrace, "Fehler");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user