private void PdFRead() { int Id = int.Parse(controls.flowChartName); DataTable dt = SQLiteDatabaseCommand.selectSearch("tblFlowChartLines", Id); string pdfSource = Application.StartupPath + @"\Documents\" + dt.Rows[0][3].ToString(); }
private void loadGrid() { dataGridView1.AutoGenerateColumns = false; DataTable dt = new DataTable(); dt.Columns.Add("Title", typeof(String)); dt.Columns.Add("Document name", typeof(String)); dt.Columns.Add("Start page", typeof(String)); dt.Columns.Add("End page", typeof(String)); DataGridViewTextBoxColumn startPage = new DataGridViewTextBoxColumn(); startPage.Width = 70; startPage.HeaderText = "Start Page"; startPage.DataPropertyName = "Start Page"; DataGridViewTextBoxColumn endPage = new DataGridViewTextBoxColumn(); endPage.Width = 70; endPage.HeaderText = "End Page"; endPage.DataPropertyName = "End Page"; DataGridViewComboBoxColumn documentName = new DataGridViewComboBoxColumn(); DataTable dtList = SQLiteDatabaseCommand.dataList("tblDocument"); dtList.Columns.Remove(dtList.Columns[0]); dtList.Columns.Remove(dtList.Columns[1]); int x = 0; List <string> items = new List <string>(); foreach (DataRow row in dtList.Rows) { items.Add(dtList.Rows[x][0].ToString()); x++; } documentName.DataSource = items; documentName.Width = 200; documentName.HeaderText = "Document Name"; documentName.DataPropertyName = "DocumentName"; DataGridViewTextBoxColumn title = new DataGridViewTextBoxColumn(); title.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; title.HeaderText = "Title"; title.DataPropertyName = "Title"; dataGridView1.DataSource = dt; dataGridView1.Columns.AddRange(title, documentName, startPage, endPage); }
private void loadData() { try { DataTable dt = SQLiteDatabaseCommand.dataList("tblDocument"); dt.Columns.Remove(dt.Columns[0]); dt.Columns.Remove(dt.Columns[1]); dataGridView1.DataSource = dt; } finally { dataGridView1.Refresh(); } }
private void load_Critiria() { cbCritiria.Items.Clear(); dtCritiria = SQLiteDatabaseCommand.flowList("tblCritiria", KRAId); int x = 0; foreach (DataRow row in dtCritiria.Rows) { cbCritiria.Items.Add(dtCritiria.Rows[x][1].ToString()); x++; } cbCritiria.DropDownWidth = DropDownWidth(cbCritiria); }
private void load_Element() { cbElement.Items.Clear(); indx = cbCritiria.SelectedIndex; dtElement = SQLiteDatabaseCommand.flowList("tblElement", dtCritiria.Rows[indx][2].ToString()); int x = 0; foreach (DataRow row in dtElement.Rows) { cbElement.Items.Add(dtElement.Rows[x][1].ToString()); x++; } cbElement.DropDownWidth = DropDownWidth(cbElement); }
private void load_FlowChart() { cbPossibleOutcome.Items.Clear(); indx = cbElement.SelectedIndex; dtFlowChart = SQLiteDatabaseCommand.flowList("tblFlowChart", dtElement.Rows[indx][2].ToString()); int x = 0; foreach (DataRow row in dtElement.Rows) { cbPossibleOutcome.Items.Add(dtFlowChart.Rows[x][1].ToString()); x++; } cbPossibleOutcome.DropDownWidth = DropDownWidth(cbPossibleOutcome); }
private void button2_Click(object sender, EventArgs e) { string path = Application.StartupPath + @"\Documents\"; Directory.CreateDirectory(path); string filename = path + lblFilename.Text; if (lblFilename.Text != "" && txtDocName.Text != "") { if (!File.Exists(filename)) { File.Copy(lblFilename.AccessibleDescription, filename, true); } SQLiteDatabaseCommand.insertDocument(txtDocName.Text, filename); loadData(); } }
private void btnSave_Click(object sender, EventArgs e) { extensions.controls.KRA = extensions.SQLiteDatabaseCommand.newKRA(txtKRA.Text); foreach (RichTextBox tb in extensions.controls.GetAll(this, typeof(RichTextBox))) { try { string name = tb.Name; int indx = name.IndexOfAny("0123456789".ToCharArray()); int len = name.Length - indx; string path = name.Substring(indx, len); name = name.Substring(0, indx); path = extensions.controls.KRA + "_" + path; switch (name) { case "txtCore Indicator": extensions.SQLiteDatabaseCommand.insertNodeIndicator("tblIndicator", tb.Text, path, "Core Indicator"); break; case "txtIndicator": extensions.SQLiteDatabaseCommand.insertNodeIndicator("tblIndicator", tb.Text, path, "Indicator"); break; case "txtFlowChart": extensions.SQLiteDatabaseCommand.insertNodes("tblFlowChart", tb.Text, path); break; case "txtElement": extensions.SQLiteDatabaseCommand.insertNodes("tblElement", tb.Text, path); break; case "txtCritiria": extensions.SQLiteDatabaseCommand.insertNodes("tblCritiria", tb.Text, path); break; } } catch { } } SQLiteDatabaseCommand.insertFlowLines(); this.Close(); }
private void button3_Click(object sender, EventArgs e) { SQLiteDatabaseCommand.deleteDocument(dataGridView1.CurrentRow.Cells[0].Value.ToString()); loadData(); }