コード例 #1
0
 /// <summary>
 /// Sets the form for weapon.
 /// </summary>
 /// <param name="objWeapons">The object weapons.</param>
 private void SetFormForWeapon(List <Weapon> objWeapons)
 {
     if (objWeapons.Count == 0)
     {
         SetFormForNoRecords(txtSearch.Text);
     }
     else if (objWeapons.Count == 1)
     {
         foreach (Weapon objWeapon in objWeapons)
         {
             //frmMain.gameNameSearchId = objGuideBook.EquipmentID;
             this.Close();
             DialogResult = DialogResult.OK;
         }
     }
     else
     {
         this.lblNoResults.Visible    = false;
         this.lvSearchResults.Visible = true;
         this.SetBounds(this.Left, this.Top, this.Width, 285);
         this.lvSearchResults.Columns.Add("ID");
         this.lvSearchResults.Columns.Add("Weapon Name");
         foreach (Weapon objWeapon in objWeapons)
         {
             //frmMain.gameNameSearchId = objGuideBook.EquipmentID;
             ListViewItem lvItem = Common.CreateListViewItem(objWeapon.WeaponID, objWeapon.WeaponName, true);
             this.lvSearchResults.Items.Add(lvItem);
         }
         Common.FormatListViewControlColumns(lvSearchResults);
     }
 }
コード例 #2
0
 /// <summary>
 /// Sets the form for character.
 /// </summary>
 /// <param name="objCharacters">The object characters.</param>
 private void SetFormForCharacter(List <Character> objCharacters)
 {
     if (objCharacters.Count == 0)
     {
         SetFormForNoRecords(txtSearch.Text);
     }
     else if (objCharacters.Count == 1)
     {
         foreach (Character objCharacter in objCharacters)
         {
             frmMain.objCurrentChar = objCharacter;
             this.Close();
             DialogResult = DialogResult.OK;
         }
     }
     else
     {
         this.lblNoResults.Visible    = false;
         this.lvSearchResults.Visible = true;
         this.SetBounds(this.Left, this.Top, this.Width, 285);
         this.lvSearchResults.Columns.Add("ID");
         this.lvSearchResults.Columns.Add("Character Name");
         foreach (Character objCharacter in objCharacters)
         {
             //frmMain.gameNameSearchId = objCharacter.CharacterID;
             ListViewItem lvItem = Common.CreateListViewItem(objCharacter.CharacterID, objCharacter.CharacterName, true);
             this.lvSearchResults.Items.Add(lvItem);
         }
         Common.FormatListViewControlColumns(lvSearchResults);
     }
 }
コード例 #3
0
        private void PopulateListView(string strType)
        {
            //Fill lvFeatTalentSkill with Feats
            lvFeatTalentSkill.Clear();
            this.lvFeatTalentSkill.Columns.Add("Description");


            switch (strType)
            {
            case "feats":

                //if (gprestigeRequirement.objRequiredFeats.Count > 0)
                if (gPrestigeClass.objPrestigeRequiredFeats.Count > 0)
                {
                    //foreach (Feat objFeat in gprestigeRequirement.objRequiredFeats)
                    foreach (Feat objFeat in gPrestigeClass.objPrestigeRequiredFeats)
                    {
                        //ListViewItem lvItem = Common.CreateListViewItem(objConditionTrack.Modifier, objConditionTrack.Description, true);
                        ListViewItem lvItem = Common.CreateListViewItem(objFeat.FeatID, objFeat.FeatName, false);
                        this.lvFeatTalentSkill.Items.Add(lvItem);
                    }
                }
                break;

            case "talents":
                //if (gprestigeRequirement.objRequiredTalents.Count > 0)
                if (gPrestigeClass.objPrestigeRequiredTalents.Count > 0)
                {
                    //foreach (Talent objTalent in gprestigeRequirement.objRequiredTalents)
                    foreach (Talent objTalent in gPrestigeClass.objPrestigeRequiredTalents)
                    {
                        //ListViewItem lvItem = Common.CreateListViewItem(objConditionTrack.Modifier, objConditionTrack.Description, true);
                        ListViewItem lvItem = Common.CreateListViewItem(objTalent.TalentID, objTalent.TalentName, false);
                        this.lvFeatTalentSkill.Items.Add(lvItem);
                    }
                }
                break;

            case "skills":
                //if (gprestigeRequirement.objRequiredSkills.Count > 0)
                if (gPrestigeClass.objPrestigeRequiredSkills.Count > 0)
                {
                    //foreach (Skill objSkill in gprestigeRequirement.objRequiredSkills)
                    foreach (Skill objSkill in gPrestigeClass.objPrestigeRequiredSkills)
                    {
                        //ListViewItem lvItem = Common.CreateListViewItem(objConditionTrack.Modifier, objConditionTrack.Description, true);
                        ListViewItem lvItem = Common.CreateListViewItem(objSkill.SkillID, objSkill.SkillName, false);
                        this.lvFeatTalentSkill.Items.Add(lvItem);
                    }
                }
                break;

            default:
                break;
            }


            Common.FormatListViewControlColumns(lvFeatTalentSkill);
        }
コード例 #4
0
        private void LoadClbSubSkill(string strWhere)
        {
            SubSkill subSkill = new SubSkill();
            //List<SubSkill> subSkills  = new List<SubSkill>();
            List <SubSkill> activeSubSkills = new List <SubSkill>();

            //subSkills = subSkill.GetSubSkills("", " SubSkillName ");
            activeSubSkills = subSkill.GetSubSkills(strWhere, " SubSkillName ");

            this.lvSubSkills.Columns.Add("ID");
            this.lvSubSkills.Columns.Add("Skill Name");
            this.lvSubSkills.Columns.Add("Skill Description");
            foreach (SubSkill objSubSkill in activeSubSkills)
            {
                //frmMain.gameNameSearchId = objGuideBook.EquipmentID;
                ListViewItem lvItem = Common.CreateListViewItem(objSubSkill.SkillID, objSubSkill.SubSkillName, objSubSkill.SubSkillDescription, true);
                this.lvSubSkills.Items.Add(lvItem);
            }
            Common.FormatListViewControlColumns(lvSubSkills);

            //foreach (SubSkill objSubSkill in subSkills)
            //{
            //    clbSubSkills.Items.Add(objSubSkill.SubSkillName );
            //}
            //CheckedListBox.CheckedItemCollection cilsubSkills;  // = CheckedListBox.CheckedItemCollection();

            //foreach (SubSkill objActiveSubSkills in activeSubSkills)
            //{
            //    //for (int i = 0; i < lvSearchResults.Columns.Count; i++)
            //    for (int i = 0; i < clbSubSkills.Items.Count ; i++)
            //    {
            //        if (clbSubSkills.Items[i].ToString() == objActiveSubSkills.SubSkillName )
            //        {
            //            clbSubSkills.SelectedValue = objActiveSubSkills.SubSkillName;
            //            //clbSubSkills. = clbSubSkills.Items[i].ToString();

            //        }
            //    }
            //}

            if (dbconn.Open)
            {
                dbconn.CloseDatabaseConnection();
            }
        }
コード例 #5
0
        /// <summary>
        /// Sets the form for feat.
        /// </summary>
        /// <param name="objFeats">The object feats.</param>
        private void SetFormForFeat(List <Feat> objFeats)
        {
            if (objFeats.Count == 0)
            {
                SetFormForNoRecords(txtSearch.Text);
            }
            else if (objFeats.Count == 1)
            {
                foreach (Feat objFeat in objFeats)
                {
                    //frmMain.gameNameSearchId = objFeat.FeatID;
                    //frmMain.intSearchID = objFeat.FeatID;
                    switch (_frmCallingForm.Name.ToString())
                    {
                    case "frmMain":
                        frmMain.intSearchID = objFeat.FeatID;
                        break;

                    case "frmFeat":
                        frmFeat.intSearchID = objFeat.FeatID;
                        break;
                    }
                    this.Close();
                    DialogResult = DialogResult.OK;
                }
            }
            else
            {
                this.lblNoResults.Visible    = false;
                this.lvSearchResults.Visible = true;
                this.SetBounds(this.Left, this.Top, this.Width, 285);
                this.lvSearchResults.Columns.Add("ID");
                this.lvSearchResults.Columns.Add("Feat Name");
                foreach (Feat objFeat in objFeats)
                {
                    //frmMain.gameNameSearchId = objFeat.FeatID;
                    ListViewItem lvItem = Common.CreateListViewItem(objFeat.FeatID, objFeat.FeatName, true);
                    this.lvSearchResults.Items.Add(lvItem);
                }
                Common.FormatListViewControlColumns(lvSearchResults);
            }
        }
コード例 #6
0
        /// <summary>
        /// Sets the form for armor.
        /// </summary>
        /// <param name="objArmors">The object armors.</param>
        private void SetFormForArmor(List <Armor> objArmors)
        {
            if (objArmors.Count == 0)
            {
                SetFormForNoRecords(txtSearch.Text);
            }
            else if (objArmors.Count == 1)
            {
                foreach (Armor objArmor in objArmors)
                {
                    //Whatever form called this we need to set the armor id there
                    //frmMain.intSearchID = objArmor.ArmorID;
                    switch (_frmCallingForm.Name.ToString())
                    {
                    case "frmMain":
                        frmMain.intSearchID = objArmor.ArmorID;
                        break;

                    case "frmArmor":
                        frmArmor.intSearchID = objArmor.ArmorID;
                        break;
                    }
                    this.Close();
                    DialogResult = DialogResult.OK;
                }
            }
            else
            {
                this.lblNoResults.Visible    = false;
                this.lvSearchResults.Visible = true;
                this.SetBounds(this.Left, this.Top, this.Width, 285);
                this.lvSearchResults.Columns.Add("Armor ID");
                this.lvSearchResults.Columns.Add("Armor Name");
                foreach (Armor objArmor in objArmors)
                {
                    //frmMain.gameNameSearchId = objArmor.ArmorID;
                    ListViewItem lvItem = Common.CreateListViewItem(objArmor.ArmorID, objArmor.ArmorName, true);
                    this.lvSearchResults.Items.Add(lvItem);
                }
                Common.FormatListViewControlColumns(lvSearchResults);
            }
        }
コード例 #7
0
        /// <summary>
        /// Sets the form for skill.
        /// </summary>
        /// <param name="objSkills">The object skills.</param>
        private void SetFormForSkill(List <Skill> objSkills)
        {
            if (objSkills.Count == 0)
            {
                SetFormForNoRecords(txtSearch.Text);
            }
            else if (objSkills.Count == 1)
            {
                foreach (Skill objSkill in objSkills)
                {
                    switch (_frmCallingForm.Name.ToString())
                    {
                    case "frmMain":
                        frmMain.intSearchID = objSkill.SkillID;
                        break;

                    case "frmSkill":
                        frmEquipment.intSearchID = objSkill.SkillID;
                        break;
                    }
                    this.Close();
                    DialogResult = DialogResult.OK;
                }
            }
            else
            {
                this.lblNoResults.Visible    = false;
                this.lvSearchResults.Visible = true;
                this.SetBounds(this.Left, this.Top, this.Width, 285);
                this.lvSearchResults.Columns.Add("ID");
                this.lvSearchResults.Columns.Add("Skill Name");
                foreach (Skill objSkill in objSkills)
                {
                    //frmMain.gameNameSearchId = objGuideBook.EquipmentID;
                    ListViewItem lvItem = Common.CreateListViewItem(objSkill.SkillID, objSkill.SkillName, true);
                    this.lvSearchResults.Items.Add(lvItem);
                }
                Common.FormatListViewControlColumns(lvSearchResults);
            }
        }