/// <summary> /// 更新一条数据 /// </summary> public int Update(Model.SatelliteBand model) { StringBuilder strSql = new StringBuilder(); strSql.Append("UPDATE LHF.SATELLITE_SENSOR_BAND_MODE SET "); strSql.Append("SENSOR_NAME='" + model.SENSOR_NAME + "',"); strSql.Append("SAT_NAME='" + model.SAT_NAME + "',"); strSql.Append("SWATHWIDTH=" + model.SWATHWIDTH + ","); strSql.Append("INCLINATION='" + model.INCLINATION + "',"); strSql.Append("BAND_TYPE='" + model.BAND_TYPE + "',"); strSql.Append("SPECTRALRANGEMIN=" + model.SPECTRALRANGEMIN + ","); strSql.Append("SPECTRALRANGEMAX=" + model.SPECTRALRANGEMAX + ","); strSql.Append("POLARIZATION_MODE='" + model.POLARIZATION_MODE + "',"); strSql.Append("SPECTRALCENTER='" + model.SPECTRALCENTER + "',"); strSql.Append("BANDWIDTH='" + model.BANDWIDTH + "',"); strSql.Append("SPECTRALRESOLUTION='" + model.SPECTRALRESOLUTION + "',"); strSql.Append("ACROSSRESOLUTION=" + model.ACROSSRESOLUTION + ","); strSql.Append("ALONGRESOLUTION=" + model.ALONGRESOLUTION + ","); strSql.Append("VERTICALRESOLUTION='" + model.VERTICALRESOLUTION + "',"); strSql.Append("SNRRATIO='" + model.SNRRATIO + "',"); strSql.Append("SENSOR_ID=" + model.SENSOR_ID); strSql.Append(" WHERE BAND_MODE_NAME='" + model.BAND_MODE_NAME + "'"); strSql.Append(" AND SENSOR_ID=" + model.SENSOR_ID); strSql.Append(" AND SAT_ID=" + model.SAT_ID); return(DbHelperSQL.ExecuteSql(strSql.ToString())); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Model.SatelliteBand model) { StringBuilder strSql = new StringBuilder(); strSql.Append("INSERT INTO LHF.SATELLITE_SENSOR_BAND_MODE("); strSql.Append("BAND_MODE_NAME,SENSOR_NAME,SAT_ID,SAT_NAME,SWATHWIDTH,INCLINATION,BAND_TYPE,SPECTRALRANGEMIN,SPECTRALRANGEMAX,POLARIZATION_MODE,SPECTRALCENTER,BANDWIDTH,SPECTRALRESOLUTION,ACROSSRESOLUTION,ALONGRESOLUTION,VERTICALRESOLUTION,SNRRATIO,SENSOR_ID)"); strSql.Append(" VALUES ("); strSql.Append("'" + model.BAND_MODE_NAME + "','" + model.SENSOR_NAME + "'," + model.SAT_ID + ",'" + model.SAT_NAME + "'," + model.SWATHWIDTH + ",'" + model.INCLINATION + "','" + model.BAND_TYPE + "'," + model.SPECTRALRANGEMIN + "," + model.SPECTRALRANGEMAX + ",'" + model.POLARIZATION_MODE + "','" + model.SPECTRALCENTER + "','" + model.BANDWIDTH + "','" + model.SPECTRALRESOLUTION + "'," + model.ACROSSRESOLUTION + "," + model.ALONGRESOLUTION + ",'" + model.VERTICALRESOLUTION + "','" + model.SNRRATIO + "'," + model.SENSOR_ID + ")"); return(DbHelperSQL.ExecuteSql(strSql.ToString())); }
/// <summary> /// 由一行数据得到一个实体 /// </summary> private Model.SatelliteBand GetModel(DbDataReader dr) { Model.SatelliteBand model = new Model.SatelliteBand(); model.BAND_MODE_NAME = Convert.ToString(dr["BAND_MODE_NAME"]); model.SENSOR_NAME = Convert.ToString(dr["SENSOR_NAME"]); model.SAT_ID = Convert.ToDecimal(dr["SAT_ID"]); model.SAT_NAME = Convert.ToString(dr["SAT_NAME"]); model.SWATHWIDTH = Convert.ToDecimal(dr["SWATHWIDTH"]); model.INCLINATION = Convert.ToString(dr["INCLINATION"]); model.BAND_TYPE = Convert.ToString(dr["BAND_TYPE"]); model.SPECTRALRANGEMIN = Convert.ToDecimal(dr["SPECTRALRANGEMIN"]); model.SPECTRALRANGEMAX = Convert.ToDecimal(dr["SPECTRALRANGEMAX"]); model.POLARIZATION_MODE = Convert.ToString(dr["POLARIZATION_MODE"]); model.SPECTRALCENTER = Convert.ToString(dr["SPECTRALCENTER"]); model.BANDWIDTH = Convert.ToString(dr["BANDWIDTH"]); model.SPECTRALRESOLUTION = Convert.ToString(dr["SPECTRALRESOLUTION"]); model.ACROSSRESOLUTION = Convert.ToDecimal(dr["ACROSSRESOLUTION"]); model.ALONGRESOLUTION = Convert.ToDecimal(dr["ALONGRESOLUTION"]); model.VERTICALRESOLUTION = Convert.ToString(dr["VERTICALRESOLUTION"]); model.SNRRATIO = Convert.ToString(dr["SNRRATIO"]); model.SENSOR_ID = Convert.ToDecimal(dr["SENSOR_ID"]); return(model); }