コード例 #1
0
    protected void bind_formview(string mode)
    {
        //have to use a collection as formview needs to bind to enumerable
        EmployeesTableCollection _tbl = new EmployeesTableCollection();

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

            EmployeesTable _ct = new EmployeesTable(_pid);
            _tbl.Add(_ct);

            //store original value for name so we can check against database when saving
            if (this.dxhfOrder.Contains("oldvalue"))
            {
                this.dxhfOrder.Remove("oldvalue");
            }
            this.dxhfOrder.Add("oldvalue", _ct.Name);
        }
        else
        {
            EmployeesTable _ct = new EmployeesTable();
            _tbl.Add(_ct);
        }

        this.fmvEmployee.DataSource = _tbl;
        this.fmvEmployee.DataBind();
    }
コード例 #2
0
    protected void bind_formview(string mode)
    {
        //have to use a collection as formview needs to bind to enumerable
        EmployeesTableCollection _tbl = new EmployeesTableCollection();
        if (mode != "Insert")
        {
            int _pid = wwi_func.vint(wwi_security.DecryptString(get_token("pid").ToString(), "publiship"));

            EmployeesTable _ct = new EmployeesTable(_pid);
            _tbl.Add(_ct);

            //store original value for name so we can check against database when saving
            if (this.dxhfOrder.Contains("oldvalue")) { this.dxhfOrder.Remove("oldvalue"); }
            this.dxhfOrder.Add("oldvalue", _ct.Name); 
        }
        else
        {
            EmployeesTable _ct = new EmployeesTable();
            _tbl.Add(_ct);

           
        }

        this.fmvEmployee.DataSource = _tbl;
        this.fmvEmployee.DataBind();
    }