protected async Task SaveLocation()
        {
            Db.PortDetails.Add(portForm.ToPortDetails());

            await Db.SaveChangesAsync();

            locations = await Db.Locations.ToArrayAsync();

            portsGridView = locations
                            .SelectMany(p => p.Ports)
                            .Where(AreValidRecords)
                            .Select(p => PortDetailsGridView.FromPort(p))
                            .ToArray();

            portForm = new PortDetailsForm();

            await EditorPanel.HideAsync();

            await SuccessNotification.Show();
        }
Example #2
0
        protected async Task SaveLocation()
        {
            Db.PortDetails.Add(portForm.ToPortDetails());

            try
            {
                await Db.SaveChangesAsync();
            }
            catch (System.Exception)
            {
                await FailNotification.Show();
            }

            portsGridView = await LoadPortsViewModel();

            portForm = new PortDetailsForm();

            await EditorPanel.HideAsync();

            await SuccessNotification.Show();
        }