Beispiel #1
0
 /// <summary>
 /// 由一行数据得到一个实体
 /// </summary>
 private Model.UAVTeam GetModel(DbDataReader dr)
 {
     Model.UAVTeam model = new Model.UAVTeam();
     model.ID           = DbHelperSQL.GetInt(dr["ID"]);
     model.ManagerName  = DbHelperSQL.GetString(dr["ManagerName"]);
     model.CompanyName  = DbHelperSQL.GetString(dr["CompanyName"]);
     model.TeamName     = DbHelperSQL.GetString(dr["TeamName"]);
     model.CountNumber  = DbHelperSQL.GetInt(dr["CountNumber"]);
     model.UAVModel     = DbHelperSQL.GetString(dr["UAVModel"]);
     model.XLongtitude  = DbHelperSQL.GetDouble(dr["XLongtitude"]);
     model.YLatitude    = DbHelperSQL.GetDouble(dr["YLatitude"]);
     model.UpdateTime   = DbHelperSQL.GetDateTime(dr["UpdateTime"]);
     model.MobileNumber = DbHelperSQL.GetString(dr["MobileNumber"]);
     return(model);
 }
Beispiel #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.UAVTeam GetModel(int ID)
        {
            StringBuilder strSql = new StringBuilder();

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