예제 #1
0
        private void MigrarProdCategoria()
        {
            String a         = cbxCP.SelectedItem.ToString();
            String value     = a;
            Char   delimiter = '-';

            String[] substrings = value.Split(delimiter);

            String codigo = Convert.ToString(substrings[0]);

            cn.Conectarx();
            cn.queryMigrarCategoria("update Productos set id_CatProducto = '" + codigo + "' where id_CatProducto = '" + id + "';");
        }
        public void GestionarStock()
        {
            String value     = codigos;
            Char   delimiter = ',';

            String[] substrings = value.Split(delimiter);
            foreach (var substring in substrings)
            {
                if (substring != String.Empty)
                {
                    cn.Conectarx();
                    //MessageBox.Show(""+Convert.ToInt32(substring));
                    String cadena = "Update Productos set Stock = (Stock-1) where id_producto = '" + substring + "'";

                    cn.queryMigrarCategoria(cadena);

                    this.LimpiarCamposVenta();
                }
            }
        }