Example #1
0
        public string GravarUsuarioCFGPedido(TRegistro_CadUsuario_CFGPedido val)
        {
            Hashtable hs = new Hashtable(2);

            hs.Add("@P_LOGIN", val.Login);
            hs.Add("@P_CFG_PEDIDO", val.Cfg_pedido);
            return(executarProc("IA_DIV_USUARIO_X_CFGPEDIDO", hs));
        }
Example #2
0
        public TList_CadUsuario_CFGPedido Select(TpBusca[] vBusca, Int32 vTop, string vNM_Campo)
        {
            TList_CadUsuario_CFGPedido lista = new TList_CadUsuario_CFGPedido();
            SqlDataReader reader             = null;
            bool          podeFecharBco      = false;

            if (Banco_Dados == null)
            {
                podeFecharBco = this.CriarBanco_Dados(false);
            }

            try
            {
                if (string.IsNullOrEmpty(vNM_Campo))
                {
                    reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), ""));
                }
                else
                {
                    reader = this.ExecutarBusca(this.SqlCodeBusca(vBusca, Convert.ToInt16(vTop), vNM_Campo));
                }
                while (reader.Read())
                {
                    TRegistro_CadUsuario_CFGPedido reg = new TRegistro_CadUsuario_CFGPedido();
                    if (!(reader.IsDBNull(reader.GetOrdinal("Login"))))
                    {
                        reg.Login = reader.GetString(reader.GetOrdinal("Login"));
                    }
                    if (!reader.IsDBNull(reader.GetOrdinal("nome_usuario")))
                    {
                        reg.Nome_usuario = reader.GetString(reader.GetOrdinal("nome_usuario"));
                    }
                    if (!(reader.IsDBNull(reader.GetOrdinal("CFG_Pedido"))))
                    {
                        reg.Cfg_pedido = reader.GetString(reader.GetOrdinal("CFG_Pedido"));
                    }
                    if (!(reader.IsDBNull(reader.GetOrdinal("DS_TipoPedido"))))
                    {
                        reg.DS_Cfg_pedido = reader.GetString(reader.GetOrdinal("DS_TipoPedido"));
                    }

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