Exemplo n.º 1
0
        private async void DoRevertAsync(object obj)
        {
            if (FormQuery != null && FormQuery.Id > 0)
            {
                if (String.IsNullOrEmpty(Response))
                {
                    MessageBox.Show("Please Add Your Message . .");
                    return;
                }
                try
                {
                    var result = await RestHub.Revert(FormQuery.Id, Response);

                    if (result.UserObject != null && (bool)result.UserObject)
                    {
                        ClearQuery.Execute(this);
                        MessageBox.Show(result.StatusMessage);
                        RefreshQueries.Execute(this);
                    }
                    else
                    {
                        MessageBox.Show("Can't Revert Query . .");
                    }
                }
                catch (Exception ex)
                {
                    AppErrorBox.ShowErrorMessage("Error while Reverting Query . .", ex.ToString());
                }
            }
            else
            {
                MessageBox.Show("Please save query or select already created query to proceed . .");
            }
        }