Exemplo n.º 1
0
 protected void MakeResultsTree(string productId)
 {
     try {
         ClassE classE = new ClassE(GetDirectory() + userDir);
         classE.setGlobalVar();
         int prodId = int.Parse(productId);
         classE.m_makeResultsTree(prodId);
         classE.place_tree(prodId);
         classE.Close();
     } catch (Exception ex) {
         logFiles.ErrorLog(ex);
         Master.ShowErrorMessage("MPX internal error has occured.");
     }
 }
Exemplo n.º 2
0
    protected void FillAllowableComponentsDdl(AjaxControlToolkit.ComboBox ddl)
    {
        {
            ClassE calc = new ClassE(GetDirectory() + userDir);
            calc = new ClassE(GetDirectory() + userDir);
            calc.runsql("DELETE tblPossibleComp.* from tblPossibleComp;");
            try
            {
                calc.MakePossibleTable(int.Parse(dropListProducts.SelectedValue));
            }
            catch (Exception) { }
            calc.Close();
        }

        OleDbConnection  connec         = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + GetDirectory() + userDir + MAIN_USER_DATABASE + ";");
        string           commandRouting = "Select tblPossibleComp.* from tblPossibleComp ORDER BY ProdDesc;";
        OleDbCommand     cmd            = new OleDbCommand(commandRouting, connec);
        OleDbDataAdapter adapter        = new OleDbDataAdapter(cmd); //
        {
            try
            {
                connec.Open();
                DataTable ds = new DataTable();
                adapter.Fill(ds);
                if (ddl != null)
                {
                    ddl.Items.Clear();
                    for (int i = 0; i < ds.Rows.Count; i++)
                    {
                        ListItem item = new ListItem(ds.Rows[i]["ProdDesc"].ToString(), ds.Rows[i]["ProdID"].ToString());
                        ddl.Items.Add(item);
                    }
                }
                connec.Close();
            }
            catch (Exception ex)
            {
                try
                {
                    connec.Close();
                    connec = null;
                }
                catch { }
                string message = ex.Message;
            }
        }
    }
Exemplo n.º 3
0
    protected void SetAllowableComponentData()
    {
        {
            ClassE calc = new ClassE(GetDirectory() + userDir);
            calc = new ClassE(GetDirectory() + userDir);
            calc.runsql("DELETE * FROM tblPossibleComp;");
            try
            {
                calc.MakePossibleTable(int.Parse(dropListProducts.SelectedValue));
            }
            catch (Exception) { }
            calc.Close();
        }

        OleDbConnection  connec         = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + GetDirectory() + userDir + MAIN_USER_DATABASE + ";");
        string           commandRouting = "SELECT tblPossibleComp.* from tblPossibleComp ORDER BY ProdDesc;";
        OleDbCommand     cmd            = new OleDbCommand(commandRouting, connec);
        OleDbDataAdapter adapter        = new OleDbDataAdapter(cmd); //
        {
            try
            {
                connec.Open();
                DataTable dt = new DataTable();
                adapter.Fill(dt);
                DataView dv = dt.DefaultView;
                //need to bind this to a droplist

                connec.Close();
            }
            catch (Exception ex)
            {
                try
                {
                    connec.Close();
                    connec = null;
                }
                catch { }
                string message = ex.Message;
            }
        }
    }
    protected override void SetData()
    {
        {
            ClassE calc = new ClassE(GetDirectory() + userDir);

            calc.setGlobalVar();
            calc.runsql("DELETE * FROM tblbomTree;");
            if (dropListProducts.Items.Count > 0 && dropListProducts.SelectedItem == null)
            {
                dropListProducts.SelectedIndex = 0;
            }
            try {
                calc.MakeIbomTree(0, int.Parse(dropListProducts.SelectedValue), 0);
            } catch (Exception) { }
            calc.Close();
        }
        if (!checkAllSubComponents.Checked)
        {
            tableQueryString += " WHERE Show = -1";
        }
        base.SetData();
    }
Exemplo n.º 5
0
    protected override void SetData()
    {
        {
            ClassE calc = new ClassE(GetDirectory() + userDir);

            calc.setGlobalVar();
            calc.runsql("DELETE * FROM tblbomTree;");
            if (dropListProducts.Items.Count > 0 && dropListProducts.SelectedItem == null)
            {
                dropListProducts.SelectedIndex = 0;
            }
            try
            {
                calc.MakeIbomTree(0, int.Parse(dropListProducts.SelectedValue), 0);
            }
            catch (Exception) { }
            calc.Close();
        }



        if (!checkAllSubComponents.Checked)
        {
            //tableQueryString += " WHERE Show = -1";
            tableQueryString += " WHERE Level = 1";
        }
        else
        {
            tableQueryString += " WHERE Level >= 1";
        }

        base.SetData();
        GridViewRow myRow  = grid.FooterRow;
        TextBox     myText = (TextBox)myRow.Cells[2].Controls[0].Controls[0];

        myText.Text = "1";
    }