Ejemplo n.º 1
0
        // fetch all rows from the SOAP layer and populate the ComboBox with it
        // links:
        //  docLink: http://sql2x.org/documentationLink/4ccfdfd8-9986-4cfe-8743-e0bcde887284
        public void PopulateCombo()
        {
            if (!DesignMode && cboRef.DataSource == null)
            {
                CrudeBookingIdentifierTypeRefServiceClient bookingIdentifierTypeRef = null;

                try {
                    bookingIdentifierTypeRef = new CrudeBookingIdentifierTypeRefServiceClient();
                    List <CrudeBookingIdentifierTypeRefContract> contracts = bookingIdentifierTypeRef.FetchAll();

                    cboRef.DataSource    = contracts;
                    cboRef.DisplayMember = "BookingIdentifierTypeName";
                    cboRef.ValueMember   = "BookingIdentifierTypeRcd";
                } catch (Exception ex) {
                    if (ex != null)
                    {
                    }
                } finally {
                    if (bookingIdentifierTypeRef != null)
                    {
                        bookingIdentifierTypeRef.Close();
                    }
                }
            }
        }