public Structure.RF_ANTCURRENT GetEachGate(string FAB, string AREA, string GATE) { try { Structure.RF_ANTCURRENT result = new Structure.RF_ANTCURRENT(); OracleDB dbObj = new OracleDB("RFID_DB"); string sqlString = @"select t.fab, t.area, t.gate, t.container_id, t.cartype, t1.readerip, t.updatetime, t.manualmode from rf_antcurrent t, rf_antmapping t1 where t.fab = t1.fab and t.area = t1.area and t.gate = t1.gate and t.fab = '{0}' and t.area = '{1}' and t.gate = '{2}' and t1.type = 'CT'"; sqlString = String.Format(sqlString, FAB, AREA, GATE); DataTable rt = dbObj.SelectSQL(sqlString); foreach (DataRow eachRow in rt.Rows) { result.FAB = eachRow["FAB"].ToString(); result.AREA = eachRow["AREA"].ToString(); result.GATE = eachRow["GATE"].ToString(); result.CONTAINER_ID = eachRow["CONTAINER_ID"].ToString(); result.CAR_TYPE = eachRow["cartype"].ToString(); result.READER_IP = eachRow["readerip"].ToString(); result.UPDATETIME = eachRow["UPDATETIME"].ToString(); result.MANUALMODE = Boolean.Parse(eachRow["MANUALMODE"].ToString()); } return(result); } catch (Exception e) { throw e; } }
public List <Structure.RF_ANTCURRENT> GetGateStatus() { try { List <Structure.RF_ANTCURRENT> GateStatusList = new List <Structure.RF_ANTCURRENT>(); OracleDB dbObj = new OracleDB("RFID_DB"); string sqlString = @"select t.fab,t.area,t.gate,t1.container_id,t1.cartype,t.readerip,t1.updatetime,t1.manualmode from rf_antmapping t, rf_antcurrent t1 where t.type = 'CT' and t.antnumber < 5 and t.fab = t1.fab(+) and t.area = t1.area(+) and t.gate = t1.gate(+) order by t.fab,t.area,t.gate"; DataTable result = dbObj.SelectSQL(sqlString); foreach (DataRow eachRow in result.Rows) { Structure.RF_ANTCURRENT eachObj = new Structure.RF_ANTCURRENT(); eachObj.FAB = eachRow["FAB"].ToString(); eachObj.AREA = eachRow["AREA"].ToString(); eachObj.GATE = eachRow["GATE"].ToString(); eachObj.CONTAINER_ID = eachRow["CONTAINER_ID"].ToString(); eachObj.CAR_TYPE = eachRow["cartype"].ToString(); eachObj.READER_IP = eachRow["readerip"].ToString(); eachObj.UPDATETIME = eachRow["UPDATETIME"].ToString(); eachObj.MANUALMODE = Boolean.Parse(eachRow["MANUALMODE"].ToString()); GateStatusList.Add(eachObj); } return(GateStatusList); } catch (Exception e) { throw e; } }