Exemplo n.º 1
0
 /// <summary>
 /// 由一行数据得到一个实体
 /// </summary>
 private Model.V_VolDisaInfo GetModel(DbDataReader dr)
 {
     Model.V_VolDisaInfo model = new Model.V_VolDisaInfo();
     model.RealName = DbHelperSQL.GetString(dr["RealName"]);
     model.Tel      = DbHelperSQL.GetString(dr["Tel"]);
     model.Type     = DbHelperSQL.GetString(dr["Type"]);
     model.Path     = DbHelperSQL.GetString(dr["Path"]);
     model.Time     = DbHelperSQL.GetString(dr["Time"]);
     model.LAT      = DbHelperSQL.GetDouble(dr["LAT"]);
     model.LON      = DbHelperSQL.GetDouble(dr["LON"]);
     model.Describe = DbHelperSQL.GetString(dr["Describe"]);
     model.DisaType = DbHelperSQL.GetString(dr["DisaType"]);
     model.ID       = DbHelperSQL.GetInt(dr["ID"]);
     return(model);
 }
Exemplo n.º 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.V_VolDisaInfo GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT * FROM V_VolDisaInfo ");
            strSql.Append(" WHERE ID=" + ID);
            Model.V_VolDisaInfo model = null;
            using (DbDataReader dr = DbHelperSQL.ExecuteReader(strSql.ToString()))
            {
                while (dr.Read())
                {
                    model = GetModel(dr);
                }
                return(model);
            }
        }