Fixed issues when editing the shipcall as BSMD
This commit is contained in:
parent
da8ef2f113
commit
eb51074328
File diff suppressed because it is too large
Load Diff
@ -350,6 +350,7 @@ components:
|
|||||||
eta:
|
eta:
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
nullable: true
|
||||||
voyage:
|
voyage:
|
||||||
type: string
|
type: string
|
||||||
maxLength: 16
|
maxLength: 16
|
||||||
|
|||||||
@ -122,15 +122,23 @@ namespace BreCalClient
|
|||||||
this.datePickerETA.IsEnabled = true;
|
this.datePickerETA.IsEnabled = true;
|
||||||
this.datePickerETD.IsEnabled = false;
|
this.datePickerETD.IsEnabled = false;
|
||||||
this.datePickerETD.Value = null;
|
this.datePickerETD.Value = null;
|
||||||
|
this.comboBoxDepartureBerth.SelectedIndex = -1;
|
||||||
|
this.comboBoxDepartureBerth.IsEnabled = false;
|
||||||
|
this.comboBoxArrivalBerth.IsEnabled = true;
|
||||||
break;
|
break;
|
||||||
case TypeEnum.Outgoing:
|
case TypeEnum.Outgoing:
|
||||||
this.datePickerETA.IsEnabled = false;
|
this.datePickerETA.IsEnabled = false;
|
||||||
this.datePickerETD.IsEnabled = true;
|
this.datePickerETD.IsEnabled = true;
|
||||||
this.datePickerETA.Value = null;
|
this.datePickerETA.Value = null;
|
||||||
|
this.comboBoxArrivalBerth.SelectedIndex = -1;
|
||||||
|
this.comboBoxArrivalBerth.IsEnabled = false;
|
||||||
|
this.comboBoxDepartureBerth.IsEnabled = true;
|
||||||
break;
|
break;
|
||||||
case TypeEnum.Shifting:
|
case TypeEnum.Shifting:
|
||||||
this.datePickerETA.IsEnabled = true;
|
this.datePickerETA.IsEnabled = true;
|
||||||
this.datePickerETD.IsEnabled = true;
|
this.datePickerETD.IsEnabled = true;
|
||||||
|
this.comboBoxArrivalBerth.IsEnabled = true;
|
||||||
|
this.comboBoxDepartureBerth.IsEnabled = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -145,8 +153,8 @@ namespace BreCalClient
|
|||||||
if (this.ShipcallModel.Shipcall != null)
|
if (this.ShipcallModel.Shipcall != null)
|
||||||
{
|
{
|
||||||
this.ShipcallModel.Shipcall.Type = (int)this.comboBoxCategories.SelectedItem;
|
this.ShipcallModel.Shipcall.Type = (int)this.comboBoxCategories.SelectedItem;
|
||||||
this.ShipcallModel.Shipcall.Eta = this.datePickerETA.Value ?? DateTime.Now;
|
this.ShipcallModel.Shipcall.Eta = this.datePickerETA.Value;
|
||||||
this.ShipcallModel.Shipcall.Etd = this.datePickerETD.Value ?? DateTime.Now.AddDays(1);
|
this.ShipcallModel.Shipcall.Etd = this.datePickerETD.Value;
|
||||||
|
|
||||||
this.ShipcallModel.Shipcall.ShipId = ((Ship)this.comboBoxShip.SelectedItem).Id;
|
this.ShipcallModel.Shipcall.ShipId = ((Ship)this.comboBoxShip.SelectedItem).Id;
|
||||||
this.ShipcallModel.Ship = (Ship)this.comboBoxShip.SelectedItem;
|
this.ShipcallModel.Ship = (Ship)this.comboBoxShip.SelectedItem;
|
||||||
|
|||||||
@ -491,8 +491,8 @@ namespace BreCalClient
|
|||||||
{
|
{
|
||||||
if (x.Shipcall == null) return 0;
|
if (x.Shipcall == null) return 0;
|
||||||
if (y.Shipcall == null) return 0;
|
if (y.Shipcall == null) return 0;
|
||||||
DateTime xDate = (x.Shipcall.Type == (int) Extensions.TypeEnum.Incoming) ? x.Shipcall.Eta : x.Shipcall.Etd ?? x.Shipcall.Eta;
|
DateTime xDate = (x.Shipcall.Type == (int) Extensions.TypeEnum.Incoming) ? x.Shipcall.Eta ?? DateTime.Now : x.Shipcall.Etd ?? DateTime.Now;
|
||||||
DateTime yDate = (y.Shipcall.Type == (int) Extensions.TypeEnum.Incoming) ? y.Shipcall.Eta : y.Shipcall.Etd ?? y.Shipcall.Eta;
|
DateTime yDate = (y.Shipcall.Type == (int) Extensions.TypeEnum.Incoming) ? y.Shipcall.Eta ?? DateTime.Now : y.Shipcall.Etd ?? DateTime.Now;
|
||||||
return DateTime.Compare(xDate, yDate);
|
return DateTime.Compare(xDate, yDate);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -151,7 +151,7 @@ namespace BreCalClient
|
|||||||
this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign;
|
this.textBlockCallsign.Text = this.ShipcallControlModel?.Ship?.Callsign;
|
||||||
if ((this.ShipcallControlModel?.Shipcall?.Type == 1) || (this.ShipcallControlModel?.Shipcall?.Type == 3))
|
if ((this.ShipcallControlModel?.Shipcall?.Type == 1) || (this.ShipcallControlModel?.Shipcall?.Type == 3))
|
||||||
{
|
{
|
||||||
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta.ToString("dd.MM. HH:mm");
|
this.textBlockETA.Text = this.ShipcallControlModel?.Shipcall?.Eta?.ToString("dd.MM. HH:mm");
|
||||||
}
|
}
|
||||||
if(this.ShipcallControlModel?.Shipcall?.Type == 2)
|
if(this.ShipcallControlModel?.Shipcall?.Type == 2)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class ShipcallSchema(Schema):
|
|||||||
id = fields.Int()
|
id = fields.Int()
|
||||||
ship_id = fields.Int()
|
ship_id = fields.Int()
|
||||||
type = fields.Int()
|
type = fields.Int()
|
||||||
eta = fields.DateTime()
|
eta = fields.DateTime(Required = False, allow_none=True)
|
||||||
voyage = fields.Str(Required = False, allow_none=True)
|
voyage = fields.Str(Required = False, allow_none=True)
|
||||||
etd = fields.DateTime(Required = False, allow_none=True)
|
etd = fields.DateTime(Required = False, allow_none=True)
|
||||||
arrival_berth_id = fields.Int(Required = False, allow_none=True)
|
arrival_berth_id = fields.Int(Required = False, allow_none=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user