public frmCardExchange(frmMain me) : this()
    {
        this.mdiParent = me;
        serverName     = me.getServerName;
        databaseName   = me.getDatabaseName;
        connectStr     = me.getConnectString;

        myData         = new clsFriend();                       // Number of friends in DB
        countOfFriends = myData.RecordCount(connectStr);


        myExchange       = new clsCardsExchanged(connectStr);   // Number of cards in DB
        countOfExchanges = myExchange.RecordCount(connectStr);

        myTypes          = new clsCardTypes(connectStr);        // Number of card types...
        countOfCardTypes = myTypes.GetCardTypesCount();

        myExchange.PopulateListboxWithCardTypes(myList);        // ...displayed in combo box
        for (int i = 0; i < myList.Count; i++)
        {
            cmbList.Items.Add(myList[i]);
        }
        cmbList.SelectedIndex = 0;
        txtFindRecordNumber.Focus();
    }
Ejemplo n.º 2
0
    public frmCardReport(frmMain me) : this()
    {
        int    index;
        int    i;
        string temp;

        this.mdiParent = me;
        serverName     = me.getServerName;
        databaseName   = me.getDatabaseName;
        connectStr     = me.getConnectString;

        myData = new clsFriend();
        myData.PopulatListWithFriend(myFriends, connectStr);
        for (i = 0; i < myFriends.Count; i++)
        {
            temp         = myFriends[i].ToString();
            index        = temp.IndexOf(' ');
            myFriends[i] = temp.Substring(index + 1);
            cmbLastName.Items.Add(myFriends[i]);
        }
        cmbLastName.SelectedIndex = 0;

        myExchange       = new clsCardsExchanged(connectStr);   // num of cards
        countOfExchanges = myExchange.RecordCount(connectStr);

        myTypes          = new clsCardTypes(connectStr);
        countOfCardTypes = myTypes.GetCardTypesCount();

        myExchange.PopulateListboxWithCardTypes(myCardList);
        for (i = 0; i < myCardList.Count; i++)
        {
            temp = myCardList[i].ToString();

            index         = temp.IndexOf(' ');
            myCardList[i] = temp.Substring(index + 3);
            cmbList.Items.Add(myCardList[i]);
        }
        cmbList.SelectedIndex = 0;
        rbAll.Checked         = true;

        cmbLastName.Enabled = false;
        cmbList.Enabled     = false;
        txtDate.Enabled     = false;
    }