Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Tent tent)
        {
            if (id != tent.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tent);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TentExists(tent.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tent));
        }
 public vm_tent(GmmDbContext pContext)
 {
     _context = pContext;
     _tent    = new Tent {
         Id = 0
     };
 }
Beispiel #3
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            View v = convertView;

            if (v == null)
            {
                LayoutInflater vi = (LayoutInflater)this.Context.GetSystemService(Context.LayoutInflaterService);
                v = vi.Inflate(Resource.Layout.list_item, null);
            }
            Tent tent = _tents[position];

            if (tent != null)
            {
                TextView tt = v.FindViewById <TextView>(Resource.Id.toptext);
                TextView bt = v.FindViewById <TextView>(Resource.Id.bottomtext);

                if (tt != null)
                {
                    tt.Text = tent.Name;
                }

                if (bt != null)
                {
                    bt.Text = tent.Brewery;
                }
            }

            return(v);
        }
Beispiel #4
0
    public void SetCamp(bool state)
    {
        if (state)
        {
            hasCamp = true;

            if (Tent.Status == TentStatus.Fireplace || Tent.Status == TentStatus.NaturalShelter)
            {
                if (Tent.Status == TentStatus.Fireplace && myCard.IsNaturalCamp())
                {
                    Tent.ChangeTentSatus(TentStatus.NaturalShelter);
                }
                if (Tent.Status == TentStatus.NaturalShelter && !myCard.IsNaturalCamp())
                {
                    Tent.ChangeTentSatus(TentStatus.Fireplace);
                }

                campPlaceholder.GetComponent <MeshRenderer>().material = camp_Fireplace;
            }
            else
            {
                campPlaceholder.GetComponent <MeshRenderer>().material = camp_Tent;
            }
        }
        else
        {
            hasCamp = false;
            campPlaceholder.GetComponent <MeshRenderer>().material = camp_empty;
        }
    }
Beispiel #5
0
            public bool TestUse(Tent obj)
            {
                if (!TestRepaired(obj))
                {
                    return(false);
                }

                if (obj.UseCount > 0)
                {
                    return(false);
                }

                if (obj.NumberOfSpots() < 2)
                {
                    return(false);
                }

                if (!obj.Placed)
                {
                    return(false);
                }

                if (!obj.InWorld)
                {
                    return(false);
                }

                return(true);
            }
        public void MakeTents()
        {
            TopTent    = new Tent();
            MiddleTent = new Tent();
            BottomTent = new Tent();

            for (var wordIndex = 0; wordIndex < Words.Count; wordIndex++)
            {
                string word = Words[wordIndex];
                for (var letterIndex = 0; letterIndex < word.Length; letterIndex++)
                {
                    char    realLetter     = word[letterIndex];
                    Pattern currentPattern = RandomlyDeterminePattern();
                    char    fakeLetter     = RandomlyDetermineFakeLetter();
                    if (2 <= wordIndex)
                    {
                        fakeLetter = FlipLetter(fakeLetter);
                    }
                    TopTent.ApplyPattern(wordIndex, letterIndex, realLetter, fakeLetter, currentPattern.Top);
                    MiddleTent.ApplyPattern(wordIndex, letterIndex, realLetter, fakeLetter, currentPattern.Middle);
                    BottomTent.ApplyPattern(wordIndex, letterIndex, realLetter, fakeLetter, currentPattern.Bottom);
                }
            }

            if (string.IsNullOrWhiteSpace(TentConfiguration))
            {
                TentConfiguration = GenerateRandomTentConfiguration();
            }
        }
        ///<inheritdoc/>
        public override int GetHashCode()
        {
            int hash = 17;

            // Overflow is fine, just wrap
            unchecked
            {
                hash = (hash * 29) + PaintScheme.GetHashCode();
                hash = (hash * 29) + Mobility.GetHashCode();
                hash = (hash * 29) + Mission.GetHashCode();
                hash = (hash * 29) + Damage.GetHashCode();
                hash = (hash * 29) + Smoke.GetHashCode();
                hash = (hash * 29) + TrailingEffects.GetHashCode();
                hash = (hash * 29) + Lights.GetHashCode();
                hash = (hash * 29) + Flaming.GetHashCode();
                hash = (hash * 29) + Antenna.GetHashCode();
                hash = (hash * 29) + CamouflageType.GetHashCode();
                hash = (hash * 29) + Concealed.GetHashCode();
                hash = (hash * 29) + FrozenStatus.GetHashCode();
                hash = (hash * 29) + PowerPlantStatus.GetHashCode();
                hash = (hash * 29) + State.GetHashCode();
                hash = (hash * 29) + Tent.GetHashCode();
                hash = (hash * 29) + BlackoutLights.GetHashCode();
                hash = (hash * 29) + InteriorLights.GetHashCode();
            }

            return(hash);
        }
        private static void AppendLettersFromTentFront(Tent firstTent, int i, StringBuilder lineBuilder)
        {
            var leftLetterOnFirstTent  = firstTent.WordsOnTent[0][i];
            var rightLetterOnFirstTent = firstTent.WordsOnTent[1][i];

            lineBuilder.Append(leftLetterOnFirstTent);
            lineBuilder.Append(rightLetterOnFirstTent);
        }
        private static void AppendLettersFromTentBack(Tent tent, int i, StringBuilder lineBuilder)
        {
            var leftLetterFirstTent  = tent.WordsOnTent[3][i];
            var rightLetterFirstTent = tent.WordsOnTent[2][i];

            lineBuilder.Append(leftLetterFirstTent);
            lineBuilder.Append(rightLetterFirstTent);
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Tent tent = db.Tents.Find(id);

            db.Tents.Remove(tent);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        private World()
        {
            // Set tent
            Tent tent = new Tent(new Vector2D(280, 180));

            staticEntities.Add(tent);

            populate();
        }
Beispiel #12
0
 public void RestartGame()
 {
     PlayerIndex.Clear();
     MobIndex.Clear();
     DropIndex.Clear();
     FallingBlockIndex.Clear();
     RedTent  = new Tent(true, Vector2.Zero, false, false);
     BlueTent = new Tent(false, Vector2.Zero, false, false);
 }
 protected void BuildingTent()
 {
     if (Channeling(ItemList.Tent, PlayerActions.BuildTent) == PlayerActions.BuildTent)
     {
         Tent ai = (Tent)(this.GetPlayerData().GetInventory()[Global.ItemNames[ItemList.Tent]]);
         Debug.Log(ai.prefab);
         ai.BuildStructure(ItemList.Tent, this.GetPlayerData());
     }
 }
Beispiel #14
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Tent tent)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tent);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tent));
        }
        // GET: Tents/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tent tent = db.Tents.Find(id);

            if (tent == null)
            {
                return(HttpNotFound());
            }
            return(View(tent));
        }
Beispiel #16
0
 public World()
 {
     PlayerIndex       = new ConcurrentDictionary <int, Player>();
     MobIndex          = new ConcurrentDictionary <int, Mob>();
     DropIndex         = new ConcurrentDictionary <int, ItemDrop>();
     FallingBlockIndex = new ConcurrentDictionary <int, FallingBlock>();
     WorldMap          = new ServerMap();
     TimeRemaining     = new Interval();
     TimeRemaining.Start(DEFAULT_TIME_REMAINING);
     RestartInterval = new Interval();
     ServerMode      = GameMode.CaptureTheFlag;
     RedTent         = new Tent(true, WorldMap.RedTentPosition, ServerMode == GameMode.CaptureTheFlag, true);
     BlueTent        = new Tent(false, WorldMap.BlueTentPosition, ServerMode == GameMode.CaptureTheFlag, true);
 }
Beispiel #17
0
    public new static Inn Load(BinaryReader reader)
    {
        InnType subType = (InnType)reader.ReadInt32();
        Inn     ret     = null;

        switch (subType)
        {
        case InnType.TENT:
            ret = Tent.Load(reader);
            break;
        }
        ret.subType = subType;
        return(ret);
    }
Beispiel #18
0
 public void RestartGame()
 {
     foreach (KeyValuePair <int, Player> entry in PlayerIndex.ToArray())
     {
         entry.Value.Restart();
     }
     MobIndex.Clear();
     DropIndex.Clear();
     FallingBlockIndex.Clear();
     WorldMap.InitLevelFromRotation();
     TimeRemaining.Start(DEFAULT_TIME_REMAINING);
     RestartInterval.Reset();
     RedTent  = new Tent(true, WorldMap.RedTentPosition, ServerMode == GameMode.CaptureTheFlag, true);
     BlueTent = new Tent(false, WorldMap.BlueTentPosition, ServerMode == GameMode.CaptureTheFlag, true);
 }
Beispiel #19
0
        private List <TentListItem> ReadTentDGV()
        {
            // Declare dummy variables
            Tent   TentType       = 0;
            string TentSize       = string.Empty;
            int    TentQty        = 0;
            string TentCoverTypes = string.Empty;
            string TentHoldDowns  = string.Empty;
            string TentWalls      = string.Empty;
            string TentLegs       = string.Empty;

            // Declare the list of TentListItems objects
            List <TentListItem> ListOfTentItems = new List <TentListItem>();

            if (this.tentDGV == null)
            {
                Console.WriteLine("tentDGV is null");
                return(null);
            }

            // Loop through DGV and populate the object
            for (int i = 0; i < tentDGV.Rows.Count; ++i)
            {
                TentType       = (Tent)this.tentDGV.Rows[i].Cells[0].Value;
                TentSize       = this.tentDGV.Rows[i].Cells[1].Value.ToString();
                TentQty        = Convert.ToInt32(this.tentDGV.Rows[i].Cells[2].Value);
                TentCoverTypes = this.tentDGV.Rows[i].Cells[3].Value.ToString();
                TentHoldDowns  = this.tentDGV.Rows[i].Cells[4].Value.ToString();
                TentWalls      = this.tentDGV.Rows[i].Cells[5].Value.ToString();
                TentLegs       = this.tentDGV.Rows[i].Cells[6].Value.ToString();

                TentListItem item = new TentListItem();

                item.tentType       = TentType;
                item.tentSizes      = TentSize;
                item.tentQties      = TentQty;
                item.tentCoverTypes = TentCoverTypes;
                item.tentHoldDowns  = TentHoldDowns;
                item.tentWalls      = TentWalls;
                item.tentLegs       = TentLegs;

                //Console.WriteLine("Item tent size = {0}", item.tentSizes);
                ListOfTentItems.Add(item);
            }

            return(ListOfTentItems);
        }
        public ActionResult Edit([Bind(Include = "TentID,Name,BrandID,StatusID,ManufacturerID,DimensionsID,CapacityID,TentMaterialID,PoleMaterialID,Price,SeasonID,Weight,isWaterProof,isDiscontinued,Description,ImageURL")] Tent tent, HttpPostedFileBase imageURL)
        {
            if (ModelState.IsValid)
            {
                #region Image Upload

                if (imageURL != null)
                {
                    string imageName = imageURL.FileName;

                    string   ext  = imageName.Substring(imageName.LastIndexOf("."));
                    string[] exts = new string[] { ".jpeg", ".jpg", ".png" };
                    if (exts.Contains(ext.ToLower()) && (imageURL.ContentLength <= 4194304))
                    {
                        imageName = Guid.NewGuid() + ext.ToLower();
                        //imageURL.SaveAs(Server.MapPath("~/Content/img/" + imageName));
                        string savepath = Server.MapPath("~/Content/img/");
                        //string currentImage = Request.Params["ImageURL"];
                        Image convertedImage = Image.FromStream(imageURL.InputStream);
                        int   maxImageSize   = 500;
                        ImageService.ResizeImage(savepath, imageName, convertedImage, maxImageSize);
                        if (tent.ImageURL != "Placeholder.png" && tent.ImageURL != null)
                        {
                            //System.IO.File.Delete(Server.MapPath("~/Content/img/" + currentImage));
                            string path = Server.MapPath("~/Content/img/");
                            ImageService.Delete(path, tent.ImageURL);
                        }
                        tent.ImageURL = imageName;
                    }
                }

                #endregion
                db.Entry(tent).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.BrandID        = new SelectList(db.Brands, "BrandID", "BrandName", tent.BrandID);
            ViewBag.CapacityID     = new SelectList(db.Capacities, "CapacityID", "Capacity1", tent.CapacityID);
            ViewBag.DimensionsID   = new SelectList(db.Dimensions, "DimensionID", "DimensionRange", tent.DimensionsID);
            ViewBag.ManufacturerID = new SelectList(db.Manufacturers, "ManufacturerID", "ManufacturerName", tent.ManufacturerID);
            ViewBag.PoleMaterialID = new SelectList(db.PoleMaterials, "PoleMaterialID", "PoleMaterial1", tent.PoleMaterialID);
            ViewBag.SeasonID       = new SelectList(db.Seasons, "SeasonID", "Season1", tent.SeasonID);
            ViewBag.StatusID       = new SelectList(db.StatusIDs, "StatusID1", "Status", tent.StatusID);
            ViewBag.TentMaterialID = new SelectList(db.TentMaterials, "TentMaterialID", "TentMaterial1", tent.TentMaterialID);
            return(View(tent));
        }
Beispiel #21
0
 public World(GraphicsDeviceManager graphics, Camera camera, bool online)
 {
     PlayerIndex       = new ConcurrentDictionary <int, Player>();
     MobIndex          = new ConcurrentDictionary <int, Mob>();
     DropIndex         = new ConcurrentDictionary <int, ItemDrop>();
     FallingBlockIndex = new ConcurrentDictionary <int, FallingBlock>();
     WorldMap          = new Map(graphics);
     RedTent           = new Tent(true, Vector2.Zero, false, false);
     BlueTent          = new Tent(false, Vector2.Zero, false, false);
     sky              = ResourceManager.GetSprite("sky");
     objectList       = new List <GameObject>();
     lastBlockX       = 0;
     lastBlockY       = 0;
     DrawBlockOutline = false;
     this.camera      = camera;
     this.online      = online;
 }
        public ActionResult AddToCart(int qty, int tentID)
        {
            Dictionary <int, CartItemViewModel> shoppingCart = null;


            if (Session["cart"] != null)
            {
                shoppingCart = (Dictionary <int, CartItemViewModel>)Session["cart"];
            }


            else
            {
                shoppingCart = new Dictionary <int, CartItemViewModel>();
            }

            Tent product = db.Tents.Where(b => b.TentID == tentID).FirstOrDefault();

            if (product == null)
            {
                return(RedirectToAction("Index"));
            }

            else
            {
                CartItemViewModel item = new CartItemViewModel(qty, product);

                if (shoppingCart.ContainsKey(product.TentID))
                {
                    shoppingCart[product.TentID].Qty += qty;
                }

                else
                {
                    shoppingCart.Add(product.TentID, item);
                }

                Session["cart"] = shoppingCart;
            }


            return(RedirectToAction("Index", "ShoppingCart"));
        }
Beispiel #23
0
        private void editRowToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // Get index of selected row
            int selectedRowIndex = tentDGV.SelectedCells[0].RowIndex;

            // Get the type of tent (enum)
            Tent typeOfTent = (UserInterface.Tent)tentDGV.Rows[selectedRowIndex].Cells[0].Value;

            // Create new object of AddTentDlg class
            var TentDLG = new AddTentDlg(typeOfTent)
            {
                // Set properties of object according to values in selected row
                TentSize  = this.tentDGV.Rows[selectedRowIndex].Cells[1].Value.ToString(),
                Qty       = Convert.ToDecimal(this.tentDGV.Rows[selectedRowIndex].Cells[2].Value),
                CoverType = this.tentDGV.Rows[selectedRowIndex].Cells[3].Value.ToString(),
                TieDown   = this.tentDGV.Rows[selectedRowIndex].Cells[4].Value.ToString(),
                Walls     = this.tentDGV.Rows[selectedRowIndex].Cells[5].Value.ToString(),
                Legs      = this.tentDGV.Rows[selectedRowIndex].Cells[6].Value.ToString()
            };

            // Update the Dialog with these values
            TentDLG.UpdateFields();

            // Show the Dialog
            TentDLG.StartPosition = FormStartPosition.Manual;
            TentDLG.Location      = new Point(100, 100);

            if (TentDLG.ShowDialog() == DialogResult.OK)
            {
                // Update Main Dialog with new values
                this.tentDGV.Rows[selectedRowIndex].Cells[0].Value = typeOfTent;
                this.tentDGV.Rows[selectedRowIndex].Cells[1].Value = TentDLG.TentSize;
                this.tentDGV.Rows[selectedRowIndex].Cells[2].Value = TentDLG.Qty.ToString();
                this.tentDGV.Rows[selectedRowIndex].Cells[3].Value = TentDLG.CoverType;
                this.tentDGV.Rows[selectedRowIndex].Cells[4].Value = TentDLG.TieDown;
                this.tentDGV.Rows[selectedRowIndex].Cells[5].Value = TentDLG.Walls;
                this.tentDGV.Rows[selectedRowIndex].Cells[6].Value = TentDLG.Legs;

                // Update the list of items
                UpdateList();
            }
        }
Beispiel #24
0
        protected override void OnListItemClick(ListView l, View v, int position, long id)
        {
            Tent tent = null;

            try
            {
                tent = adapter.GetItemAtPosition(position);
            }
            catch (Exception e)
            {
                Log.Error(Constants.LOGTAG, "items from adapter blew up", e);
            }

            ((BeerTentApplication)Application).SelectedTent = tent;

            // startFrom page is not stored in application, for example purposes it's a simple "extra"
            Intent intent = new Intent(Constants.INTENT_TENT_DETAIL);

            StartActivity(intent);
        }
        // GET: Tents/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Tent tent = db.Tents.Find(id);

            if (tent == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BrandID        = new SelectList(db.Brands, "BrandID", "BrandName", tent.BrandID);
            ViewBag.CapacityID     = new SelectList(db.Capacities, "CapacityID", "Capacity1", tent.CapacityID);
            ViewBag.DimensionsID   = new SelectList(db.Dimensions, "DimensionID", "DimensionRange", tent.DimensionsID);
            ViewBag.ManufacturerID = new SelectList(db.Manufacturers, "ManufacturerID", "ManufacturerName", tent.ManufacturerID);
            ViewBag.PoleMaterialID = new SelectList(db.PoleMaterials, "PoleMaterialID", "PoleMaterial1", tent.PoleMaterialID);
            ViewBag.SeasonID       = new SelectList(db.Seasons, "SeasonID", "Season1", tent.SeasonID);
            ViewBag.StatusID       = new SelectList(db.StatusIDs, "StatusID1", "Status", tent.StatusID);
            ViewBag.TentMaterialID = new SelectList(db.TentMaterials, "TentMaterialID", "TentMaterial1", tent.TentMaterialID);
            return(View(tent));
        }
        ///<inheritdoc/>
        public override int GetHashCode()
        {
            int hash = 17;

            // Overflow is fine, just wrap
            unchecked
            {
                hash = (hash * 29) + PaintScheme.GetHashCode();
                hash = (hash * 29) + Mobility.GetHashCode();
                hash = (hash * 29) + FirePower.GetHashCode();
                hash = (hash * 29) + Damage.GetHashCode();
                hash = (hash * 29) + Smoke.GetHashCode();
                hash = (hash * 29) + TrailingEffects.GetHashCode();
                hash = (hash * 29) + Hatch.GetHashCode();
                hash = (hash * 29) + HeadLights.GetHashCode();
                hash = (hash * 29) + TailLights.GetHashCode();
                hash = (hash * 29) + BrakeLights.GetHashCode();
                hash = (hash * 29) + Flaming.GetHashCode();
                hash = (hash * 29) + Launcher.GetHashCode();
                hash = (hash * 29) + CamouflageType.GetHashCode();
                hash = (hash * 29) + Concealed.GetHashCode();
                hash = (hash * 29) + FrozenStatus.GetHashCode();
                hash = (hash * 29) + PowerPlantStatus.GetHashCode();
                hash = (hash * 29) + State.GetHashCode();
                hash = (hash * 29) + Tent.GetHashCode();
                hash = (hash * 29) + Ramp.GetHashCode();
                hash = (hash * 29) + BlackoutLights.GetHashCode();
                hash = (hash * 29) + BlackoutBrakeLights.GetHashCode();
                hash = (hash * 29) + SpotLights.GetHashCode();
                hash = (hash * 29) + InteriorLights.GetHashCode();
                hash = (hash * 29) + SurrenderState.GetHashCode();
                hash = (hash * 29) + MaskedCloaked.GetHashCode();
            }

            return(hash);
        }
Beispiel #27
0
 public TentAdapter(Context context, int textViewResourceId, Tent[] objects)
     : base(context, textViewResourceId, objects)
 {
     _tents = objects;
 }
Beispiel #28
0
        public static void Initialize(GmmContext context)
        {
            context.Database.EnsureCreated();

            if (context.Bands.Any())
            {
                return;
            }

            //TODO read data from excel

            Function tourmanager = new Function
            {
                Name = "TourManager"
            }; Function prodmanager = new Function

            {
                Name = "Production Manager"
            }; Function begeleider = new Function
            {
                Name = "Artiestenbegeleider"
            };

            var members = new List <Member> {
                new Member
                {
                    Name     = "Thomas Reitz",
                    Function = tourmanager
                },
                new Member
                {
                    Name     = "George Reeves",
                    Function = prodmanager
                },
                new Member
                {
                    Name     = "Liesbeth Huber",
                    Function = begeleider
                },
                new Member
                {
                    Name     = "Nele Knockaert",
                    Function = begeleider
                }
            };

            Band sabbath = new Band
            {
                Name        = "Grey Sabbath",
                Members     = members,
                GroepsColor = 1
            };
            Stage mainstage = new Stage {
                Name = "Mainstage 1"
            };
            Tent maintent = new Tent {
                Name = "MainTENT 1"
            };

            Kleedkamer[] kleedkamers = new Kleedkamer[] {
                new Kleedkamer {
                    Name = "1"
                },
                new Kleedkamer {
                    Name = "6"
                }
            };
            ProductieUnit[] prodUnit = new ProductieUnit[] {
                new ProductieUnit {
                    Name = "P1"
                },
                new ProductieUnit {
                    Name = "P2"
                }
            };
            Voorziening voorziening = new Voorziening
            {
                Wasserij    = 1,
                Coolersband = 3,
                Comments    = "All food clearly labeled/nJuicer (x1)"
            };
            Catering catering = new Catering
            {
                AfterShow = true
            };
            Logistic logistic = new Logistic
            {
                Verlengkabels = true,
                Voltage110    = 6,
                Comments      = "110V elke KK/nQuick change on stage"
            };
            Special special = new Special
            {
                HdWitGr   = 100,
                HdZwartKl = 30,
                Runner    = 1,
                Arts      = 1,
                Zuurstof  = 2,
                Comments  = "Zuurstof + masker (x2)"
            };

            Optreden sabbOptreden = new Optreden
            {
                Band        = sabbath,
                Catering    = catering,
                Date        = DateTime.Now,
                Hours       = "None",
                Logistic    = logistic,
                Special     = special,
                Stage       = mainstage,
                Tent        = maintent,
                Voorziening = voorziening
            };

            BandKleedkamers[] sabbKleedkamer = new BandKleedkamers[kleedkamers.Length];
            for (int i = 0; i < kleedkamers.Length; i++)
            {
                sabbKleedkamer[i] = new BandKleedkamers
                {
                    Uurdatum   = DateTime.Now,
                    Kleedkamer = kleedkamers[i],
                    Optreden   = sabbOptreden
                };
            }
            ;
            BandProductieUnits[] sabbProd = new BandProductieUnits[prodUnit.Length];
            for (int i = 0; i < prodUnit.Length; i++)
            {
                sabbProd[i] = new BandProductieUnits
                {
                    Uurdatum      = DateTime.Now,
                    ProductieUnit = prodUnit[i],
                    Optreden      = sabbOptreden
                };
            }
            ;

            context.Members.AddRange(members);
            context.Bands.Add(sabbath);
            context.Stages.Add(mainstage);
            context.Tents.Add(maintent);

            context.Kleedkamers.AddRange(kleedkamers);
            context.ProductieUnits.AddRange(prodUnit);
            context.BandKleedkamers.AddRange(sabbKleedkamer);
            context.BandProductieUnits.AddRange(sabbProd);

            context.Voorzienings.Add(voorziening);
            context.Caterings.Add(catering);
            context.Logistics.Add(logistic);
            context.Specials.Add(special);
            context.Optredens.Add(sabbOptreden);

            context.SaveChanges();
        }
 public TentDetailViewController(Tent tent)
 {
     _tent = tent;
 }
Beispiel #30
0
        public override void OnDoubleClick(Mobile from)
        {
            try
            {
                // Check distance
                if (!from.InRange(this.Location, 2) && from.AccessLevel < AccessLevel.Counselor)
                {
                    from.SendMessage("You cannot reach that from here.");
                    return;
                }

                // findout why we keep throwing exceptions
                //	My guess is that the tent is not deleted when the owner is deleted, and we therefore barf when checking m_BaseHouse.Owner
                if (Misc.Diagnostics.Assert(m_BaseHouse != null, "m_BaseHouse == null") == false)
                {
                    return;
                }
                if (Misc.Diagnostics.Assert(m_BaseHouse.Owner != null, "m_BaseHouse.Owner == null") == false)
                {
                    return;
                }
                if (Misc.Diagnostics.Assert(m_BaseHouse.Owner.Account != null, "m_BaseHouse.Owner.Account == null") == false)
                {
                    return;
                }

                // Check that this mobile account is the owner account
                if (from.Account != m_BaseHouse.Owner.Account && from.AccessLevel < AccessLevel.Counselor)
                {
                    from.SendMessage("Only the tent's owner can pack it away.");
                    return;
                }
                else
                {
                    if (m_BaseHouse is Tent)
                    {
                        Tent t = (Tent)m_BaseHouse;
                        if (t.TentPack != null && t.TentPack.Items.Count > 0)
                        {
                            from.SendMessage("You must empty your tent's pack before you can pack it away.");
                            return;
                        }
                        from.SendGump(new TentPackGump(from, m_BaseHouse));
                    }
                    else if (m_BaseHouse is SiegeTent)
                    {
                        if (from.AccessLevel > AccessLevel.Player)
                        {
                            from.SendGump(new TentPackGump(from, m_BaseHouse));
                        }
                        else
                        {
                            from.SendMessage("Siege tents cannot be packed away. You must wait for it to decay.");
                        }

                        /*
                         *      SiegeTent st = (SiegeTent) m_BaseHouse;
                         *      if( st.Tentpack != null && st.Tentpack.Items.Count > 0 )
                         *      {
                         *              from.SendMessage("You must empty your tent's pack before you can pack it away.");
                         *              return;
                         *      }
                         */
                    }
                }
            }
            catch (Exception e)
            {
                LogHelper.LogException(e);
            }
        }
 public Tent(Tent originalTent)
 {
     WordsOnTent = new List <string>(originalTent.WordsOnTent);
 }
Beispiel #32
0
 public Tent(Tent t) : base(t)
 {
     prefab = Resources.Load("Prefabs/Tent");
 }