Example #1
0
        private void Submit(string color, string vendor, string type)
        {
            try
            {
                var command = new OleDbCommand();
                command.Connection  = connection;
                command.CommandText = "INSERT INTO Color (COLOR, VENDOR, TYPE) VALUES('" + color + "', '" + vendor + "', '" + type + "')";

                connection.Open();
                command.ExecuteNonQuery();

                connection.Close();
                MessageBox.Show("Color Inserted");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
                connection.Close();
            }

            if (null != parent)
            {
                parent.UpdateLists();
            }
            else if (null != MaterialForm)
            {
                MaterialForm.UpdateLists();
            }
        }
Example #2
0
        private void Submit(string type, string width, string height)
        {
            try
            {
                var command = new OleDbCommand();
                command.Connection  = connection;
                command.CommandText = "INSERT INTO Materials (MATERIAL_TYPE, DEFAULT_WIDTH, DEFAULT_HEIGHT) VALUES('" + type + "', '" + width + "', '" + height + "')";

                connection.Open();
                command.ExecuteNonQuery();

                connection.Close();
                MessageBox.Show("Category Inserted");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
                connection.Close();
            }

            if (null != parent)
            {
                parent.UpdateLists();
            }
            else if (null != MaterialForm)
            {
                MaterialForm.UpdateLists();
            }
        }