当前位置: 首页>>代码示例>>C#>>正文


C# BD.ExecuteScalar方法代码示例

本文整理汇总了C#中BD.ExecuteScalar方法的典型用法代码示例。如果您正苦于以下问题:C# BD.ExecuteScalar方法的具体用法?C# BD.ExecuteScalar怎么用?C# BD.ExecuteScalar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BD的用法示例。


在下文中一共展示了BD.ExecuteScalar方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NumAutorizacao

 public static string NumAutorizacao(string transID)
 {
     SqlParamsList ps = new SqlParamsList();
     ps.Add(new Fields("@transID", transID));
     BD BD = new BD();
     return BD.ExecuteScalar("select top 1 autorizacao_id from contacorrente where trans_id = @transID", ps).ToString();
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:7,代码来源:DALContaCorrente.cs

示例2: SNumDigito

 public static string SNumDigito(string transID)
 {
     SqlParamsList ps = new SqlParamsList();
     ps.Add(new Fields("@transID", transID));
     BD BD = new BD();
     return BD.ExecuteScalar("select top 1 digito from autor_transacoes where trans_id = @transID", ps).ToString();
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:7,代码来源:DALContaCorrente.cs

示例3: existeTerminal

 /// <summary>
 /// Diz se existe o POS cadastrado no banco;
 /// </summary>
 /// <param name="numSerie">número de série do POS</param>
 /// <returns>o Retorno é true  caso o Terminal/POS exista no BD e false caso contrário</returns>
 //Alterado para SqlServer
 public static bool existeTerminal(string numSerie)
 {
     SqlParamsList ps = new SqlParamsList();
       ps.Add(new Fields("@serial_number", numSerie));
       BD BD = new BD();
       int qtd = Convert.ToInt32(BD.ExecuteScalar(-1, "select count(*) from pos where pos_serial_number = @serial_number", ps));
       return qtd > 0;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:14,代码来源:DALPos.cs

示例4: GetNumTransacao

 public static string GetNumTransacao(string autorizacao)
 {
     SqlParamsList ps = new SqlParamsList();
       ps.Add(new Fields("@autor_id", autorizacao));
       BD BD = new BD();
       string s = Convert.ToString(BD.ExecuteScalar("SELECT TRANS_ID FROM AUTOR_TRANSACOES WHERE AUTOR_ID = @autor_id", ps));
       return s;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:8,代码来源:DALTransacoes.cs

示例5: CredID

        //Alterado para SqlServer
        public static int CredID(int pos_serial_number)
        {
            string sql = " SELECT CRED_ID FROM POS WHERE POS_SERIAL_NUMBER = '" + pos_serial_number + "'";
            BD BD = new BD();
            int cred_id = (int)BD.ExecuteScalar(sql, null);

            return cred_id;
        }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:9,代码来源:DALCredenciado.cs

示例6: Envia_dados

 public static bool Envia_dados()
 {
     BD BD = new BD();
      string envia = BD.ExecuteScalar("SELECT envia_dados FROM Config", null).ToString();
      if (envia.Equals("S"))
     return true;
      else return false;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:8,代码来源:DALMisc.cs

示例7: Demissao_Move_Auts

 public static bool Demissao_Move_Auts()
 {
     BD BD = new BD();
      string move = BD.ExecuteScalar("SELECT demissao_move_auts FROM Config", null).ToString();
      if (move.Equals("S"))
     return true;
      else return false;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:8,代码来源:DALMisc.cs

示例8: Bloqueia_Venda_Valor

 public static bool Bloqueia_Venda_Valor()
 {
     BD BD = new BD();
      string bloqueia = BD.ExecuteScalar("SELECT bloqueia_venda_valor FROM Config", null).ToString();
      if (bloqueia.Equals("S"))
     return true;
      else return false;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:8,代码来源:DALMisc.cs

示例9: addEmpresa

 public static bool addEmpresa(Empresas emp, string valorNull)
 {
     BD BD = new BD();
     MontadorSql montador = setarParametrosEmpresa("empresas",emp,MontadorType.Insert);
     bool retorno = false;
     try
     {
       SqlParamsList parametros = setarParametrosEmpresa(emp,valorNull);
       BD.ExecuteScalar(montador.GetSqlString(), parametros);
       parametros.Clear();
       parametros.Add(new Fields("empres_id",emp.Empres_id));
       retorno = Convert.ToInt32(BD.ExecuteScalar("select count(*) from empresas where empres_id = @empres_id",parametros)) == 1;
     }
     catch (Exception e)
     {
       throw new Exception("Erro ao incluir empresa.\n O erro foi: " + e.Message);
     }
     return retorno;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:19,代码来源:DALEmpresa.cs

示例10: CountCartoes

 public static int CountCartoes(StringBuilder where, int cred_id)
 {
     string S = " SELECT count(*) FROM Cartoes cart JOIN Conveniados conv ON conv.conv_id = cart.conv_id  " +
             " AND conv.empres_id NOT IN " +
             " (SELECT empres_id FROM cred_emp_lib WHERE cred_emp_lib.cred_id = " + cred_id + " AND cred_emp_lib.liberado = 'N') " +
             where.ToString();
      BD BD = new BD();
      object c = BD.ExecuteScalar(S, null);
      if (c != null)
     return (int)c;
      else
     return 0;
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:13,代码来源:DALEmpresa.cs

示例11: GetAtualizaLua

 public static int GetAtualizaLua(string numSerie)
 {
     if (existeTerminal(numSerie))
     {
     SqlParamsList ps = new SqlParamsList();
     ps.Add(new Fields("@serial_number", numSerie));
     BD BD = new BD();
     string status = Convert.ToString(BD.ExecuteScalar("N", "select ATUALIZOU_LUA from pos where pos_serial_number = @serial_number", ps));
     return (status == "N" ? 0 : 1);
     }
     else
     {
     return -1;
     }
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:15,代码来源:DALPos.cs

示例12: InsertProd

        // Insere um novo Produto na tabela "produtos" e em seguida o preço do mesmo na tabela "precos"
        public static int InsertProd(string Descricao, double PrecoFinal, double PrecoTabela)
        {
            string sql = "SELECT MAX(prod_id) AS prod_id FROM Produtos";
             BD BD = new BD();
             int prod_id = BD.ExecuteScalar<int>(0, sql, null) + 1;
             try
             {
            MontadorSql mont = new MontadorSql("produtos", MontadorType.Insert);
            mont.AddField("prod_id", (prod_id));
            mont.AddField("codinbs", "9991000009999");
            mont.AddField("descricao", Descricao);
            mont.AddField("sn", "");
            mont.AddField("flagnome", "");
            mont.AddField("mt", "M");
            mont.AddField("apagado", "N");
            mont.AddField("data", DateTime.Now.ToString("dd/MM/yyyy"));

            BD.ExecuteNoQuery(mont.GetSqlString(), mont.GetParams());

             }
             catch (Exception ex)
             {
            throw new Exception("Erro ao inserir produto: " + ex.Message);
             }

             try
             {
            MontadorSql mont = new MontadorSql("precos", MontadorType.Insert);
            mont.AddField("prod_id", prod_id);
            mont.AddField("data", DateTime.Now.ToString("dd/MM/yyyy"));
            mont.AddField("preco_final", PrecoFinal);
            mont.AddField("preco_sem_desconto", PrecoTabela);
            BD.ExecuteNoQuery(mont.GetSqlString(), mont.GetParams());
             }
             catch (Exception ex)
             {
            throw new Exception("Erro ao inserir preços: " + ex.Message);
             }
             return prod_id;
        }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:41,代码来源:DALProduto.cs

示例13: beQuantidadePesquisaRapida

        public static string beQuantidadePesquisaRapida(string nome)
        {
            string sql = "SELECT COUNT(BE.CRED_BE_ID) AS C from CRED_ESPEC_BEM_ESTAR BE "
                       + "INNER JOIN CREDENCIADOS_BEM_ESTAR CRED ON(CRED.CRED_BE_ID = BE.CRED_BE_ID) "
                       + "INNER JOIN CIDADES CID ON(CID.CID_ID = CRED.CID_ID) "
                       + "WHERE CRED.FANTASIA LIKE '%" + nome + "%'";

            BD BD = new BD();
            return BD.ExecuteScalar(sql, null).ToString();
        }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:10,代码来源:DALOndeComprar.cs

示例14: VerificaSeg

 //Alterado para SqlServer
 public static string VerificaSeg(int cred_id)
 {
     BD BD = new BD();
     return (BD.ExecuteScalar("SELECT SEG_ID FROM CREDENCIADOS WHERE CRED_ID = " + cred_id, null).ToString());
 }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:6,代码来源:DALCredenciado.cs

示例15: SequenceCantinaCredito

        public static int SequenceCantinaCredito()
        {
            string sql = "SELECT NEXT VALUE FOR SCANTINA_CREDITOS";
              BD BD = new BD();
              int valor = Convert.ToInt16(BD.ExecuteScalar(sql, null));

              return valor;
        }
开发者ID:sidneipsj,项目名称:C-Projects,代码行数:8,代码来源:DALCartao.cs


注:本文中的BD.ExecuteScalar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。