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


C# SqlHelper.Close方法代码示例

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


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

示例1: Valores

 public IList<ValoresFuente> Valores(Ciudad city, int limite, dynamic options = null)
 {
     var top = limite > 0 ? "top " + limite : "";
     var sql = "select " + top + " * from sta_elena order by codigo_catastral";
     var str = ConfigurationManager.ConnectionStrings["riesgos"].ConnectionString;
     var conn = new SqlConnection(str);
     conn.Open();
     var reader = new SqlHelper(conn).ExecuteReader(sql);
     var mapa = new Dictionary<string, ValoresFuente>();
     var i = 0;
     while (reader.Read()) {
         i++;
         var temp = new ValoresFuente();
         Utils.FillDict(reader, temp);
         var clave = temp.GetString("codigo_catastral");
         if (mapa.ContainsKey(clave))
             continue;
         var manzana = GetManzana(clave);
         temp.Tipo = "construccion";
         temp.Codigo1 = clave;
         temp.Codigo2 = manzana;
         temp.IdItem = i;
         temp["clave"] = clave;
         temp["manzana"] = manzana;
         mapa[clave] = temp;
     }
     reader.Close();
     conn.Close();
     return mapa.Values.ToList();
 }
开发者ID:sergiosuarez,项目名称:Vulcano,代码行数:30,代码来源:FuenteSantaElena.cs

示例2: Valores

 public IList<ValoresFuente> Valores(Ciudad city, int limite, dynamic options = null)
 {
     var top = limite > 0 ? "top " + limite : "";
     var sql = "select " + top + " * from v_reporte order by clave, bloque, piso, numero_pisos";
     var str = ConfigurationManager.ConnectionStrings["latacunga"].ConnectionString;
     var conn = new SqlConnection(str);
     conn.Open();
     var lista = new List<ValoresFuente>();
     var reader = new SqlHelper(conn).ExecuteReader(sql);
     while (reader.Read()) {
         var temp = new ValoresFuente();
         Utils.FillDict(reader, temp);
         temp.Tipo = "construccion";
         temp.Codigo1 = temp.GetString("clave");
         var key = string.Format("{0}.{1}", temp["bloque"], temp["piso"]);
         temp.Codigo2 = key;
         temp.IdItem = temp["id"];
         lista.Add(temp);
     }
     reader.Close();
     conn.Close();
     return lista;
 }
开发者ID:sergiosuarez,项目名称:Vulcano,代码行数:23,代码来源:FuenteLatacunga.cs

示例3: Valores

 public IList<ValoresFuente> Valores(Ciudad city, int limite, dynamic options = null)
 {
     var top = limite > 0 ? "top " + limite : "";
     var sql = "select " + top + @" * from v_reporte v
     where manzana is not null
     order by predio_ID, num_edif, pisos, catalogo, categoria, valor_item";
     var str = ConfigurationManager.ConnectionStrings["intelligov"].ConnectionString;
     var conn = new SqlConnection(str);
     conn.Open();
     var reader = new SqlHelper(conn).ExecuteReader(sql);
     var mapa = new Dictionary<string, ValoresFuente>();
     while (reader.Read()) {
         var temp = new ValoresFuente();
         Utils.FillDict(reader, temp);
         var clave = temp.GetString("predio_codigo");
         var numero = temp.GetString("num_edif");
         var key = string.Format("{0}.{1}", clave, numero);
         if (!mapa.ContainsKey(key)) {
             temp.Tipo = "construccion";
             temp.Codigo1 = clave;
             temp.Codigo2 = numero;
             temp.IdItem = temp["predio_ID"];
             temp["clave"] = clave;
             ResolverBloque(temp, numero);
             temp.Remove("valor_item");
             mapa[key] = temp;
         }
         var cat = temp.GetString("categoria");
         var valor = temp.GetString("item_id", "").Trim();
         if (string.IsNullOrEmpty(valor))
             continue;
         if (mapa[key].ContainsKey(cat))
             mapa[key][cat] += "," + valor;
         else
             mapa[key][cat] = valor;
     }
     reader.Close();
     conn.Close();
     return mapa.Values.ToList();
 }
开发者ID:sergiosuarez,项目名称:Vulcano,代码行数:40,代码来源:FuenteSalitre.cs

示例4: Valores

 public IList<ValoresFuente> Valores(Ciudad city, int limite, dynamic options = null)
 {
     var sql = string.Format("select {0} * ", limite == 0 ? "" : "top " + limite);
     sql += " from v_predio where id_ciudad = @id order by clave, num_construccion";
     var str = ConfigurationManager.ConnectionStrings["riesgos"].ConnectionString;
     var conn = new SqlConnection(str);
     conn.Open();
     var mapa = new Dictionary<string, ValoresFuente>();
     var reader = new SqlHelper(conn).ExecuteReader(sql, new { id = city.Id });
     while (reader.Read()) {
         var temp = new ValoresFuente();
         temp.Tipo = "construccion";
         Utils.FillDict(reader, temp);
         var cod = temp.GetString("clave");
         var num = temp.GetString("num_construccion") ?? "0";
         var key = Utils.MakeKey(cod, num);
         if (!mapa.ContainsKey(key)) {
             temp.Codigo1 = cod;
             temp.Codigo2 = num;
             temp.IdItem = temp["id"];
             mapa[key] = temp;
         }
         var cat = temp.GetString("clave_dato");
         if (!string.IsNullOrEmpty(cat))
             mapa[key][cat] = temp.GetString("valor_texto");
         temp.Remove("clave_dato");
         temp.Remove("valor_texto");
     }
     reader.Close();
     conn.Close();
     return mapa.Values.ToList();
 }
开发者ID:sergiosuarez,项目名称:Vulcano,代码行数:32,代码来源:FuenteBasePredios.cs

示例5: Valores

        public IList<ValoresFuente> Valores(Ciudad city, int limite, dynamic options = null)
        {
            var top = limite > 0 ? "top " + limite : "";
            var sql = "select " + top + @" * from v_reporte
            where catalogo is not null
            order by zona,sector,manzana,solar, numero_edificacion, anio, area_construccion desc";

            var str = ConfigurationManager.ConnectionStrings["babahoyo"].ConnectionString;
            var conn = new SqlConnection(str);
            conn.Open();
            var mapa = new Dictionary<string, ValoresFuente>();
            var reader = new SqlHelper(conn).ExecuteReader(sql);
            while (reader.Read()) {
                var temp = new ValoresFuente();
                temp.Tipo = "construccion";
                Utils.FillDict(reader, temp);
                var cod = temp.GetString("codigo_predio");
                var num = temp.GetString("numero_edificacion");
                var key = Utils.MakeKey(cod, num);
                if (!mapa.ContainsKey(key)) {
                    var clave = ClaveCatastral(
                        temp["zona"], temp["sector"], temp["manzana"], temp["solar"]
                    );
                    temp["clave"] = clave;
                    temp.Codigo1 = clave;
                    temp.Codigo2 = temp.GetString("numero_edificacion");
                    temp.IdItem = temp["codigo_predio"];
                    mapa[key] = temp;
                }
                var cat = temp.GetString("catalogo");
                if (!string.IsNullOrEmpty(cat))
                    mapa[key][cat] = temp.GetString("valor_catalogo");
                temp.Remove("catalogo");
                temp.Remove("valor_catalogo");
            }
            reader.Close();
            conn.Close();
            return mapa.Values.ToList();
        }
开发者ID:sergiosuarez,项目名称:Vulcano,代码行数:39,代码来源:FuenteBabahoyo.cs


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