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());
                }
            }
        }
Exemple #2
0
        public static IList <nwdbDataType> Select(IList <nwdbDataType> i, string caption, Form sender)
        {
            FrmSelectsysDataType frmSelect = new FrmSelectsysDataType();

            frmSelect.List  = i;
            frmSelect.Title = caption;
            frmSelect.ShowDialog(sender);
            i = frmSelect.List;
            frmSelect.Dispose();
            return(i);
        }