예제 #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.");
                        }
                    }
                }
            }
        }
예제 #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);
        }
예제 #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;
        }
예제 #4
0
파일: Form1.cs 프로젝트: nikskonda/Project2
        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.");
            }
        }
예제 #5
0
 public void loadMatProperties(ISQLWorker sqlWorker)
 {
     matProperties.Clear();
     matProperties = sqlWorker.GetProperties(ParentType.Material);
 }
예제 #6
0
 public void loadDetProperties(ISQLWorker sqlWorker)
 {
     detProperties.Clear();
     detProperties = sqlWorker.GetProperties(ParentType.Detail);
 }
예제 #7
0
 public void loadCellTypes(ISQLWorker sqlWorker)
 {
     cellTypes.Clear();
     cellTypes = sqlWorker.GetCellTypes();
 }
예제 #8
0
 public void loadMaterials(ISQLWorker sqlWorker)
 {
     materials.Clear();
     materials = sqlWorker.GetMaterials();
 }
예제 #9
0
 public void loadDetails(ISQLWorker sqlWorker)
 {
     details.Clear();
     details = sqlWorker.GetDetails();
 }
예제 #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);
     }
 }
예제 #11
0
 public void loadCSProperties(ISQLWorker sqlWorker)
 {
     csProperties.Clear();
     csProperties = sqlWorker.GetProperties(ParentType.CelluralStructure);
 }
예제 #12
0
 public void loadCellProperties(ISQLWorker sqlWorker)
 {
     cellProperties.Clear();
     cellProperties = sqlWorker.GetProperties(ParentType.Cell);
 }
예제 #13
0
        //Add Detail
        //List<Cell> cells;


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