Exemple #1
0
        public string Gravar(TRegistro_CadProtocolo val)
        {
            Hashtable hs = new Hashtable(20);

            hs.Add("@P_CD_PROTOCOLO", val.Cd_protocolo);
            hs.Add("@P_DS_PROTOCOLO", val.Ds_protocolo);
            hs.Add("@P_DS_PORTA", val.Ds_porta);
            hs.Add("@P_BAUDRATE", val.Baudrate);
            hs.Add("@P_DATABITS", val.Databits);
            hs.Add("@P_STOPBITS", val.Stopbits);
            hs.Add("@P_PARITY", val.Parity);
            hs.Add("@P_CHAR_EOL", val.Char_eol);
            hs.Add("@P_CHAR_PSESTAVEL", val.Char_psestavel);
            hs.Add("@P_POS_INI", val.Pos_ini);
            hs.Add("@P_SIZE_WORD", val.Size_word);
            hs.Add("@P_TAM_PACOTE", val.Tam_pacote);
            hs.Add("@P_TAM_BUFFERREAD", val.Tam_bufferread);
            hs.Add("@P_ST_DISCARTARNULL", val.St_discartarnull);
            hs.Add("@P_DTRENABLED", val.Dtrenabled);
            hs.Add("@P_HANDSHAKE", val.Handshake);
            hs.Add("@P_RECEIVEDBYTES", val.ReceivedBytes);
            hs.Add("@P_RTSENABLED", val.RTSEnabled);
            hs.Add("@P_ST_UTILIZARDLL", val.St_utilizardll);
            hs.Add("@P_NM_DLL", val.Nm_dll);

            return(executarProc("IA_DIV_PROTOCOLO", hs));
        }
Exemple #2
0
        public string Excluir(TRegistro_CadProtocolo val)
        {
            Hashtable hs = new Hashtable(1);

            hs.Add("@P_CD_PROTOCOLO", val.Cd_protocolo);
            return(this.executarProc("EXCLUI_DIV_PROTOCOLO", hs));
        }
Exemple #3
0
        public TList_RegCadProtocolo Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo)
        {
            TList_RegCadProtocolo lista = new TList_RegCadProtocolo();
            bool podeFecharBco          = false;

            if (Banco_Dados == null)
            {
                podeFecharBco = this.CriarBanco_Dados(false);
            }
            SqlDataReader reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo));

            try
            {
                while (reader.Read())
                {
                    TRegistro_CadProtocolo reg = new TRegistro_CadProtocolo();
                    if (!reader.IsDBNull(reader.GetOrdinal("cd_protocolo")))
                    {
                        reg.Cd_protocolo = reader.GetString(reader.GetOrdinal("cd_protocolo"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ds_protocolo")))
                    {
                        reg.Ds_protocolo = reader.GetString(reader.GetOrdinal("ds_protocolo"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("ds_porta")))
                    {
                        reg.Ds_porta = reader.GetString(reader.GetOrdinal("ds_porta"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("baudrate")))
                    {
                        reg.Baudrate = reader.GetInt32(reader.GetOrdinal("baudrate"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("databits")))
                    {
                        reg.Databits = reader.GetInt32(reader.GetOrdinal("databits"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("stopbits")))
                    {
                        reg.Stopbits = reader.GetString(reader.GetOrdinal("stopbits"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("parity")))
                    {
                        reg.Parity = reader.GetString(reader.GetOrdinal("parity"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("char_eol")))
                    {
                        reg.Char_eol = reader.GetInt32(reader.GetOrdinal("char_eol"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("char_psestavel")))
                    {
                        reg.Char_psestavel = reader.GetInt32(reader.GetOrdinal("char_psestavel"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("pos_ini")))
                    {
                        reg.Pos_ini = reader.GetInt32(reader.GetOrdinal("pos_ini"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("size_word")))
                    {
                        reg.Size_word = reader.GetInt32(reader.GetOrdinal("size_word"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("tam_pacote")))
                    {
                        reg.Tam_pacote = reader.GetInt32(reader.GetOrdinal("tam_pacote"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("tam_bufferread")))
                    {
                        reg.Tam_bufferread = reader.GetInt32(reader.GetOrdinal("tam_bufferread"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("st_discartarnull")))
                    {
                        reg.St_discartarnull = reader.GetString(reader.GetOrdinal("st_discartarnull"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("dtrenabled")))
                    {
                        reg.Dtrenabled = reader.GetString(reader.GetOrdinal("dtrenabled"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("handshake")))
                    {
                        reg.Handshake = reader.GetString(reader.GetOrdinal("handshake"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("receivedbytes")))
                    {
                        reg.ReceivedBytes = reader.GetInt32(reader.GetOrdinal("receivedbytes"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("rtsenabled")))
                    {
                        reg.RTSEnabled = reader.GetString(reader.GetOrdinal("rtsenabled"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("st_utilizardll")))
                    {
                        reg.St_utilizardll = reader.GetString(reader.GetOrdinal("st_utilizardll"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("nm_dll")))
                    {
                        reg.Nm_dll = reader.GetString(reader.GetOrdinal("nm_dll"));
                    }

                    lista.Add(reg);
                }
            }
            finally
            {
                reader.Close();
                reader.Dispose();
                if (podeFecharBco)
                {
                    this.deletarBanco_Dados();
                }
            }
            return(lista);
        }