Ejemplo n.º 1
0
        private void btnJoin_Click(object sender, EventArgs e)
        {
            bool     bExists;
            hostChar me = bs_nwChar.Current as hostChar;

            if (me == null)
            {
                return;
            }

            IList <nwdbDataType> campaigns = sess.QueryOver <campCampaign>().List <nwdbDataType>();

            campaigns = FrmSelectsysDataType.Select(campaigns, "Select campaign", this);
            foreach (campCampaign camp in campaigns)
            {
                Debug.Print("Selected" + camp.ToString());
                bExists = false;
                foreach (campCharCampaign c in bs_nwCharCampaign.List)
                {
                    if (c.Campaign == camp)
                    {
                        SetMessage("Skipping " + campaigns.ToString() + "Already a participant");
                        bExists = true;
                    }
                }

                if (!bExists)
                {
                    // add as doesnt exists
                    campCharCampaign newc = new campCharCampaign(camp, me, false);
                    camp.Characters.Add(newc);
                    SetMessage("Applied to join :" + camp.ToString());
                }
            }
        }
Ejemplo n.º 2
0
        private void nwCharCampaignBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            campCharCampaign camp = bs_nwCharCampaign.Current as campCharCampaign;

            if (camp != null)
            {
                bs_hostCampaign.DataSource = camp.Campaign;
            }
        }