Esempio n. 1
0
        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.");
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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.");
            }
        }
Esempio n. 5
0
 public void loadMatProperties(ISQLWorker sqlWorker)
 {
     matProperties.Clear();
     matProperties = sqlWorker.GetProperties(ParentType.Material);
 }
Esempio n. 6
0
 public void loadDetProperties(ISQLWorker sqlWorker)
 {
     detProperties.Clear();
     detProperties = sqlWorker.GetProperties(ParentType.Detail);
 }
Esempio n. 7
0
 public void loadCellTypes(ISQLWorker sqlWorker)
 {
     cellTypes.Clear();
     cellTypes = sqlWorker.GetCellTypes();
 }
Esempio n. 8
0
 public void loadMaterials(ISQLWorker sqlWorker)
 {
     materials.Clear();
     materials = sqlWorker.GetMaterials();
 }
Esempio n. 9
0
 public void loadDetails(ISQLWorker sqlWorker)
 {
     details.Clear();
     details = sqlWorker.GetDetails();
 }
Esempio n. 10
0
 public bool AddNewResearchResultAndUpdateDetails(ResearchResult researchResult, ISQLWorker sqlWorker)
 {
     if (sqlWorker == null)
     {
         return(false);
     }
     if (sqlWorker.AddResearchResult(researchResult))
     {
         this.loadDetails();
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 11
0
 public void loadCSProperties(ISQLWorker sqlWorker)
 {
     csProperties.Clear();
     csProperties = sqlWorker.GetProperties(ParentType.CelluralStructure);
 }
Esempio n. 12
0
 public void loadCellProperties(ISQLWorker sqlWorker)
 {
     cellProperties.Clear();
     cellProperties = sqlWorker.GetProperties(ParentType.Cell);
 }
Esempio n. 13
0
        //Add Detail
        //List<Cell> cells;


        public DataViewPage(ISQLWorker SQLWorker)
        {
            sqlWorker = SQLWorker;
            InitializeComponent();
        }