protected void bind_formview(string mode) { //have to use a collection as formview needs to bind to enumerable PortTableCollection _tbl = new PortTableCollection(); if (mode != "Insert") { int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship")); PortTable _ct = new PortTable(_pid); _tbl.Add(_ct); //store original value for country name so we can check against database when saving if (this.dxhfOrder.Contains("oldvalue")) { this.dxhfOrder.Remove("oldvalue"); } this.dxhfOrder.Add("oldvalue", _ct.PortName); } else { PortTable _ct = new PortTable(); _tbl.Add(_ct); } this.fmvPort.DataSource = _tbl; this.fmvPort.DataBind(); }
public PortTableCollection FetchAll() { PortTableCollection coll = new PortTableCollection(); Query qry = new Query(PortTable.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public PortTableCollection FetchByQuery(Query qry) { PortTableCollection coll = new PortTableCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public PortTableCollection FetchByID(object PortID) { PortTableCollection coll = new PortTableCollection().Where("PortID", PortID).Load(); return coll; }