Esempio n. 1
0
        public List <PumpListRecord> GetAllPump(long stationid)
        {
            List <PumpListRecord> _list  = new List <PumpListRecord>();
            DataTable             dtPump = BusinessHelper.ListAllPump((long)stationid);

            foreach (DataRow _row in dtPump.Rows)
            {
                PumpListRecord plrec = new PumpListRecord();
                plrec.StationId     = stationid;
                plrec.PumpId        = Convert.ToInt64(_row["pumpid"]);
                plrec.TankId        = Convert.ToInt64(_row["tankid"]);
                plrec.PumpIp        = _row["ipaddress"].ToString();
                plrec.PumpName      = _row["name"].ToString();
                plrec.PumpPort      = Convert.ToInt32(_row["port"]);
                plrec.PumpDelayTime = Convert.ToInt32(_row["delaytime"]);
                plrec.PumpDesc      = _row["description"].ToString();
                plrec.PumpStatus    = Convert.ToInt16(_row["status"]);
                if (!_row.IsNull("pickuptimes"))
                {
                    plrec.PumpPickUp = Convert.ToInt64(_row["pickuptimes"]);
                }
                _list.Add(plrec);
            }

            return(_list);
        }
Esempio n. 2
0
        public void UpdatePump(PumpListRecord record)
        {
            long retId = record.PumpId;

            BusinessHelper.InserUpdatePump(ref retId, record.TankId, record.PumpName, record.PumpIp, record.PumpPort, record.PumpDelayTime, record.PumpDesc, record.PumpStatus);
            if (retId != -1)
            {
                record.PumpId = retId;
            }
        }
Esempio n. 3
0
 public void DeletePump(PumpListRecord record)
 {
     BusinessHelper.DeletePump(record.PumpId);
 }