Пример #1
0
        transaccionSenasa  obtenerFila(int fila)
        {
            transaccionSenasa trans = new transaccionSenasa();


            trans.id_transaccion      = Convert.ToInt64(gridDatosGeneral[0, fila].Value);
            trans.f_transaccion       = Convert.ToDateTime(gridDatosGeneral[1, fila].Value);
            trans.f_operacion         = Convert.ToDateTime(gridDatosGeneral[2, fila].Value);
            trans.d_evento            = gridDatosGeneral[3, fila].Value.ToString();
            trans.d_agente_informador = gridDatosGeneral[4, fila].Value.ToString();
            trans.d_agente_origen     = gridDatosGeneral[5, fila].Value.ToString();
            trans.d_agente_destino    = gridDatosGeneral[6, fila].Value.ToString();
            trans.d_producto          = gridDatosGeneral[7, fila].Value.ToString();
            trans.cod_producto        = gridDatosGeneral[8, fila].Value.ToString();
            trans.cantidad            = Convert.ToDecimal(gridDatosGeneral[9, fila].Value);

            if (gridDatosGeneral[10, fila].Value != null)
            {
                trans.d_envase = gridDatosGeneral[10, fila].Value.ToString();
            }

            trans.d_estado_transaccion = gridDatosGeneral[11, fila].Value.ToString();
            trans.d_tipo_transaccion   = gridDatosGeneral[12, fila].Value.ToString();
            if (gridDatosGeneral[13, fila].Value != null)
            {
                trans.n_serie = gridDatosGeneral[13, fila].Value.ToString();
            }
            trans.n_lote   = gridDatosGeneral[14, fila].Value.ToString();
            trans.n_remito = gridDatosGeneral[15, fila].Value.ToString();

            if (gridDatosGeneral[16, fila].Value != null)
            {
                trans.motivo_devolucion = gridDatosGeneral[16, fila].Value.ToString();
            }

            if (gridDatosGeneral[17, fila].Value != null)
            {
                trans.d_motivo_destruccion = gridDatosGeneral[17, fila].Value.ToString();
            }

            trans.en_transporte = "False";

            return(trans);
        }
Пример #2
0
/*id_transaccion_global
 * id_transaccion
 * f_transaccion
 * f_operacion
 * f_vencimiento
 * f_elaboracion
 * d_evento
 * n_cantidad
 * id_unidad
 * d_unidad
 * cod_producto
 * n_serie
 * n_lote
 * n_cai
 * n_cae
 * d_motivo_destruccion
 * observaciones
 * n_vale_compra
 * apellidoNombre
 * direccion
 * numero
 * localidad
 * provincia
 * n_postal
 * cuit
 * gln_informador
 * d_agente_informador
 * gln_origen
 * d_agente_origen
 * gln_destino
 * d_agente_destino
 * id_motivo_destruccion
 * en_transporte
 * n_manifiesto
 * n_remito_ingreso
 * n_remito_egreso
 * motivo_devolucion
 * d_estado_transaccion
 * d_tipo_transaccion
 * stock
 * d_producto
 *
 *
 */



/// <summary>
/// Guada en el Stock
/// </summary>
/// <param name="datosGuardar"></param>
        public static void Guardar(transaccionSenasa datosGuardar)
        {
            //Conecta a la Base de datos segun ruta guardada
            ConexionAccess2007.Conectar(ConfigurationManager.AppSettings["BaseTrazabilidad"].ToString());



            /*
             *                                             "id_transaccion, f_transaccion, " +
             *                                                             "f_operacion, f_vencimiento, f_elaboracion, " +
             *                                                             "d_evento, n_cantidad, " +
             *                                                             "id_unidad, d_unidad, " +
             *                                                             "cod_producto, n_serie,	n_lote, " +
             *                                                             "n_cai, n_cae, " +
             *                                                             "d_motivo_destruccion, observaciones, " +
             *                                                             "n_vale_compra, " +
             *                                                             "apellidoNombre,	direccion, numero, " +
             *                                                             "localidad,	provincia, n_postal, cuit, " +
             *                                                             "gln_informador, d_agente_informador, " +
             *                                                             "gln_origen, d_agente_origen, " +
             *                                                             "gln_destino, d_agente_destino, " +
             *                                                             "id_motivo_destruccion,	en_transporte, " +
             *                                                             "n_manifiesto,	n_remito_ingreso, n_remito_egreso, " +
             *                                                             "motivo_devolucion,	d_estado_transaccion, " +
             *                                                             "d_tipo_transaccion, stock, d_producto" , +
             */



            try
            {
                //Guardo los datos dentro de la tabla
                ConexionAccess2007.InsertarFila("Stock",
                                                "id_transaccion, " +
                                                "f_transaccion, " +
                                                "f_operacion, " +
                                                "d_evento, " +
                                                "d_agente_informador, " +
                                                "d_agente_origen, " +
                                                "d_agente_destino, " +
                                                "d_producto, " +
                                                "cod_producto, " +
                                                "n_cantidad, " +
                                                "d_estado_transaccion, " +
                                                "d_tipo_transaccion, " +
                                                "n_serie, " +
                                                "n_lote, " +
                                                "n_remito_ingreso, " +
                                                "d_motivo_destruccion, " +
                                                //"en_transporte, " +
                                                "motivo_devolucion, " +
                                                //"observaciones"//, " +
                                                "n_vale_compra, " +
                                                "apellidoNombre, " +
                                                "direccion, " +
                                                "numero, " +
                                                "localidad, " +
                                                "provincia, " +
                                                "n_postal, " +
                                                "cuit, " +
                                                "stock"
                                                ,

                                                "" + datosGuardar.id_transaccion + ", " +
                                                "'" + datosGuardar.f_transaccion.ToShortDateString() + "', " +
                                                "'" + datosGuardar.f_operacion.ToShortDateString() + "', " +
                                                "'" + datosGuardar.d_evento + "', " +
                                                "'" + datosGuardar.d_agente_informador + "', " +
                                                "'" + datosGuardar.d_agente_origen + "', " +
                                                "'" + datosGuardar.d_agente_destino + "', " +
                                                "'" + datosGuardar.d_producto + "', " +
                                                "'" + datosGuardar.cod_producto + "', " +
                                                datosGuardar.cantidad + ", " +
                                                //"'" + datosGuardar.d_envase + "', " +
                                                "'" + datosGuardar.d_estado_transaccion + "', " +
                                                "'" + datosGuardar.d_tipo_transaccion + "', " +
                                                "'" + datosGuardar.n_serie + "', " +
                                                "'" + datosGuardar.n_lote + "', " +
                                                "'" + datosGuardar.n_remito + "', " +
                                                "'" + datosGuardar.d_motivo_destruccion + "', " +
                                                //"'" + datosGuardar.en_transporte + "', " +
                                                "'" + datosGuardar.motivo_devolucion + "', " +
                                                //"" + datosGuardar.observaciones + ""//"', " +
                                                "'" + datosGuardar.n_vale_compra + "', " +
                                                "'" + datosGuardar.apellidoNombres + "', " +
                                                "'" + datosGuardar.direccion + "', " +
                                                datosGuardar.numero + ", " +
                                                //datosGuardar.numeroSpecified;
                                                "'" + datosGuardar.localidad + "', " +
                                                //datosGuardar.localidadSpecified
                                                "'" + datosGuardar.provincia + "', " +
                                                //datosGuardar.provinciaSpecified;
                                                "'" + datosGuardar.n_postal + "', " +
                                                "'" + datosGuardar.cuit + "', " +
                                                datosGuardar.cantidad, false);



                //MessageBox.Show ("Registro guardado", "Guardado");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error");
            }

            //Cerrar la conexion
            ConexionAccess2007.Desconectar();
        }