diff --git a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs index 1bb1ba98..4a86d304 100644 --- a/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs +++ b/ENI2/DetailViewControls/OverViewDetailControl.xaml.cs @@ -62,15 +62,17 @@ namespace ENI2.DetailViewControls public override void Initialize() { + bool iAmAdmin = DBManager.Instance.GetReportingPartyDict()[App.UserId.Value].IsAdmin; + base.Initialize(); Message.NotificationClass notificationClass = this.Core.IsTransit ? Message.NotificationClass.TRANSIT : Message.NotificationClass.VISIT; if (this.Messages == null) return; if (this.Core == null) return; - this.textBoxENI.IsReadOnly = false; - this.textBoxIMO.IsReadOnly = false; - this.locodePoC.IsEnabled = true; - this.textBoxDisplayId.IsReadOnly = false; + this.textBoxENI.IsReadOnly = !iAmAdmin; + this.textBoxIMO.IsReadOnly = !iAmAdmin; + this.locodePoC.IsEnabled = iAmAdmin; + this.textBoxDisplayId.IsReadOnly = !iAmAdmin; this.textBoxENI.DataContext = this.Core; this.textBoxIMO.DataContext = this.Core; diff --git a/bsmd.hisnord/Request.cs b/bsmd.hisnord/Request.cs index 9bf1c726..8940b5a4 100644 --- a/bsmd.hisnord/Request.cs +++ b/bsmd.hisnord/Request.cs @@ -711,8 +711,10 @@ namespace bsmd.hisnord lu.CargoNumberOfItems = ladg.CargoNumberOfItems.Value.ToString(); if (ladg.CargoGrossQuantity_TNE.HasValue) lu.CargoGrossQuantity_TNE = Math.Round((decimal)ladg.CargoGrossQuantity_TNE.Value, 3); - lu.CargoPortOfLoading = ladg.PortOfLoading; - lu.CargoPortOfDischarge = ladg.PortOfDischarge; + if(!ladg.PortOfLoading.IsNullOrEmpty()) + lu.CargoPortOfLoading = ladg.PortOfLoading; + if(!ladg.PortOfDischarge.IsNullOrEmpty()) + lu.CargoPortOfDischarge = ladg.PortOfDischarge; hn_generalcargo.Cargo[i] = lu; }