protected virtual void UpdateItemPath()
        {
            nwItem item = bs_nwItem.Current as nwItem;

            if (item.ItemType == null)
            {
                lblItemType.Text = "UNASSIGNED";
            }
            else
            {
                lblItemType.Text = item.ItemType.Path(" \\ ");
            }
        }
示例#2
0
        public void nwChar_CreateOwnedItem()
        {
            hostChar c  = new hostChar("God", "God is a DJ", null);
            nwItem   i1 = new nwItem("+1 dagger", "+1 Dagger");
            nwItem   i2 = new nwItem("+1 dagger", "+4 LongBow");

            i2.Description = "This is a mega bow created by the elven lords";
            c.Items.Add(i1);
            c.Items.Add(i2);
            repo.Add(c);


            //now delete
            repo.Delete(c);
        }
        private void btnSetItem_Click(object sender, EventArgs e)
        {
            string typedesc;
            nwItem item = bs_nwItem.Current as nwItem;

            if (item.ItemType == null)
            {
                typedesc = "NULL";
            }
            else
            {
                typedesc = item.ItemType.Path("\\");
            }

            SetMessage("Calling Set Item for item:" + item.Name + " Current: Type" + typedesc);
            sysTreeItemType selected = stm.Select <sysTreeItemType>(sess, item.ItemType) as sysTreeItemType;

            if (selected != item.ItemType)
            {
                item.ItemType = selected;
            }
            UpdateItemPath();
        }
        private void btnItemRemove_Click(object sender, EventArgs e)
        {
            nwItem i = bs_nwItem.Current as nwItem;

            bs_nwItem.Remove(i);
        }
        public virtual bool SeedMockData()
        {
            //NEW FEDERATED Initialisations

            //libMapping Create Base;
            this.CreateLibMapping();

            //libHosting Create Base
            this.CreateLibHosting();

            //libRuleSet Create Base
            this.CreateLibRuleset();

            //libRuleSet Create Base
            this.CreateLibCampaign();


            try
            {
                //Seed Characters
                hostUser steve = this.Find((typeof(hostUser)), "unclemessy") as hostUser;
                hostUser lewis = this.Find((typeof(hostUser)), "lewis") as hostUser;
                hostUser matt  = this.Find((typeof(hostUser)), "matsly") as hostUser;

                if (FindIDByLongName(typeof(hostChar), "Messy da Anti Hero") == 0)
                {
                    hostChar c = new hostChar("Messy", "Messy da Anti Hero", steve);
                    c.RefreshCharacterStats(i);

                    //Chuck in some items
                    nwItem i1 = new nwItem("+1 Dagger", "+1 Dagger");
                    i1.Owner = c;
                    c.Items.Add(i1);
                    nwItem i2 = new nwItem("+4 LongBow", "+4 LongBow");
                    i2.Description = "This is a mega bow created by the elven lords";
                    i2.Owner       = c;
                    c.Items.Add(i2);
                    Add(c);

                    //i.SaveOrUpdate(new campCharCampaign(traitPBEM, c, false));
                    //traitPBEM.Characters.Add(c);
                    //i.SaveOrUpdate(c);
                }
                if (FindIDByLongName(typeof(hostChar), "Sabbath") == 0)
                {
                    hostChar c = new hostChar("Sabbath", "Sabbath", matt);
                    c.RefreshCharacterStats(i);

                    //Chuck in some items
                    nwItem i1 = new nwItem("+5 Vorpal", "+5 Vorpal Sword");
                    i1.Owner = c;
                    c.Items.Add(i1);
                    Add(c);
                }

                if (FindIDByLongName(typeof(hostChar), "Muttley") == 0)
                {
                    hostChar c = new hostChar("Muttley", "Muttley", lewis);
                    c.RefreshCharacterStats(i);
                    this.Add(c);
                    //i.SaveOrUpdate(new campCharCampaign(traitPBEM, c, false));
                    //i.SaveOrUpdate(c);
                }


                this.Save(steve);
                this.Save(matt);
                //this.Save(traitPBEM);


                return(true);
            }
            catch (GenericADOException ex)
            {
                var sql = ex.InnerException as SqlException;
                if (sql != null)
                {
                    Debug.Print("Caught GenericADO:" + ex.ToString());
                    Debug.Print("Caught Inner:" + sql.ToString());
                    Debug.Print("SQL ErrorNumber:" + sql.Number.ToString());
                    throw;
                }
                return(false);
            }
        }