Ejemplo n.º 1
0
    /// <summary>
    /// Function to load the customer details
    /// </summary>
    public void LoadCustomerDetails()
    {
        txtCustNo.Text = hidCust.Value.Trim();

        #region Code to fill the customer details in the controls

        // Call the webservice to get the customer address detail
        DataSet dsCustomer = service.GetCustomerDetails(txtCustNo.Text.Trim().Replace("'", ""));
        DataSet dsShipTo   = service.GetShipToDetails(txtCustNo.Text);

        // Function to clear the value in the label
        ClearLabels();

        if (dsCustomer != null && dsCustomer.Tables[0].Rows.Count != 0)
        {
            Session["CustNo"]         = hidCust.Value.Trim();
            Session["CustomerDetail"] = dsCustomer.Tables[0];
            FillCustomerAddress(dsCustomer.Tables[0]);

            // Code to bind the location details
            DataSet dsLocation = custDet.GetLocationDetails();
        }
        else
        {
            hidCust.Value             = txtCustNo.Text = "";
            Session["CustNo"]         = null;
            Session["CustomerDetail"] = null;
            Session["ShipDetails"]    = null;
            return;
        }

        if (dsShipTo != null && dsShipTo.Tables[0].Rows.Count != 0)
        {
            Session["ShipDetails"] = dsShipTo.Tables[0];

            // Call the function to fill the ship to details
            FillShipTo(dsShipTo.Tables[0]);
        }
        #endregion
    }