Exemplo n.º 1
0
        public void ADLogin()
        {
            var psql = GetPGServer();
            var tbl  = psql.Table("test", "show search_path");

            DataTableOutput.Write(tbl, FileUtility.GetTempFileName(".csv"), false, true);
        }
Exemplo n.º 2
0
        private void buttonSaveCsv_Click(object sender, EventArgs e)
        {
            csv.Rows[rowIndex]["cbtt"]       = this.textBoxcbtt.Text;
            csv.Rows[rowIndex]["pcode"]      = this.textBoxPcode.Text;
            csv.Rows[rowIndex]["usgs"]       = this.textBoxUsgs.Text;
            csv.Rows[rowIndex]["owrd"]       = this.textBoxOwrd.Text;
            csv.Rows[rowIndex]["idwr"]       = this.textBoxIdwr.Text;
            csv.Rows[rowIndex]["notes"]      = this.textBoxNotes.Text;
            csv.Rows[rowIndex]["idahopower"] = this.textBoxIdaCorp.Text;
            csv.Rows[rowIndex]["nrcs"]       = this.textBoxSnotel.Text;
            csv.Rows[rowIndex]["Updated"]    = this.textBoxLastUpdate.Text;

            DataTableOutput.Write(this.csv, labelFileName.Text, false);
        }
Exemplo n.º 3
0
        private void toolBar1_ButtonClick(object sender,
                                          System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            try
            {
                if (e.Button == toolBarButtonCopy)
                {// copy to clipboard.
                    if (dataGridView1.SelectedCells.Count > 0)
                    {
                        dataGridView1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;

                        Clipboard.SetDataObject(
                            this.dataGridView1.GetClipboardContent());
                    }
                }
                else if (e.Button == toolBarButtonSave)
                {
                    if (m_seriesList.ReadOnly || m_seriesList.Count > 1)
                    {
                        return;
                    }

                    m_seriesList.Save();
                }
                else if (e.Button == toolBarButtonExcel)
                {
                    string tmpFilename = FileUtility.GetTempFileName(".csv");

                    //DataTableOutput.Write(this.table, tmpFilename, false);
                    DataTableOutput.Write(this.table, tmpFilename, false, false);
                    System.Diagnostics.Process.Start(tmpFilename);
                }
                else if (e.Button == toolBarButtonPaste)
                {
                    this.pasteToolStripMenuItem_Click(this, EventArgs.Empty);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            Cursor = Cursors.Default;
        }