public override Models.DeviceDataArea GetModelByRow(System.Data.DataRow row) { try { DeviceDataArea DeviceDataArea = new DeviceDataArea() { AreaId = row["AreaId"].ToString(), MaxValue = double.Parse(row["MaxValue"].ToString()), MinValue = double.Parse(row["MinValue"].ToString()) }; return(DeviceDataArea); } catch { return(null); } }
public override Models.DeviceDataArea GetModel(string id) { DataTable table = new DataTable(); string sql = SelectSql + " and AreaId=@AreaId "; table = db.Query(sql, new OleDbParameter("@AreaId", id)).Tables[0]; if (table.Rows.Count > 0) { DeviceDataArea DeviceData = GetModelByRow(table.Rows[0]); return(DeviceData); } else { return(null); } }