Example #1
0
        private void comboBox1_SelectedIndexChanged_1(object sender, EventArgs e)
        {
            string    cmdStr = string.Format("select DocNum, DocType, Description from  Transactions");
            DataTable dt     = new DataTable();

            dt = Utilities.DataBaseUtility.GetTable(cmdStr);
            List <string> st = Utilities.DataBaseUtility.GetList(cmdStr);

            string s = Utilities.DataBaseUtility.Execute(cmdStr, ident);

            Utilities.DataBaseUtility ud = new Utilities.DataBaseUtility();

            foreach (string s1 in st)
            {
                string[] items = s1.Split(',');
                comboBox1.Items.Add(items[0] + " , " + items[1] + " , " + items[2]);
                //comboBox1.Items.Add(s1);
            }
        }
Example #2
0
        private void OLD_button1_Click(object sender, EventArgs e)
        {
            Utilities.DataBaseUtility ins = new Utilities.DataBaseUtility();
            DataTable id = new DataTable();
            int       idnum;

            // string _supplierValues;

            //Handles generating a +1 value of the highest ID number in the table. This is to get around the AutoNumber feature missing from the table.
            id    = Utilities.DataBaseUtility.GetTable("Select MAX([SupplierID]) from Suppliers");
            idnum = Convert.ToInt32(id.Rows[0][0]) + 1;

            string _OLD_supplierValues = "('" + idnum.ToString() + "','" + textBox_DocNumber.Text + "','" + textBox_ProcType.Text + "','" + textBox_Employee.Text + "','" + textBox_Department.Text + "','" + textBox_StartDate.Text + "','" + textBox_Comment.Text + "','" + textBox_Status.Text;

            // txtResultTxt.Text = _supplierValues;

            // txtSQL.Text = "INSERT INTO Suppliers ([SupplierID],[Name],[Address],[Address2],[City],[Region],[Country],[PostalCode],[Phone],[WebAddress]) VALUES " + _supplierValues;

            //Turn on the code below when ready to submit to database.
            //ins.Insert("INSERT INTO Suppliers ([SupplierID],[Name],[Address],[Address2],[City],[Region],[Country],[PostalCode],[Phone],[WebAddress]) VALUES " + values);
        }
        private void OLD_button1_Click(object sender, EventArgs e)
        {
            Utilities.DataBaseUtility ins = new Utilities.DataBaseUtility();
            DataTable id = new DataTable();
            int idnum;
               // string _supplierValues;

            //Handles generating a +1 value of the highest ID number in the table. This is to get around the AutoNumber feature missing from the table.
            id = Utilities.DataBaseUtility.GetTable("Select MAX([SupplierID]) from Suppliers");
            idnum = Convert.ToInt32(id.Rows[0][0]) + 1;

            string  _OLD_supplierValues = "('"+idnum.ToString()+"','"+txtName.Text+ "','"+txtAddr.Text+"','"+txtAddr2.Text+"','"+txtCity.Text+"','"+txtState.Text+"','"+txtCountry.Text+"','"+txtZIP.Text+"','"+txtPhone.Text+"','"+txtURL.Text+"')";

               // txtResultTxt.Text = _supplierValues;

               // txtSQL.Text = "INSERT INTO Suppliers ([SupplierID],[Name],[Address],[Address2],[City],[Region],[Country],[PostalCode],[Phone],[WebAddress]) VALUES " + _supplierValues;

            //Turn on the code below when ready to submit to database.
            //ins.Insert("INSERT INTO Suppliers ([SupplierID],[Name],[Address],[Address2],[City],[Region],[Country],[PostalCode],[Phone],[WebAddress]) VALUES " + values);
        }