private void button1_Click(object sender, EventArgs e) { if (IsNull(textBox1) || IsNull(textBox2) || IsNull(folderBrowserDialog1.SelectedPath)) { DialogManager.showDialogError("Empty Fields."); return; } INIManager ini = new INIManager(iniName); ini.WritePrivateString("Enter", "ServerName", textBox1.Text); ini.WritePrivateString("Enter", "DataBaseName", textBox2.Text); ini.WritePrivateString("Enter", "Path", folderBrowserDialog1.SelectedPath); if (SQLWorker.IsCreate(textBox1.Text, textBox2.Text)) { sqlWorker = new SQLWorker(textBox1.Text, textBox2.Text); if (checkBox1.Checked) { DataViewPage form1 = new DataViewPage(sqlWorker); form1.Show(); } else { DialogManager.showDialogInfo("Sucsess! You can close window."); } } else { if (DialogManager.showDialogYesNo("Data Base or Server not found. Create new Data Base?")) { if (!creater()) { DialogManager.showDialogError("Error creating database. Try Again."); if (!SQLWorker.delDB(textBox1.Text, textBox2.Text)) { DialogManager.showDialogError("Error cleaning data."); } return; } else { sqlWorker = new SQLWorker(textBox1.Text, textBox2.Text); if (checkBox1.Checked) { DataViewPage form1 = new DataViewPage(sqlWorker); form1.Show(); } else { DialogManager.showDialogInfo("Sucsess! You can close window."); } } } } }
public void loadAll(ISQLWorker sqlWorker) { this.loadDetails(sqlWorker); this.loadMaterials(sqlWorker); this.loadCells(sqlWorker); this.loadCellTypes(sqlWorker); this.loadCellProperties(sqlWorker); this.loadCSProperties(sqlWorker); this.loadMatProperties(sqlWorker); this.loadDetProperties(sqlWorker); }
public Data(ISQLWorker sqlWorker) { details = new List <Detail>(); materials = new List <Material>(); cells = new List <Cell>(); cellTypes = new List <CellType>(); detProperties = new List <Property>(); matProperties = new List <Property>(); cellProperties = new List <Property>(); csProperties = new List <Property>(); this.sqlWorker = sqlWorker; }
private void button1_Click(object sender, EventArgs e) { try { DBConnectionPage page = new DBConnectionPage(); page.ShowDialog(); sqlWorker = page.GetSQLWorker(); loadData(); showDetails(comboBox1); } catch (SQLWorkerException ex) { DialogManager.showDialogError("DataBase Error."); } }
public void loadMatProperties(ISQLWorker sqlWorker) { matProperties.Clear(); matProperties = sqlWorker.GetProperties(ParentType.Material); }
public void loadDetProperties(ISQLWorker sqlWorker) { detProperties.Clear(); detProperties = sqlWorker.GetProperties(ParentType.Detail); }
public void loadCellTypes(ISQLWorker sqlWorker) { cellTypes.Clear(); cellTypes = sqlWorker.GetCellTypes(); }
public void loadMaterials(ISQLWorker sqlWorker) { materials.Clear(); materials = sqlWorker.GetMaterials(); }
public void loadDetails(ISQLWorker sqlWorker) { details.Clear(); details = sqlWorker.GetDetails(); }
public bool AddNewResearchResultAndUpdateDetails(ResearchResult researchResult, ISQLWorker sqlWorker) { if (sqlWorker == null) { return(false); } if (sqlWorker.AddResearchResult(researchResult)) { this.loadDetails(); return(true); } else { return(false); } }
public void loadCSProperties(ISQLWorker sqlWorker) { csProperties.Clear(); csProperties = sqlWorker.GetProperties(ParentType.CelluralStructure); }
public void loadCellProperties(ISQLWorker sqlWorker) { cellProperties.Clear(); cellProperties = sqlWorker.GetProperties(ParentType.Cell); }
//Add Detail //List<Cell> cells; public DataViewPage(ISQLWorker SQLWorker) { sqlWorker = SQLWorker; InitializeComponent(); }