Exemplo n.º 1
0
        private void Properties()
        {
            FIA_Biosum_Manager.RxItem_Collection oRxColl = new RxItem_Collection();


            frmMain.g_sbpInfo.Text = "Creating Rx Package Properties Report...Stand By";
            for (int x = 0; x <= ReferenceRxItemCollection.Count - 1; x++)
            {
                if (ReferenceRxItemCollection.Item(x).Delete == false)
                {
                    if (this.m_oRxPackageItem.SimulationYear1Rx.Trim() ==
                        ReferenceRxItemCollection.Item(x).RxId.Trim() ||
                        this.m_oRxPackageItem.SimulationYear2Rx.Trim() ==
                        ReferenceRxItemCollection.Item(x).RxId.Trim() ||
                        this.m_oRxPackageItem.SimulationYear3Rx.Trim() ==
                        ReferenceRxItemCollection.Item(x).RxId.Trim() ||
                        this.m_oRxPackageItem.SimulationYear4Rx.Trim() ==
                        ReferenceRxItemCollection.Item(x).RxId.Trim())
                    {
                        RxItem oItem = new RxItem();
                        oItem.CopyProperties(ReferenceRxItemCollection.Item(x), oItem);
                        if (oItem.m_oFvsCommandItem_Collection1 != null)
                        {
                            for (int y = 0; y <= oItem.m_oFvsCommandItem_Collection1.Count - 1; y++)
                            {
                                if (oItem.m_oFvsCommandItem_Collection1.Item(y).Delete == true)
                                {
                                    oItem.m_oFvsCommandItem_Collection1.Remove(y);
                                }
                            }
                        }
                        oRxColl.Add(oItem);
                    }
                }
            }

            FIA_Biosum_Manager.RxPackageItem_Collection oRxPackageCollection = new RxPackageItem_Collection();
            oRxPackageCollection.Add(this.m_oRxPackageItem);

            FIA_Biosum_Manager.frmDialog frmTemp = new frmDialog();
            frmTemp.Text       = "FIA Biosum";
            frmTemp.AutoScroll = false;
            uc_textbox uc_textbox1 = new uc_textbox();

            frmTemp.Controls.Add(uc_textbox1);
            uc_textbox1.Dock          = DockStyle.Fill;
            uc_textbox1.lblTitle.Text = "Package Properties";
            RxTools oRxTools = new RxTools();

            uc_textbox1.TextValue = oRxTools.PackageProperties(oRxPackageCollection, oRxColl);
            frmTemp.Show();

            frmMain.g_sbpInfo.Text = "Ready";
        }
Exemplo n.º 2
0
        private void Properties()
        {
            if (this.m_oRxItem.RxId.Trim().Length == 0)
            {
                return;
            }
            frmMain.g_sbpInfo.Text = "Creating Rx Properties Report...Stand By";
            FIA_Biosum_Manager.RxItem_Collection oRxCollection = new RxItem_Collection();
            FIA_Biosum_Manager.RxItem            oRxItem       = new RxItem();

            oRxItem.CopyProperties(m_oRxItem, oRxItem);



            if (oRxItem.m_oFvsCommandItem_Collection1 != null)
            {
                for (int y = 0; y <= oRxItem.m_oFvsCommandItem_Collection1.Count - 1; y++)
                {
                    if (oRxItem.m_oFvsCommandItem_Collection1.Item(y).Delete == true)
                    {
                        oRxItem.m_oFvsCommandItem_Collection1.Remove(y);
                    }
                }
            }

            oRxCollection.Add(oRxItem);
            FIA_Biosum_Manager.frmDialog frmTemp = new frmDialog();
            frmTemp.Text       = "FIA Biosum";
            frmTemp.AutoScroll = false;
            uc_textbox uc_textbox1 = new uc_textbox();

            frmTemp.Controls.Add(uc_textbox1);
            uc_textbox1.Dock          = DockStyle.Fill;
            uc_textbox1.lblTitle.Text = "Treatment Properties";
            RxTools oRxTools = new RxTools();

            uc_textbox1.TextValue = oRxTools.TreatmentProperties(oRxCollection);
            frmTemp.Show();
            frmMain.g_sbpInfo.Text = "Ready";
        }
Exemplo n.º 3
0
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            frmDialog frmTemp = new frmDialog(((frmDialog)this.ParentForm).m_frmMain);

            frmTemp.Visible = false;
            //FIA_Biosum_Manager.uc_plot_input uc_plot_input1 = new uc_plot_input();
            //frmTemp.Controls.Add(uc_plot_input1);
            frmTemp.Initialize_Plot_Input_User_Control();
            frmTemp.MaximizeBox              = false;
            frmTemp.MinimizeBox              = false;
            frmTemp.Width                    = frmTemp.uc_plot_input1.m_DialogWd;
            frmTemp.Height                   = frmTemp.uc_plot_input1.m_DialogHt;
            frmTemp.Text                     = "Database: Add Plot Data";
            frmTemp.uc_plot_input1.Dock      = System.Windows.Forms.DockStyle.Fill;
            frmTemp.FormBorderStyle          = System.Windows.Forms.FormBorderStyle.FixedDialog;
            frmTemp.uc_plot_input1.Visible   = true;
            frmTemp.DisposeOfFormWhenClosing = true;
            frmTemp.MinimizeMainForm         = true;
            frmTemp.ParentControl            = frmMain.g_oFrmMain;
            frmTemp.ParentControl.Enabled    = false;
            frmTemp.Show();
        }
Exemplo n.º 4
0
        private void tlbPlotAddEdit_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
        {
            switch (e.Button.Text.Trim().ToUpper())
            {
            case "ADD PLOT DATA":
                frmDialog frmTemp = new frmDialog(((frmDialog)this.ParentForm).m_frmMain);
                frmTemp.Visible = false;
                //FIA_Biosum_Manager.uc_plot_input uc_plot_input1 = new uc_plot_input();
                //frmTemp.Controls.Add(uc_plot_input1);
                frmTemp.Initialize_Plot_Input_User_Control();
                frmTemp.MaximizeBox                        = false;
                frmTemp.MinimizeBox                        = true;
                frmTemp.Width                              = frmTemp.uc_plot_input1.m_DialogWd;
                frmTemp.Height                             = frmTemp.uc_plot_input1.m_DialogHt;
                frmTemp.Text                               = "Database: Add Plot Data";
                frmTemp.uc_plot_input1.Dock                = System.Windows.Forms.DockStyle.Fill;
                frmTemp.FormBorderStyle                    = System.Windows.Forms.FormBorderStyle.FixedDialog;
                frmTemp.uc_plot_input1.Visible             = true;
                frmTemp.DisposeOfFormWhenClosing           = true;
                frmTemp.uc_plot_input1.ReferenceFormDialog = frmTemp;
                frmTemp.MinimizeMainForm                   = true;
                frmTemp.ParentControl                      = frmMain.g_oFrmMain;
                frmTemp.ParentControl.Enabled              = false;
                frmTemp.Show();
                break;

            case "DELETE CONDITIONS":
                frmDialog frmTemp2 = new frmDialog(((frmDialog)this.ParentForm).m_frmMain);
                frmTemp2.Visible = false;
                frmTemp2.Initialize_Delete_Conditions_User_Control();
                frmTemp2.MaximizeBox = false;
                frmTemp2.MinimizeBox = true;
                frmTemp2.Width       = frmTemp2.uc_delete_conditions.m_DialogWd;
                frmTemp2.Height      = frmTemp2.uc_delete_conditions.m_DialogHt;
                frmTemp2.Text        = "Database: Delete Conditions";
                frmTemp2.uc_delete_conditions.Dock                = System.Windows.Forms.DockStyle.Fill;
                frmTemp2.FormBorderStyle                          = System.Windows.Forms.FormBorderStyle.FixedDialog;
                frmTemp2.uc_delete_conditions.Visible             = true;
                frmTemp2.DisposeOfFormWhenClosing                 = true;
                frmTemp2.uc_delete_conditions.ReferenceFormDialog = frmTemp2;
                frmTemp2.MinimizeMainForm                         = true;
                frmTemp2.ParentControl         = frmMain.g_oFrmMain;
                frmTemp2.ParentControl.Enabled = false;
                frmTemp2.Show();
                break;

            case "BROWSE AND DELETE SELECTED PLOT RECORDS":
                //instantiate the datasource class
                FIA_Biosum_Manager.Datasource p_datasource = new Datasource(((frmDialog)this.ParentForm).m_frmMain.frmProject.uc_project1.txtRootDirectory.Text.Trim());

                int intPlot = p_datasource.getTableNameRow("PLOT");
                //see if datasource found the PLOT table type
                if (intPlot >= 0)
                {
                    //see if the MDB file is found and the plot table is found
                    if (p_datasource.m_strDataSource[intPlot, FILESTATUS].Trim() == "F" &&
                        p_datasource.m_strDataSource[intPlot, TABLESTATUS].Trim() == "F")
                    {
                        //see if there are records in the plot table
                        if (p_datasource.m_strDataSource[intPlot, RECORDCOUNT].Trim() != "0")
                        {
                            string strConn = "";
                            string strFile = p_datasource.m_strDataSource[intPlot, MDBFILE].Trim();

                            if (strFile.Substring(strFile.Trim().Length - 6, 6).ToUpper() == ".ACCDB")
                            {
                                strConn = "Provider=Microsoft.Ace.OLEDB.12.0;Data Source=" +
                                          strFile + ";User Id=admin;Password=;";
                            }
                            else
                            {
                                strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
                                          strFile + ";User Id=admin;Password=;";
                            }

                            //string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
                            //	              p_datasource.m_strDataSource[intPlot,MDBFILE].Trim() +
                            //                ";User Id=admin;Password=;";

                            FIA_Biosum_Manager.frmGridView frmGV = new frmGridView();

                            frmGV.Text = "Database: Browse And Delete Plot Records";
                            frmGV.LoadDataSetToDeleteOnly(strConn, "select * from " + p_datasource.m_strDataSource[intPlot, TABLE].Trim() + ";", p_datasource.m_strDataSource[intPlot, TABLE].Trim());
                            frmGV.Show();
                            frmGV.Focus();
                        }
                        else
                        {
                            MessageBox.Show("!!No Records In The PLOT table!!", "BROWSE AND DELETE PLOT RECORDS", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
                        }
                    }
                    else
                    {
                        MessageBox.Show("!!Could not find either the MDB File named \n" +
                                        p_datasource.m_strDataSource[intPlot, MDBFILE] + "\n" +
                                        " or the plot table named \n" +
                                        p_datasource.m_strDataSource[intPlot, TABLE].Trim() + "!!",
                                        "BROWSE AND DELETE PLOT RECORDS",
                                        System.Windows.Forms.MessageBoxButtons.OK,
                                        System.Windows.Forms.MessageBoxIcon.Exclamation);
                    }
                }
                else
                {
                    MessageBox.Show("!!Could not find the table type PLOT in the datasource table!!", "BROWSE AND DELETE PLOT RECORDS", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Exclamation);
                }
                break;

            case "EDIT PLOT DATA":
                break;

            case "DELETE ALL PLOT RECORDS":
                this.DeleteAllPlotRecords();
                break;

            case "HELP":
                if (m_oHelp == null)
                {
                    m_oHelp = new Help(m_xpsFile, m_oEnv);
                }
                m_oHelp.ShowHelp(new string[] { "DATABASE", "PLOT_DATA_MENU" });
                break;
            }
        }