Ejemplo n.º 1
0
    protected void bind_formview(string mode)
    {
        //have to use a collection as formview needs to bind to enumerable
        PlacesTableCollection _tbl = new PlacesTableCollection();

        if (mode != "Insert")
        {
            int         _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));
            PlacesTable _ct  = new PlacesTable(_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.PlaceName);
        }
        else
        {
            PlacesTable _ct = new PlacesTable();
            _tbl.Add(_ct);
        }

        this.fmvPlace.DataSource = _tbl;
        this.fmvPlace.DataBind();
    }
 public PlacesTableCollection FetchAll()
 {
     PlacesTableCollection coll = new PlacesTableCollection();
     Query qry = new Query(PlacesTable.Schema);
     coll.LoadAndCloseReader(qry.ExecuteReader());
     return coll;
 }
Ejemplo n.º 3
0
    protected void bind_formview(string mode)
    {
        //have to use a collection as formview needs to bind to enumerable
        PlacesTableCollection _tbl = new PlacesTableCollection();
        if (mode != "Insert")
        {
            int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));
            PlacesTable _ct = new PlacesTable(_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.PlaceName); 
        }
        else
        {
            PlacesTable _ct = new PlacesTable();
            _tbl.Add(_ct);
        }

        this.fmvPlace.DataSource = _tbl;
        this.fmvPlace.DataBind();
    }
 public PlacesTableCollection FetchByQuery(Query qry)
 {
     PlacesTableCollection coll = new PlacesTableCollection();
     coll.LoadAndCloseReader(qry.ExecuteReader()); 
     return coll;
 }
 public PlacesTableCollection FetchByID(object PlaceID)
 {
     PlacesTableCollection coll = new PlacesTableCollection().Where("PlaceID", PlaceID).Load();
     return coll;
 }