示例#1
0
        public string RegistrarMovimientoPedido(Cls_PedidoEN  pedido)
        {
            string lStr_Mensaje = "";

            using (MySqlConnection conMySql = new MySqlConnection(CadenaConexion))
            {

                cmdMySql = new MySqlCommand();
                cmdMySql.CommandText = "usp_ins_pedidomovimiento";
                cmdMySql.CommandType = System.Data.CommandType.StoredProcedure;
                cmdMySql.Connection = conMySql;
                conMySql.Open();

                cmdMySql.Parameters.Clear();
                cmdMySql.Parameters.AddWithValue("pn_IdPedido", pedido.IdPedido);
                cmdMySql.Parameters.AddWithValue("pn_IdEstadoPedido", pedido.IdEstadoPedido);
                cmdMySql.Parameters.AddWithValue("pn_IdUsuario", pedido.IdUsuario);
                cmdMySql.Parameters.Add("oc_message_error", MySqlDbType.VarChar, 1000).Direction = System.Data.ParameterDirection.Output;

                cmdMySql.ExecuteNonQuery();

                lStr_Mensaje = (string)cmdMySql.Parameters["OC_MESSAGE_ERROR"].Value;
            }

            return lStr_Mensaje;
        }
示例#2
0
        public List<Cls_PedidoEN> ConsultarPedidoMovimiento(string pStrCodPedido)
        {
            List<Cls_PedidoEN> lList_Pedido = new List<Cls_PedidoEN>();

            using (MySqlConnection conMySql = new MySqlConnection(CadenaConexion))
            {

                dt = new DataTable();
                cmdMySql = new MySqlCommand();
                cmdMySql.CommandText = "usp_lis_pedidomovimientoPorCodPedido";
                cmdMySql.CommandType = System.Data.CommandType.StoredProcedure;
                cmdMySql.Connection = conMySql;
                conMySql.Open();

                cmdMySql.Parameters.AddWithValue("pc_CodPedido", pStrCodPedido);

                Cls_PedidoEN pedido = new Cls_PedidoEN();
                using (MySqlDataReader reader = cmdMySql.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        pedido.IdPedido = reader.GetInt32(1);
                        pedido.IdEstadoPedido = reader.GetInt32(3);
                        pedido.IdUsuario = reader.GetInt32(8);

                        lList_Pedido.Add(pedido);

                    }
                }

                return lList_Pedido;

            }
        }