Esempio n. 1
0
    protected void bind_company(string mode)
    {
        //SubSonic.Query _q = new SubSonic.Query(Tables.NameAndAddressBook, "WWIProv").WHERE("CompanyID", Comparison.Equals, _pid);
        DAL.Logistics.NameAndAddressBookCollection _tbc = new DAL.Logistics.NameAndAddressBookCollection();

        if (mode != "Insert")
        {
            int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));
            //int _pid = wwi_func.vint(get_token("pid"));


            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook(_pid);
            _tbc.Add(_tbl);
        }
        else
        {
            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook();
            _tbc.Add(_tbl);
        }

        string[] _keys = { "CompanyID" };
        //IDataReader _dr = _q.ExecuteReader(); 
        this.fmvAddressBook.DataSource = _tbc; //_dr;
        this.fmvAddressBook.DataKeyNames = _keys;
        this.fmvAddressBook.DataBind();
        //_dr.Close(); 


    }
Esempio n. 2
0
    protected void bind_company(string mode)
    {
        //SubSonic.Query _q = new SubSonic.Query(Tables.NameAndAddressBook, "WWIProv").WHERE("CompanyID", Comparison.Equals, _pid);
        DAL.Logistics.NameAndAddressBookCollection _tbc = new DAL.Logistics.NameAndAddressBookCollection();

        if (mode != "Insert")
        {
            int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));
            //int _pid = wwi_func.vint(get_token("pid"));


            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook(_pid);
            _tbc.Add(_tbl);
        }
        else
        {
            DAL.Logistics.NameAndAddressBook _tbl = new DAL.Logistics.NameAndAddressBook();
            _tbc.Add(_tbl);
        }

        string[] _keys = { "CompanyID" };
        //IDataReader _dr = _q.ExecuteReader();
        this.fmvAddressBook.DataSource   = _tbc; //_dr;
        this.fmvAddressBook.DataKeyNames = _keys;
        this.fmvAddressBook.DataBind();
        //_dr.Close();
    }
        public NameAndAddressBookCollection FetchByQuery(Query qry)
        {
            NameAndAddressBookCollection coll = new NameAndAddressBookCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        public NameAndAddressBookCollection FetchAll()
        {
            NameAndAddressBookCollection coll = new NameAndAddressBookCollection();
            Query qry = new Query(NameAndAddressBook.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        public NameAndAddressBookCollection FetchByID(object CompanyID)
        {
            NameAndAddressBookCollection coll = new NameAndAddressBookCollection().Where("CompanyID", CompanyID).Load();

            return(coll);
        }