예제 #1
0
    protected void bind_order_titles()
    {
        //get order number from querystrings
        Int32 _orderno = wwi_func.vint(wwi_security.DecryptString(get_token("pno"), "publiship")); //999909; //Request.QueryString["pid"] != null ? wwi_func.vint(Request.QueryString["pid"].ToString()) : 0;

        //query item table
        SubSonic.Query _q  = new SubSonic.Query(DAL.Logistics.Tables.ItemTable, "WWIProv").WHERE("OrderNumber", Comparison.Equals, _orderno);
        DataSet        _ds = _q.ExecuteDataSet();

        this.dxgridTitles.KeyFieldName = "TitleID";
        this.dxgridTitles.DataSource   = _ds;
        this.dxgridTitles.DataBind();
    }
 /// </summary>
 /// <param name="companyID"></param>
 protected void bind_contacts(int companyid)
 {
     ASPxGridView _grid = (ASPxGridView)this.fmvAddressBook.FindControl("dxgridCompanyContacts");
     //ASPxGridView _grid = (ASPxGridView)this.dxpnlContacts.FindControl("dxgridCompanyContacts");
     if (_grid != null)
     {
         SubSonic.Query _q = new SubSonic.Query(Tables.ContactTable, "WWIProv").WHERE("CompanyID", Comparison.Equals, companyid);
         DataSet _ds = _q.ExecuteDataSet(); 
         //IDataReader _dr = _q.ExecuteReader(); can't use datareder it's a read only structure!
         _grid.KeyFieldName = "ContactID";
         _grid.DataSource = _ds;
         _grid.DataBind();
     }       
 }
예제 #3
0
    /// </summary>
    /// <param name="companyID"></param>
    protected void bind_contacts(int companyid)
    {
        ASPxGridView _grid = (ASPxGridView)this.fmvAddressBook.FindControl("dxgridCompanyContacts");

        //ASPxGridView _grid = (ASPxGridView)this.dxpnlContacts.FindControl("dxgridCompanyContacts");
        if (_grid != null)
        {
            SubSonic.Query _q  = new SubSonic.Query(Tables.ContactTable, "WWIProv").WHERE("CompanyID", Comparison.Equals, companyid);
            DataSet        _ds = _q.ExecuteDataSet();
            //IDataReader _dr = _q.ExecuteReader(); can't use datareder it's a read only structure!
            _grid.KeyFieldName = "ContactID";
            _grid.DataSource   = _ds;
            _grid.DataBind();
        }
    }
    protected void bind_gridview()
    {
        //string _orderno = wwi_security.DecryptString(get_token("pno"), "publiship");
        //CourierDetailsSubTableCollection _c = new CourierDetailsSubTableCollection().Where("OrderNumber", Comparison.Equals, _orderno);
        int _orderno = wwi_func.vint(wwi_security.DecryptString(get_token("pno"), "publiship")); //999909; //Request.QueryString["pid"] != null ? wwi_func.vint(Request.QueryString["pid"].ToString()) : 0;

        try
        {
            //query courier details table
            SubSonic.Query _q = new SubSonic.Query(Tables.CourierDetailsSubTable, "WWIProv").WHERE("OrderNumber", Comparison.Equals, _orderno);
            DataSet _ds = _q.ExecuteDataSet();

            this.dxgrdCourier.KeyFieldName = "CourierDetailID";
            this.dxgrdCourier.DataSource = _ds;
            this.dxgrdCourier.DataBind();
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text = string.Format("Order Number {0}. Error: {1}", _orderno, _ex);
            this.dxpnlErr.ClientVisible = true;
        }//end try
    }
    protected void bind_gridview()
    {
        //string _orderno = wwi_security.DecryptString(get_token("pno"), "publiship");
        //CourierDetailsSubTableCollection _c = new CourierDetailsSubTableCollection().Where("OrderNumber", Comparison.Equals, _orderno);
        int _orderno = wwi_func.vint(wwi_security.DecryptString(get_token("pno"), "publiship")); //999909; //Request.QueryString["pid"] != null ? wwi_func.vint(Request.QueryString["pid"].ToString()) : 0;

        try
        {
            //query courier details table
            SubSonic.Query _q  = new SubSonic.Query(Tables.CourierDetailsSubTable, "WWIProv").WHERE("OrderNumber", Comparison.Equals, _orderno);
            DataSet        _ds = _q.ExecuteDataSet();

            this.dxgrdCourier.KeyFieldName = "CourierDetailID";
            this.dxgrdCourier.DataSource   = _ds;
            this.dxgrdCourier.DataBind();
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text          = string.Format("Order Number {0}. Error: {1}", _orderno, _ex);
            this.dxpnlErr.ClientVisible = true;
        }//end try
    }
 protected void bind_order_titles()
 {
     //get order number from querystrings
     Int32 _orderno = wwi_func.vint(wwi_security.DecryptString(get_token("pno"),"publiship")); //999909; //Request.QueryString["pid"] != null ? wwi_func.vint(Request.QueryString["pid"].ToString()) : 0;
     
     //query item table
     SubSonic.Query _q = new SubSonic.Query(DAL.Logistics.Tables.ItemTable, "WWIProv").WHERE("OrderNumber", Comparison.Equals, _orderno);
     DataSet _ds = _q.ExecuteDataSet();
     this.dxgridTitles.KeyFieldName = "TitleID";
     this.dxgridTitles.DataSource = _ds;
     this.dxgridTitles.DataBind(); 
 }
    /// <summary>
    /// binding titles in child grid
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgridTitles_BeforePerformDataSelect(object sender, EventArgs e)
    {
        try
        {
            ASPxGridView _detail = (ASPxGridView)sender;
            String[] _keys = { "DeliveryID" };
            int _deliveryid = (int)_detail.GetMasterRowFieldValues(_keys);

            SubSonic.Query _q = new SubSonic.Query(DAL.Logistics.Tables.DeliverySubSubTable, "WWIProv").WHERE("DeliveryID", Comparison.Equals, _deliveryid);
            DataSet _ds = _q.ExecuteDataSet();
            _detail.KeyFieldName = "SubDeliveryID";
            _detail.DataSource = _ds;
            //DO NOT CALL DATABIND during BeforePerformDataSelect as it causes an infinite loop
            //_detail.DataBind();

            //deprecated we are binding in code behind
            //this.odsDeliveryTitles.SelectParameters["DeliveryID"].DefaultValue = _deliveryid.ToString();
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text = _ex;
            this.dxpnlErr.ClientVisible = true;
        }
        //end try
    }
    //end bind summary

    protected void bind_deliveries()
    {
        try
        {
            int _orderno = wwi_func.vint(wwi_security.DecryptString(get_token("pno"), "publiship"));
            //query delivefries table
            SubSonic.Query _q = new SubSonic.Query(DAL.Logistics.Tables.DeliverySubTable, "WWIProv").WHERE("OrderNumber", Comparison.Equals, _orderno);
            DataSet _ds = _q.ExecuteDataSet();
            this.dxgridDeliveries.KeyFieldName = "DeliveryID";
            this.dxgridDeliveries.DataSource = _ds;
            this.dxgridDeliveries.DataBind();
        }
        catch (Exception ex)
        {
            string _ex = ex.Message.ToString();
            this.dxlblErr.Text = _ex;
            this.dxpnlErr.ClientVisible = true;
        }
    }