Fixed small issues when creating a new ship
This commit is contained in:
parent
32a1d93840
commit
504e36d97b
@ -28,7 +28,7 @@ namespace BreCalClient
|
|||||||
private void buttonOK_Click(object sender, RoutedEventArgs e)
|
private void buttonOK_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
this.Ship.Name = this.textBoxName.Text.Trim();
|
this.Ship.Name = this.textBoxName.Text.ToUpper().Trim();
|
||||||
|
|
||||||
if (this.comboBoxParticipants.SelectedItem != null)
|
if (this.comboBoxParticipants.SelectedItem != null)
|
||||||
{
|
{
|
||||||
@ -40,7 +40,7 @@ namespace BreCalClient
|
|||||||
this.Ship.IsTug = false;
|
this.Ship.IsTug = false;
|
||||||
}
|
}
|
||||||
this.Ship.Imo = this.integerUpDownIMO.Value;
|
this.Ship.Imo = this.integerUpDownIMO.Value;
|
||||||
this.Ship.Callsign = this.textBoxCallsign.Text.Trim();
|
this.Ship.Callsign = this.textBoxCallsign.Text.ToUpper().Trim();
|
||||||
this.Ship.Length = (float?) this.doubleUpDownLength.Value;
|
this.Ship.Length = (float?) this.doubleUpDownLength.Value;
|
||||||
this.Ship.Width = (float?) this.doubleUpDownWidth.Value;
|
this.Ship.Width = (float?) this.doubleUpDownWidth.Value;
|
||||||
this.DialogResult = true;
|
this.DialogResult = true;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ namespace BreCalClient
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DataGridShips_CreateRequested()
|
private async void DataGridShips_CreateRequested()
|
||||||
{
|
{
|
||||||
ShipModel shipModel = new ShipModel(new Ship());
|
ShipModel shipModel = new ShipModel(new Ship());
|
||||||
EditShipDialog esd = new()
|
EditShipDialog esd = new()
|
||||||
@ -96,11 +96,15 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.ShipApi?.ShipsCreateAsync(shipModel.Ship);
|
if (this.ShipApi != null)
|
||||||
this.dataGridShips.ItemsSource = null;
|
{
|
||||||
BreCalLists.AllShips.Add(shipModel);
|
Id id = await this.ShipApi.ShipsCreateAsync(shipModel.Ship);
|
||||||
BreCalLists.Ships.Add(shipModel);
|
shipModel.Ship.Id = id.VarId;
|
||||||
this.dataGridShips.ItemsSource = BreCalLists.AllShips;
|
this.dataGridShips.ItemsSource = null;
|
||||||
|
BreCalLists.AllShips.Add(shipModel);
|
||||||
|
BreCalLists.Ships.Add(shipModel);
|
||||||
|
this.dataGridShips.ItemsSource = BreCalLists.AllShips;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user