public InMemoryRepository()
        {
            var celebrations = new[]
            {
                Celebration.Birthday(DateTime.Parse("2015-02-22T22:11:00.000Z"), "Signes birthday"),
                Celebration.Birthday(DateTime.Parse("2009-04-04T03:42:00.000Z"), "Desmonds birthday"),
                Celebration.Birthday(DateTime.Parse("1980-06-01T08:00:00.000Z"), "Jennys birthday"),
                Celebration.Birthday(DateTime.Parse("1980-05-16T12:00:00.000Z"), "Jonases birthday"),

                new Celebration
                (
                    DateTime.Parse("2005-07-03T18:15:00.000Z"),
                    "J+J first date",
                    CelebrationType.Anniversary
                ),
                new Celebration(
                    DateTime.Parse("2011-11-05T18:00:00.000Z"),
                    "J+J wedding day",
                    CelebrationType.WeddingDay
                    )
            };

            var calendar = new Calendar("Fam Jerndin")
            {
                Celebrations = celebrations.ToList()
            };

            Save(calendar);
        }
Пример #2
0
 void FireworkExplode()
 {
     for (int i = 0; i < 8; i++)
     {
         Celebration.globalCreateParticle(transform.localPosition, new Vector3(Random.Range(-4.0f, 4.0f), Random.Range(-4.0f, 4.0f), 0), 12.0f, false);
     }
     Destroy(gameObject);
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Celebration celebration = db.Celebrations.Find(id);

            db.Celebrations.Remove(celebration);
            db.SaveChanges();
            //changed Index to Create on next line.
            return(RedirectToAction("Create"));
        }
        public void Delete(int id)
        {
            var Celebration = new Celebration
            {
                CelebrationId = id
            };

            UnitOfWork.CelebrationRepository.Delete(Celebration);
            UnitOfWork.Save();
        }
        public void Create(CelebrationViewModel CelebrationViewModel)
        {
            var Celebration = new Celebration
            {
                CelebrationName = CelebrationViewModel.CelebrationName,
                CelebrationType = CelebrationViewModel.CelebrationType,
            };

            UnitOfWork.CelebrationRepository.Insert(Celebration);
            UnitOfWork.Save();
        }
 public ActionResult Edit([Bind(Include = "CelebrationID,HolidayRecently,PartyRecently,MilestoneRecently,CelebrateChristmas,CelebrateNYE,CelebrateThanksgiving,CelebrateValentine,CelebrateEaster,CelebrateIndependenceDay,CelebrateHalloween,CelebrateMemorialDay,CelebrateLaborDay,CelebrateMothersDay,CelebrateFathersDay,CelebrateChaunakah,CelebratePassover,CelebrateRoshHashanah,CelerateYomKippur,CelebrateRamadan,CelebrateEID,CelebrateSTPat,CelebrateBirthdays,CelebrateChineseNewYear,CelebrateQuinceanera,CelebrateBarBatMitzvah,CelebrateDayOfTheDead,CelebrateVeteransDay,CelebrateCincoDeMayo,AnythingElse")] Celebration celebration)
 {
     if (ModelState.IsValid)
     {
         db.Entry(celebration).State = EntityState.Modified;
         db.SaveChanges();
         //changed Index to Details/id on next line
         return(RedirectToAction("Details", new { id = celebration.CelebrationID }));
     }
     return(View(celebration));
 }
        public void Update(CelebrationViewModel CelebrationViewModel)
        {
            var Celebration = new Celebration
            {
                CelebrationId   = CelebrationViewModel.CelebrationId,
                CelebrationName = CelebrationViewModel.CelebrationName,
                CelebrationType = CelebrationViewModel.CelebrationType,
            };

            UnitOfWork.CelebrationRepository.Update(Celebration);
            UnitOfWork.Save();
        }
        // GET: Celebrations/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Celebration celebration = db.Celebrations.Find(id);

            if (celebration == null)
            {
                return(HttpNotFound());
            }
            return(View(celebration));
        }
Пример #9
0
    bool ProcessEvent(bool withSound = true)
    {
        GameEvent evt = engine.getQueuedEvent();

        if (evt == null)
        {
            return(false);
        }
        if (evt is TileChangedEvent)
        {
            TileChangedEvent sEvt = (TileChangedEvent)evt;
            tiles [sEvt.x, sEvt.y].SetTexture(tileTextures [sEvt.currentPiece.GetHashCode()]);
            hasPlaced [sEvt.x, sEvt.y] = true;
            if (withSound)
            {
                int randomNumber = Random.Range(0, playSounds.Length);

                AudioClip clip = playSounds [randomNumber];
                Debug.Log(randomNumber.ToString() + ", " + clip.ToString());
                playSound(clip);
            }
            autoSave();
            Counter.UpdateValue(engine.getPieceCount(), engine.getRemainingArrowCount());
        }
        if (evt is CurrentTileChangedEvent)
        {
            CurrentTileChangedEvent sEvt = (CurrentTileChangedEvent)evt;
            GameObject.Find("TileCurrent").GetComponent <Tile> ().SetTexture(tileTextures [sEvt.newCurrentTile.GetHashCode()]);
        }
        if (evt is StoredTileChangedEvent)
        {
            StoredTileChangedEvent sEvt = (StoredTileChangedEvent)evt;
            GameObject.Find("TileStored").GetComponent <Tile> ().SetTexture(tileTextures [sEvt.newStoredTile.GetHashCode()]);
            AudioClip clip = swapSound;
            playSound(clip);
        }
        if (evt is GameWonEvent)
        {
            Debug.Log("WINNER");
            Celebration.globalWin();
            Stats.addWin(generatorId);
            WinLoss.ShowWin();
        }
        if (evt is GameLostEvent)
        {
            Debug.Log("Loser");
            WinLoss.ShowLoss();
        }
        return(true);
    }
        public async Task <IActionResult> Post([FromForm] AddBaptemeViewModel new_bapteme)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }


            Adresse new_adress = new Adresse()
            {
                Numero       = new_bapteme.Numero,
                Rue          = new_bapteme.Rue,
                TelephoneFix = new_bapteme.TelephoneFix,
                CP           = new_bapteme.CP,
                Ville        = new_bapteme.Ville,
                Complement   = new_bapteme.Complement,
            };
            await _db.AddAsync(new_adress);

            ApplicationUser new_user = new ApplicationUser()
            {
                FirstName       = new_bapteme.FirstName,
                LastName        = new_bapteme.LastName,
                BirthDate       = new_bapteme.BirthDate,
                UserName        = Guid.NewGuid().ToString(),
                CelebrationId   = new_bapteme.CelebrationId,
                TelephoneMobile = new_bapteme.TelephoneMobile,
                Email           = new_bapteme.Email,
                IdAdress        = new_adress.Id
            };
            await _userManager.CreateAsync(new_user);

            Celebration celebration = await _db.Celebrations.FindAsync(new_bapteme.CelebrationId);

            Clocher clocher = await _db.Clochers.Where(x => x.Id == celebration.ClocherId).FirstAsync();

            UserParoisse uParoisse = new UserParoisse()
            {
                UserId = new_user.Id, ParoisseId = clocher.ParoisseId, Role = role.Contact
            };
            await _db.AddAsync(uParoisse);

            await _db.SaveChangesAsync();

            return(Ok(new_user.Id));
        }
Пример #11
0
        public async Task <IActionResult> Delete(Guid CelebrationId)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Celebration celebration_to_delete = await _db.Celebrations.FindAsync(CelebrationId);

            if (celebration_to_delete == null)
            {
                return(NotFound());
            }

            _db.Celebrations.Remove(celebration_to_delete);
            await _db.SaveChangesAsync();

            return(Ok());
        }
Пример #12
0
        public object GetMonthEventListTypeWise(ClsMonthCalenderInput monthCal)
        {
            dynamic TBEventListTypeResult;

            try
            {
                var Result = Celebration.GetMonthEventTypeList(monthCal);
                if (Result != null)
                {
                    TBEventListTypeResult = new { status = "0", message = "success", updatedOn = System.DateTime.Now.ToString("yyyy/MM/dd HHmm:ss"), Result };
                }
                else
                {
                    TBEventListTypeResult = new { status = "1", message = "failed", updatedon = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss") };
                }
            }
            catch
            {
                TBEventListTypeResult = new { status = "1", message = "failed", updatedon = System.DateTime.Now.ToString("yyyy/MM/dd HH::mm:ss") };
            }
            return(new { TBEventListTypeResult });
        }
Пример #13
0
        public object GetMonthEventListDetails(ClsMonthCalenderInput monthCal)
        {
            dynamic TBEventListDtlsResult;

            try
            {
                var Result = Celebration.GetMonthEventListDetails(monthCal);
                if (Result != null)
                {
                    TBEventListDtlsResult = new { status = "0", message = "success", Result };
                }
                else
                {
                    TBEventListDtlsResult = new { status = "1", message = "failed" };
                }
            }
            catch
            {
                TBEventListDtlsResult = new { status = "1", message = "failed" };
            }
            return(new { TBEventListDtlsResult });
        }
Пример #14
0
    //--------------------------------------------------------------------------------------------------------
    private void Eat(Block food)
    {
        Destroy(food.gameObject);
        //DestroyImmediate(food.gameObject);

        //Instantiate the correct combo pfx based on the current combo multiplier.
        Celebration celebration = Instantiate(
            original: CombineCelebrationPrefabs[gameController.ScoreMultPanel.CurrentLevel],
            parent: uiCanvas.transform,
            worldPositionStays: false).GetComponent <Celebration>();

        celebration.transform.position = (Vector3)swipeDestPos;

        gameController.ChangeScore(Level * gameController.ScoreMultPanel.GetCurrentMultiplier());
        gameController.ScoreMultPanel.TryToIncrementLevel();
        gameController.SomethingJustPromoted = true;
        RandomizeSpeed();
        BlockAnimator.Play("Block_Birth");

        BlocksToEat.Remove(food);
        gameController.GlobalFood.Remove(food);
    }
        public object GetTodaysBirthday(ClsMonthCalenderInput monthCal)
        {
            dynamic TBMemberListResult;

            try
            {
                var Result = Celebration.GetTodaysBirthday(monthCal.groupId);

                if (Result != null)
                {
                    TBMemberListResult = new { status = "0", message = "success", Result };
                }
                else
                {
                    TBMemberListResult = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                TBMemberListResult = new { status = "1", message = "failed" };
            }

            return(new { TBMemberListResult });
        }
Пример #16
0
        public object GetEventMinDetails(EventInfo input)
        {
            dynamic TBPublicEventList;

            try
            {
                object Result = Celebration.GetEventMinDetails(input.eventID);

                if (Result != null)
                {
                    TBPublicEventList = new { status = "0", message = "success", Result };
                }
                else
                {
                    TBPublicEventList = new { status = "0", message = "Record not found" };
                }
            }
            catch
            {
                TBPublicEventList = new { status = "1", message = "failed" };
            }

            return(new { TBPublicEventList });
        }