Ejemplo n.º 1
0
        private IEnumerable <Tuple <string, string> > GenerateMasterScriptFile(string path)
        {
            Analytics.Track("Export", new Dictionary <string, string>
            {
                { "exportType", SelectedFileType.ToString() },
                { "includeVoiceActors", IncludeVoiceActors.ToString() }
            });

            return(GenerateFile(path, () => GetExportData()));
        }
Ejemplo n.º 2
0
        private void buttonUpdateHugo_Click(object sender, EventArgs e)
        {
            try
            {
                DataTable changes      = null;
                int       rowsToChange = 0;
                if (dataGridView1.DataSource != null)
                {
                    changes = ((DataTable)dataGridView1.DataSource).GetChanges();
                    if (changes != null)
                    {
                        rowsToChange = changes.Rows.Count;
                    }
                }
                if (rowsToChange <= 0)
                {
                    MessageBox.Show("No updates to perform", "Update Hugo", MessageBoxButtons.OK);
                }
                else if (DialogResult.Yes == MessageBox.Show(String.Format("Update {0} records?", rowsToChange), "Update Hugo", MessageBoxButtons.YesNo))
                {
                    buttonUpdateHugo.Enabled = false;
                    switch (SelectedFileType)
                    {
                    case FileType.Positions:
                        Utilities.UpdatePositionRecords(SelectedClearingHouse, changes);
                        break;

                    case FileType.Confirmations:
                        Utilities.UpdateConfirmationRecords(SelectedClearingHouse, changes);
                        break;

                    default:
                        MessageBox.Show(String.Format("Updates not supported for file type {0}", SelectedFileType.ToString()),
                                        "Update Hugo", MessageBoxButtons.OK);
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                HandleError("Error updating Hugo", ex);
            }
            finally
            {
                m_needToBindSource = true;
                EnableControls();
                BindSource();
            }
        }