Esempio n. 1
0
    public void SendPopGuest(GuestType type, GuestPopPointerCtrl popPoint, Vector3 destination, GuestPopPointerCtrl goOutDestination)
    {
        if (ValidPopGuest(type))
        {
            Vector3 vecGoOutDestination = goOutDestination.transform.position;
            vecGoOutDestination.y = GuestCenterPositionHeight;

            switch (type)
            {
            case GuestType.Standard:
                popPoint.SendPopGuest(m_normalGuest, destination, vecGoOutDestination);
                break;

            case GuestType.Gentle:
                popPoint.SendPopGuest(m_gentleGuest, destination, vecGoOutDestination);
                break;

            case GuestType.Impatient:
                popPoint.SendPopGuest(m_impatientGuest, destination, vecGoOutDestination);
                break;

            case GuestType.StayBehind:
                popPoint.SendPopGuest(m_stayBehindGuest, destination, vecGoOutDestination);
                break;
            }
        }
    }
Esempio n. 2
0
        /// <summary>
        /// Method that creates a new guest type and stores it in the table
        /// </summary>
        /// <param name="guestType">Object holding the data to add to the table</param>
        /// <returns> Row Count </returns>	
        public int InsertGuestType(GuestType guestType)
        {
            int rows = 0;

            var conn = DBConnection.GetDbConnection();
            var cmdText = @"sp_insert_guest_type";
            var cmd = new SqlCommand(cmdText, conn);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@GuestTypeID", guestType.GuestTypeID);
            cmd.Parameters.AddWithValue("@Description", guestType.Description);

            try
            {
                conn.Open();
                rows = cmd.ExecuteNonQuery();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                conn.Close();
            }
            return rows;

        }
 /// <summary>
 /// Verifies that the fields are filled out and creates a guestType object
 /// </summary>
 private bool createNewEmpRole()
 {
     if (txtGuestTypeID.Text == "" ||
         txtDescription.Text == "")
     {
         MessageBox.Show("You must fill out all the fields.");
     }
     else if (txtGuestTypeID.Text.Length > 50 || txtDescription.Text.Length > 250)
     {
         MessageBox.Show("Your Guest Type is too long! Please shorten it.");
     }
     else if (txtDescription.Text.Length > 250)
     {
         MessageBox.Show("Your description is too long! Please shorten it.");
     }
     else
     {
         result = true;
         //Valid
         _guestType = new GuestType()
         {
             GuestTypeID = txtGuestTypeID.Text,
             Description = txtDescription.Text,
         };
     }
     return(result);
 }
        // GET: GuestTypes/Details/5
        public ActionResult Details(int convention_id, int?id)
        {
            var us = new UserService((ClaimsIdentity)User.Identity, db);

            if (!us.IsConventionAdmin(convention_id))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var convention = db.Conventions.Find(convention_id);

            if (convention == null)
            {
                return(new HttpNotFoundResult());
            }

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GuestType replayGuestType = convention.GuestTypes.Where(e => e.Id == id).FirstOrDefault();

            if (replayGuestType == null)
            {
                return(HttpNotFound());
            }
            return(View(replayGuestType));
        }
 public RoomDetail(int age)
 {
     type = GuestType.CHILD;
     name = null;
     surname = null;
     roomId = 1;
     this.age = age;
 }
 public RoomDetail(GuestType type, int age, String name, String surname, int roomId)
 {
     this.type = type;
     this.age = age;
     this.name = name;
     this.surname = surname;
     this.roomId = roomId;
 }
Esempio n. 7
0
 public RoomDetail(GuestType type, int age, String name, String surname, int roomId)
 {
     this.type    = type;
     this.age     = age;
     this.name    = name;
     this.surname = surname;
     this.roomId  = roomId;
 }
Esempio n. 8
0
 public RoomDetail(int age)
 {
     type     = GuestType.CHILD;
     name     = null;
     surname  = null;
     roomId   = 1;
     this.age = age;
 }
Esempio n. 9
0
        public async Task WriteGuestTypeCookieAsync(GuestType guestType, IList <Claim> claims, HttpContext httpContext)
        {
            claims.Add(new Claim("GuestType", guestType.ToString()));
            claims.Add(new Claim("GuestId", Guid.NewGuid().ToString()));


            var id = new ClaimsIdentity(claims, "local");
            await httpContext.Authentication.SignInAsync("NomNomNom", new ClaimsPrincipal(id));
        }
Esempio n. 10
0
 public void AddPasswordMap(Guid id, GuestType guestType)
 {
     using (var cw = new CsvWriter(_PasswordMapperLocation, true))
     {
         cw.WriteLine(new List <string> {
             id.ToString(), guestType.ToString()
         });
     }
 }
Esempio n. 11
0
        private string AddType(int id, int typeId)
        {
            Guest     guest     = db.Guests.Find(id);
            GuestType guestType = db.GuestTypes.Find(typeId);

            guest.GuestTypes.Add(guestType);
            db.SaveChanges();

            return("success");
        }
Esempio n. 12
0
    public void Init(GuestType guestType, ItemType itemType, int numQueue)
    {
        GuestUI_Item();

        _type               = guestType;
        _requiredItem       = itemType;
        _numOrder           = numQueue;
        _guestSprite.sprite = ResourcesMgr.GetSprite(GetGuestSpriteName(guestType));

        anim.Play("GuestMoveIn");
    }
        public void ChangeGuestStatusType(Guest guest, GuestType type)
        {
            var existingGuest = _context.Guests.Find(guest);

            if (existingGuest != null)
            {
                existingGuest.Type = type;
                _context.Entry(existingGuest).State = System.Data.Entity.EntityState.Modified;
                _context.SaveChanges();
            }
        }
Esempio n. 14
0
	public void Init(GuestType guestType,ItemType itemType,int numQueue)
	{
		GuestUI_Item ();

		_type = guestType;
		_requiredItem = itemType;
		_numOrder = numQueue;
		_guestSprite.sprite = ResourcesMgr.GetSprite ( GetGuestSpriteName(guestType) );

		anim.Play("GuestMoveIn");
	}
Esempio n. 15
0
        public int InsertGuestType(GuestType newGuestType)
        {
            int listLength = guestType.Count;

            guestType.Add(newGuestType);
            if (listLength == guestType.Count - 1)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }
        private void LoadGridLookupValues()
        {
            GuestType guestType = new GuestType();

            guestType.CompanyId = SessionHandler.CurrentCompanyId;

            List <GuestType> guestTypes = new GuestType()
            {
                CompanyId = Master.CurrentCompany.CompanyId
            }.SelectAllList();

            ((GridViewDataComboBoxColumn)gvGroupMembers.Columns["GuestTypeId"]).PropertiesComboBox.DataSource = guestTypes;
            ((GridViewDataComboBoxColumn)gvGroupMembers.Columns["GuestTypeId"]).PropertiesComboBox.TextField  = "GuestTypeName";
            ((GridViewDataComboBoxColumn)gvGroupMembers.Columns["GuestTypeId"]).PropertiesComboBox.ValueField = "GuestTypeId";
        }
Esempio n. 17
0
        private string RemoveType(int id, int typeId)
        {
            Guest     guest        = db.Guests.Find(id);
            GuestType typetoremove = new GuestType();

            foreach (var item in guest.GuestTypes)
            {
                if (item.Id == typeId)
                {
                    typetoremove = item;
                }
            }
            guest.GuestTypes.Remove(typetoremove);
            db.SaveChanges();
            return("success");
        }
        public void TestCreateGuestTypeDescriptionTooLong()
        {
            // arrange
            GuestType testGuestType = new GuestType()
            {
                GuestTypeID = "GoodID",
                Description = createLongString(1001),
            };

            string badDescription = testGuestType.Description;

            // act
            bool result = guestManager.CreateGuestType(testGuestType);

            // assert - check that description did not change
            Assert.AreEqual(badDescription, testGuestType.Description);
        }
        public void TestCreateGuestTypeGuestTypeIDTooLong()
        {
            // arrange
            GuestType testGuestType = new GuestType()
            {
                GuestTypeID = createLongString(51),
                Description = "Good Description",
            };

            string badGuestTypeID = testGuestType.GuestTypeID;

            // act
            bool result = guestManager.CreateGuestType(testGuestType);

            // assert - check that GuestTypeID did not change
            Assert.AreEqual(badGuestTypeID, testGuestType.GuestTypeID);
        }
Esempio n. 20
0
    public bool ValidPopGuest(GuestType type)
    {
        if (type == GuestType.InvalidType)
        {
            return(false);
        }

        int idx = (int)type;

        if (!m_param[idx].IsCapacity())
        {
            return(false);
        }
        --(m_param[idx].m_num);

        return(true);
    }
Esempio n. 21
0
    public void setGuestType(GuestType type)
    {
        guestType = type;

        needItemId = UnityEngine.Random.Range(0, 13);
        if (needItemId == 6)
        {
            needItemId = 0;
        }
        needItemcount   = UnityEngine.Random.Range(1, 10);
        needItempercent = UnityEngine.Random.Range(10, 20);


        if (guestType == GuestType.HaveQuest)
        {
            questBt.SetActive(true);
        }
    }
        public void TestCreateGuestTypeValidInput()
        {
            bool expectedResult = true;
            bool actualResult;

            // arrange
            GuestType testGuestType = new GuestType()
            {
                GuestTypeID = "GoodID",
                Description = "Good Description",
            };

            // act
            actualResult = guestManager.CreateGuestType(testGuestType);

            // assert - check if GuestType was added
            Assert.AreEqual(expectedResult, actualResult);
        }
        public void TestCreateGuestTypeValidInputMaxLengths()
        {
            bool expectedResult = true;
            bool actualResult;

            // arrange
            GuestType testGuestType = new GuestType()
            {
                GuestTypeID = createLongString(50),
                Description = createLongString(1000),
            };

            // act
            actualResult = guestManager.CreateGuestType(testGuestType);

            // assert - check if GuestType was added
            Assert.AreEqual(expectedResult, actualResult);
        }
        /// <summary author="Austin Berquam" created="2019/02/06">
        /// Method that sends the created guestType to the accessor
        /// </summary>
        /// <param name="guestType">Object holding the new guestType to add to the table</param>
        /// <returns> bool on if the role was created </returns>
        public bool CreateGuestType(GuestType guestType)
        {
            ValidationExtensionMethods.ValidateID(guestType.GuestTypeID);
            ValidationExtensionMethods.ValidateDescription(guestType.Description);
            bool result = false;

            try
            {
                result = (1 == guestTypeAccessor.InsertGuestType(guestType));
            }
            catch (Exception ex)
            {
                ExceptionLogManager.getInstance().LogException(ex);
                throw ex;
            }

            return(result);
        }
        public ActionResult DeleteConfirmed(int convention_id, int id)
        {
            var us = new UserService((ClaimsIdentity)User.Identity, db);

            if (!us.IsConventionAdmin(convention_id))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var convention = db.Conventions.Find(convention_id);

            if (convention == null)
            {
                return(new HttpNotFoundResult());
            }

            GuestType replayGuestType = convention.GuestTypes.Where(e => e.Id == id).FirstOrDefault();

            db.GuestTypes.Remove(replayGuestType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult Edit([Bind(Include = "Id,Name,DisplayName,IsPrivate,IsMenu")] GuestType replayGuestType, int convention_id)
        {
            var us = new UserService((ClaimsIdentity)User.Identity, db);

            if (!us.IsConventionAdmin(convention_id))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var convention = db.Conventions.Find(convention_id);

            if (convention == null)
            {
                return(new HttpNotFoundResult());
            }
            if (ModelState.IsValid)
            {
                db.Entry(replayGuestType).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            return(View(replayGuestType));
        }
Esempio n. 27
0
	public void Init(GuestType guestType,int jewelType,int quantity,int numQueue )
	{
		GuestUI_Jewel ();

		_type = guestType;
		_requiredJewel = jewelType;
		_requiredQuantity = quantity;
		_readyToTakeOrder = false;
		_isActive = true;
		_numOrder = numQueue;

		//_guestSprite.sprite = ResourcesMgr.GetSprite ( GetGuestSpriteName(guestType) );
		_jewelSprite.sprite = Resources.Load<Sprite>( GetJewelSpriteName() );
		_quantityLabel.text = quantity.ToString ();

		_requiredItem = ItemType.NONE;

		_jewelSprite.enabled = false;
		_quantityLabel.enabled = false;
		_ballonSprite.enabled = false;
		anim.Play("GuestMoveIn");

		Invoke ("StartOrder",2.1f);
	}
Esempio n. 28
0
    public void Init(GuestType guestType, int jewelType, int quantity, int numQueue)
    {
        GuestUI_Jewel();

        _type             = guestType;
        _requiredJewel    = jewelType;
        _requiredQuantity = quantity;
        _readyToTakeOrder = false;
        _isActive         = true;
        _numOrder         = numQueue;

        //_guestSprite.sprite = ResourcesMgr.GetSprite ( GetGuestSpriteName(guestType) );
        _jewelSprite.sprite = Resources.Load <Sprite>(GetJewelSpriteName());
        _quantityLabel.text = quantity.ToString();

        _requiredItem = ItemType.NONE;

        _jewelSprite.enabled   = false;
        _quantityLabel.enabled = false;
        _ballonSprite.enabled  = false;
        anim.Play("GuestMoveIn");

        Invoke("StartOrder", 2.1f);
    }
Esempio n. 29
0
 public void ChangePasswordMap(Guid id, GuestType guestType)
 {
     throw new NotImplementedException();
 }
Esempio n. 30
0
	string GetGuestSpriteName(GuestType type)
	{
		return "char1";
	}
Esempio n. 31
0
 string GetGuestSpriteName(GuestType type)
 {
     return("char1");
 }
Esempio n. 32
0
 public void ChangeGuestStatusType(Guest guest, GuestType status)
 {
     throw new NotImplementedException();
 }