Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            AllMethods     allMet = new AllMethods();
            FurnitureModel fur    = allMet.GetOneFurniture(id);

            return(View(fur));
        }
Exemplo n.º 2
0
        private Vector2 GenerateDimensionForFurniture(FurnitureModel furnitureModel)
        {
            Vector2 result = Vector2.get_zero();

            switch (furnitureModel.Type)
            {
            case FurnitureKinds.Floor:
                result = this.GenerateDimensionForFloor(furnitureModel);
                break;

            case FurnitureKinds.Wall:
                result = this.GenerateDimensionForWall(furnitureModel);
                break;

            case FurnitureKinds.Window:
                result = this.GenerateDimensionForWindow(furnitureModel);
                break;

            case FurnitureKinds.Hangings:
                result = this.GenerateDimensionForHangings(furnitureModel);
                break;

            case FurnitureKinds.Chest:
                result = this.GenerateDimensionForChest(furnitureModel);
                break;

            case FurnitureKinds.Desk:
                result = this.GenerateDimensionForDesk(furnitureModel);
                break;
            }
            return(result);
        }
            public void SetFurniture(FurnitureModel model)
            {
                this._setFurnitureTex(model);
                bool isActive = model.IsNeedWorker();

                this._uiWorker.SetActive(isActive);
                this._setRare(model);
            }
 private bool IsNeedUpdateFurniture(FurnitureKinds furnitureKind, FurnitureModel furnitureModel)
 {
     if (mFurnituresSet.TryGetValue(furnitureKind, out FurnitureModel _))
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 5
0
            public new void SetFurniture(FurnitureModel model)
            {
                _setFurnitureTex(model);
                bool isActive = model.IsNeedWorker() ? true : false;

                _uiWorker.SetActive(isActive);
                _setRare(model);
            }
Exemplo n.º 6
0
        public ActionResult Create([Bind(Include = "ID, Name, Colour, OriginCountry, ManufacturerName, Price, Quantity, Category, ProductionYear, SalonName")]
                                   FurnitureModel furniture)
        {
            AllMethods allMet = new AllMethods();

            allMet.AddFurniture(furniture);
            return(RedirectToAction("Index"));
        }
Exemplo n.º 7
0
        private void OnPushStateDetailDialog()
        {
            SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true;
            FurnitureModel selectedFurniture = this.mContext.SelectedFurniture;
            bool           isValidBuy        = this.mFurnitureStoreManager.IsValidExchange(selectedFurniture);

            this.storeDialog.Initialize(selectedFurniture, isValidBuy);
            this.storeDialog.SetKeyController(this.mKeyController);
            this.storeDialog.Show();
        }
Exemplo n.º 8
0
        private void OnSelectPreview()
        {
            this.mKeyController.ClearKeyAll();
            this.mKeyController.firstUpdate = true;
            SoundUtils.PlaySE(SEFIleInfos.CommonEnter2);
            FurnitureModel selectedFurniture = this.mContext.SelectedFurniture;

            this.mStateManager.PushState(UIInteriorStoreManager.State.PreviewFurniture);
            this.storeDialog.SetKeyController(null);
        }
Exemplo n.º 9
0
        public void Add(FurnitureModel model)
        {
            Furniture furn = new Furniture
            {
                HourlyCost = model._Price,
                Name       = model._Name
            };

            db.Furnitures.Add(furn);
        }
        private bool IsConfigureJukeBox(FurnitureModel furniture)
        {
            if (furniture == null)
            {
                return(false);
            }
            bool flag = furniture.MstId == 218;

            return(flag | (furniture.MstId == 222));
        }
Exemplo n.º 11
0
        private void OnPushStatePreviewFurniture()
        {
            this.mUIInteriorStoreManagerContents.SetActive(false);
            this.mUserInterfacePortInteriorManager.SetActive(true);
            SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true;
            FurnitureModel selectedFurniture = this.mContext.SelectedFurniture;

            this.mUserInterfacePortInteriorManager.UpdateFurniture(this.mInteriorManager.Deck, selectedFurniture.Type, selectedFurniture);
            this.mUIInteriorFurniturePreviewWaiter.SetKeyController(this.mKeyController);
            this.mUIInteriorFurniturePreviewWaiter.StartWait();
        }
Exemplo n.º 12
0
        private void OnSelectedFurnitureListener(UIFurnitureStoreTabListChild selectedView)
        {
            this.mKeyController.ClearKeyAll();
            this.mKeyController.firstUpdate = true;
            this.mUIFurnitureStoreTabList.LockControl();
            FurnitureModel model = selectedView.GetModel();

            this.mContext.SetSelectedFurniture(model);
            SoundUtils.PlaySE(SEFIleInfos.CommonEnter1);
            this.mStateManager.PushState(UIInteriorStoreManager.State.FurnitureDetailDialog);
        }
Exemplo n.º 13
0
        public void MoveFurnitureEvent(Client player, params object[] arguments)
        {
            int            furnitureId = Int32.Parse((String)arguments[0]);
            float          posX        = float.Parse(((String)arguments[1]).Replace(",", "."));
            float          posY        = float.Parse(((String)arguments[2]).Replace(",", "."));
            float          posZ        = float.Parse(((String)arguments[3]).Replace(",", "."));
            FurnitureModel furniture   = GetFurnitureById(furnitureId);
            Vector3        position    = new Vector3(posX, posY, posZ);

            NAPI.Entity.SetEntityPosition(furniture.handle, position);
        }
        public bool Exchange(FurnitureModel model)
        {
            Api_Result <object> api_Result = new Api_req_furniture().Buy(model.MstId);

            if (api_Result.state != Api_Result_State.Success)
            {
                return(false);
            }
            this._StoreItems.set_Item(model.Type, this._StoreItems.get_Item(model.Type).FindAll((FurnitureModel item) => !item.IsPossession()));
            return(true);
        }
Exemplo n.º 15
0
        private void OnSelectChangeListener()
        {
            this.ChangeFurniture(this.mContext.CurrentCategory, this.mContext.SelectedFurniture);
            FurnitureModel furniture = this.mInteriorManager.GetFurniture(this.mContext.CurrentCategory, this.mContext.SelectedFurniture.MstId);

            this.mContext.SetSelectedFurniture(furniture);
            this.mUIInteriorFurnitureDetail.Initialize(this.mDeckid, this.mContext.SelectedFurniture);
            SoundUtils.PlaySE(this.mAudioClip_CommonEnter1);
            this.mStateManager.PopState();
            this.mStateManager.ResumeState();
        }
Exemplo n.º 16
0
        private Vector2 GenerateDimensionForWindow(FurnitureModel furnitureModel)
        {
            int num  = furnitureModel.NoInType + 1;
            int num2 = num;

            if (num2 == 8)
            {
                return(new Vector2(731f, 400f));
            }
            return(new Vector2(684f, 400f));
        }
Exemplo n.º 17
0
        private Vector2 GenerateDimensionForDesk(FurnitureModel furnitureModel)
        {
            int num  = furnitureModel.NoInType + 1;
            int num2 = num;

            if (num2 == 26 || num2 == 37)
            {
                return(new Vector2(562f, 544f));
            }
            return(new Vector2(530f, 544f));
        }
Exemplo n.º 18
0
        public bool Exchange(FurnitureModel model)
        {
            Api_Result <object> api_Result = new Api_req_furniture().Buy(model.MstId);

            if (api_Result.state != 0)
            {
                return(false);
            }
            _StoreItems[model.Type] = _StoreItems[model.Type].FindAll((FurnitureModel item) => !item.IsPossession());
            return(true);
        }
        public void ChangeFurniture(FurnitureModel model)
        {
            var result = _context.Furnitures.Find(model.Id);

            if (result != null)
            {
                result.Price    = model.Price;
                result.TypeName = model.Name;
                result.TypeName = model.Name ?? result.TypeName;
            }
        }
Exemplo n.º 20
0
        private UIInteriorFurnitureChangeScrollListChildModelNew[] GenerateChildDTOs(int deckId, FurnitureModel[] models)
        {
            List <UIInteriorFurnitureChangeScrollListChildModelNew> list = new List <UIInteriorFurnitureChangeScrollListChildModelNew>();

            for (int i = 0; i < models.Length; i++)
            {
                FurnitureModel model = models[i];
                UIInteriorFurnitureChangeScrollListChildModelNew uIInteriorFurnitureChangeScrollListChildModelNew = new UIInteriorFurnitureChangeScrollListChildModelNew(deckId, model);
                list.Add(uIInteriorFurnitureChangeScrollListChildModelNew);
            }
            return(list.ToArray());
        }
 public ActionResult Create(FurnitureModel p)
 {
     try
     {
         var APIResponse = httpClient.PostAsJsonAsync <FurnitureModel>("http://localhost:8081/api/furniture", p).ContinueWith(postTask => postTask.Result);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 22
0
        public PartialViewResult Partial_GetAllFurnitures()
        {
            FurnitureModel furniture = new FurnitureModel();
            //Get data from Db
            var allFurnituresDal = bll.BllGetAllDataTableFromDb(new Furnitures());

            //Map class on class - return List<1st parameter method>
            DataStorePlace.allFurnituresModel = helpMethod.HandMapper(new FurnitureModel(), allFurnituresDal);
            //Here call a function for creating DropDownList
            furniture.AllFurnituresFromDb = helpMethod.MakeDropDownList(DataStorePlace.allFurnituresModel);
            return(PartialView(furniture));
        }
Exemplo n.º 23
0
        public static Texture LoadTexture(FurnitureModel furnitureModel)
        {
            string text = string.Concat(new object[]
            {
                "Textures/Furnitures/",
                UIFurniture.FurnitureTypeToString(furnitureModel.Type),
                "/",
                furnitureModel.NoInType + 1
            });

            return(Resources.Load(text) as Texture);
        }
        protected override void OnInitialize(UIFurnitureModel uiFurnitureModel)
        {
            base.OnInitialize(uiFurnitureModel);
            FurnitureModel furnitureModel      = uiFurnitureModel.GetFurnitureModel();
            DateTime       dateTime            = uiFurnitureModel.GetDateTime();
            int            outPlaceGraphicType = GetOutPlaceGraphicType(furnitureModel);
            int            outPlaceTimeType    = GetOutPlaceTimeType(dateTime.Hour);
            Texture        mainTexture         = RequestOutPlaceTexture(outPlaceGraphicType, outPlaceTimeType);

            mTexture_WindowBackground.mainTexture = mainTexture;
            mTexture_Teruteru.mainTexture         = mTexture2ds_Teruteru[2];
        }
 public ActionResult Edit(int id, FormCollection collection, FurnitureModel p)
 {
     try
     {
         var APIResponse = httpClient.PutAsJsonAsync("http://localhost:8081/api/furniture/" + id,
                                                     p).ContinueWith(postTask => postTask.Result.EnsureSuccessStatusCode());
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 private void ChangeFurniture(FurnitureKinds furnitureKind, FurnitureModel furnitureModel)
 {
     if (mStateManager.CurrentState == State.FurnitureDetail)
     {
         new Dictionary <FurnitureKinds, int>();
         if (mInteriorManager.ChangeRoom(furnitureKind, furnitureModel.MstId))
         {
             mUserInterfacePortInteriorManager.UpdateFurniture(mInteriorManager.Deck, furnitureKind, furnitureModel);
             mUIInteriorFurnitureChangeScrollList.RefreshViews();
             mUIInteriorFurnitureDetail.QuitState();
         }
     }
 }
Exemplo n.º 27
0
        public FurnitureModel GetFurnitureById(int id)
        {
            FurnitureModel furniture = null;

            foreach (FurnitureModel furnitureModel in furnitureList)
            {
                if (furnitureModel.id == id)
                {
                    furniture = furnitureModel;
                    break;
                }
            }
            return(furniture);
        }
            private static UIFurniture GenerateFurnitureFloorPrefab(FurnitureModel floorFurnitureModel)
            {
                switch (floorFurnitureModel.NoInType + 1)
                {
                case 6:
                    return(Resources.Load <UIFurniture>(FURNITURES_PREFAB_PATH + "/" + DynamicFurniture.DYNAMIC_FURNITURE_6));

                case 23:
                    return(Resources.Load <UIFurniture>(FURNITURES_PREFAB_PATH + "/" + DynamicFurniture.DYNAMIC_FURNITURE_23));

                default:
                    return(Resources.Load <UIFurniture>(FURNITURES_PREFAB_PATH + "/" + STATIC_FURNITURE));
                }
            }
 private void _setRare(FurnitureModel model)
 {
     for (int i = 0; i < this._uiStars.Length; i++)
     {
         if (i < model.Rarity)
         {
             this._uiStars[i].spriteName = "icon_star";
         }
         else
         {
             this._uiStars[i].spriteName = "icon_star_bg";
         }
     }
 }
Exemplo n.º 30
0
 public bool IsConfigureJukeBox()
 {
     using (Dictionary <FurnitureKinds, FurnitureModel> .ValueCollection.Enumerator enumerator = this.mFurnituresSet.get_Values().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             FurnitureModel current = enumerator.get_Current();
             if (this.IsConfigureJukeBox(current))
             {
                 return(true);
             }
         }
     }
     return(false);
 }