Esempio n. 1
0
        private void Delete()
        {
            Command command = new CommandDelete(SelectedFlowerPlot);

            command.Execute();
            if (commands.Count > currentCommand)
            {
                commands.RemoveRange(currentCommand, commands.Count - currentCommand);
            }
            commands.Add(command);
            currentCommand++;

            //if (ConnectionService.Instance.proxy.DeleteFlowerPlot(SelectedFlowerPlot))
            //{
            //    var result = ConnectionService.Instance.proxy.DeleteFlowerPlot(SelectedFlowerPlot);
            //    MainWindow.logMessage = "Deleted selected flower plot.";
            //    LogService.Instance.LogInformation("Deleted selected flower plot.");
            //    LogService.Instance.SendServerInformation("Deleted selected flower plot.");
            //}
            //else
            //{
            //    MessageBox.Show("Selected item is allready deleted.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            //    MainWindow.logMessage = "Error while deleting selected flower plot.";
            //    LogService.Instance.LogError("Selected flower plot is already deleted.");
            //    LogService.Instance.SendServerError("Selected flower plot is already deleted.");
            //}
        }
Esempio n. 2
0
        private async void ActionLongTap(object param)
        {
            if (param is Actor actor)
            {
                const string v1  = "Give Oskar";
                const string v2  = "Give gold Raspberry";
                const string v3  = "Delete";
                const string v4  = "Cancel";
                string       res = await View.DisplayActionSheet("Select action", null, null, new string[]
                {
                    v1,
                    v2,
                    v3,
                    v4,
                });

                switch (res)
                {
                case v1:
                    CommandGiveOskar.Execute(actor);
                    break;

                case v2:
                    CommandGiveRaspberry.Execute(actor);
                    break;

                case v3:
                    CommandDelete.Execute(actor);
                    break;
                }

                //if (res == v1)
                //    SetUserRank(actor);
                //else if (res == v2)
                //    DeleteActor(actor);
            }
        }