Ejemplo n.º 1
0
 // Alle Felder, die NOT NULL sind, werden hier gesetzt.
 public Store(string location, string floor, string companyName, StoreState state, DeliveryOption deliveryOption)
 {
     Location       = location;
     Floor          = floor;
     CompanyName    = companyName;
     State          = state;
     DeliveryOption = deliveryOption;
 }
Ejemplo n.º 2
0
 public void BackToItems()
 {
     if (current_state == StoreState.STATE_STORE)
     {
         current_state = StoreState.STATE_ITEM;
         GetComponent<Animator>().SetTrigger("toItemSelection");
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新店铺状态
 /// </summary>
 /// <param name="storeId">店铺id</param>
 /// <param name="state">状态</param>
 /// <param name="stateEndTime">状态结束时间</param>
 public static void UpdateStoreState(int storeId, StoreState state, DateTime stateEndTime)
 {
     BrnMall.Core.BMAData.RDBS.UpdateStoreState(storeId, state, stateEndTime);
     if (_storenosql != null)
     {
         _storenosql.UpdateStoreState(storeId, state, stateEndTime);
     }
 }
Ejemplo n.º 4
0
        public void StoreStateNextStateIsReadState()
        {
            ILog       mockLog      = Substitute.For <ILog>();
            IConsole   mockConsole  = Substitute.For <IConsole>();
            ITodoList  mockTodoList = Substitute.For <ITodoList>();
            StoreState state        = new StoreState(mockConsole, mockLog, mockTodoList);

            Assert.IsInstanceOfType(state.GetNextState(), typeof(ReadState));
        }
Ejemplo n.º 5
0
        public void StoreStateStoresTextInLog()
        {
            ILog       mockLog      = Substitute.For <ILog>();
            IConsole   mockConsole  = Substitute.For <IConsole>();
            ITodoList  mockTodoList = Substitute.For <ITodoList>();
            StoreState state        = new StoreState(mockConsole, mockLog, mockTodoList);

            state.Input = "This is the entry text";
            state.Execute();

            mockLog.Received(1).AddEntry(Arg.Is <LogEntry>(entry => entry.Text == state.Input));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 更新店铺状态
        /// </summary>
        /// <param name="storeId">店铺id</param>
        /// <param name="state">状态</param>
        /// <param name="stateEndTime">状态结束时间</param>
        public void UpdateStoreState(int storeId, StoreState state, DateTime stateEndTime)
        {
            DbParameter[] parms =
            {
                GenerateInParam("@state",        SqlDbType.TinyInt,  1, (int)state),
                GenerateInParam("@stateendtime", SqlDbType.DateTime, 8, stateEndTime),
                GenerateInParam("@storeid",      SqlDbType.Int,      4, storeId)
            };
            string commandText = string.Format("UPDATE [{0}stores] SET [state]=@state,[stateendtime]=@stateendtime WHERE [storeid]=@storeid",
                                               RDBSHelper.RDBSTablePre);

            RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Set store name
        /// </summary>
        /// <param name="name"></param>
        public void SetStoreName(string name)
        {
            var store = new StoreState();
            int?num   = null;

            if (store.StoreInfo != null)
            {
                num = store.StoreInfo.StoreNumber;
            }
            var info = new StoreInfo {
                StoreName = name, StoreNumber = num
            };

            store.StoreInfo = info;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Set store id
        /// </summary>
        /// <param name="id"></param>
        public void SetStoreId(int id)
        {
            var    store = new StoreState();
            string name  = string.Empty;

            if (store.StoreInfo != null)
            {
                name = store.StoreInfo.StoreName;
            }
            var info = new StoreInfo {
                StoreNumber = id, StoreName = name
            };

            store.StoreInfo = info;
        }
Ejemplo n.º 9
0
    public override void _Ready()
    {
        _stateMachine = new StateMachine();
        _menuState    = new MenuState(this, _stateMachine);
        _storeState   = new StoreState(this, _stateMachine);
        _sceneChanger = GetTree().Root.GetNode <SceneChanger>("SceneChanger");

        _levelLabel = GetNode <Label>("MenuPanel/Level");
        _global     = GetTree().Root.GetNode <Global>("Global");
        _jumpScreen = GetNode <JumpScreen>("JumpScreen");

        _stateMachine.Initialize(_menuState);
        UpdateView();

        _jumpScreen.EnterAnimation();
    }
Ejemplo n.º 10
0
 public void Close()
 {
     lock (lockthis)
     {
         if (state == StoreState.Closing || state == StoreState.Closed)
         {
             return;
         }//正关闭或已关闭的返回.
         state = StoreState.Closing;
     }
     Logger.Info("开始关闭引擎...");
     lock (lockthis)
     {
         foreach (Database db in databases.Values)
         {
             db.Close();
         }
         state = StoreState.Closed;
     }
     Logger.Info("引擎关闭");
 }
Ejemplo n.º 11
0
 public void Open()
 {
     lock (lockthis)
     {
         if (state == StoreState.Opening || state == StoreState.Opened)
         {
             return;
         }//正打开或已打开的返回.
         state = StoreState.Opening;
     }
     Logger.Info("开始启动引擎...");
     lock (lockthis)
     {
         foreach (Database db in databases.Values)
         {
             db.Open();
         }
         state = StoreState.Opened;
     }
     Logger.Info("引擎启动完毕");
 }
Ejemplo n.º 12
0
        public virtual Store ToModel(Store store)
        {
            if (store == null)
            {
                throw new ArgumentNullException(nameof(store));
            }

            store.Id                             = Id;
            store.AdminEmail                     = AdminEmail;
            store.Catalog                        = Catalog;
            store.Country                        = Country;
            store.CreatedBy                      = CreatedBy;
            store.CreatedDate                    = CreatedDate;
            store.DefaultCurrency                = DefaultCurrency;
            store.DefaultLanguage                = DefaultLanguage;
            store.Description                    = Description;
            store.DisplayOutOfStock              = DisplayOutOfStock;
            store.Email                          = Email;
            store.ModifiedBy                     = ModifiedBy;
            store.ModifiedDate                   = ModifiedDate;
            store.Name                           = Name;
            store.Region                         = Region;
            store.SecureUrl                      = SecureUrl;
            store.TimeZone                       = TimeZone;
            store.Url                            = Url;
            store.MainFulfillmentCenterId        = FulfillmentCenterId;
            store.MainReturnsFulfillmentCenterId = ReturnsFulfillmentCenterId;

            store.StoreState    = EnumUtility.SafeParse(StoreState.ToString(), Core.Model.StoreState.Open);
            store.Languages     = Languages.Select(x => x.LanguageCode).ToList();
            store.Currencies    = Currencies.Select(x => x.CurrencyCode).ToList();
            store.TrustedGroups = TrustedGroups.Select(x => x.GroupName).ToList();
            store.AdditionalFulfillmentCenterIds = FulfillmentCenters.Where(x => x.Type == FulfillmentCenterType.Main).Select(x => x.FulfillmentCenterId).ToList();
            store.ReturnsFulfillmentCenterIds    = FulfillmentCenters.Where(x => x.Type == FulfillmentCenterType.Returns).Select(x => x.FulfillmentCenterId).ToList();
            // SeoInfos
            store.SeoInfos = SeoInfos.Select(x => x.ToModel(AbstractTypeFactory <SeoInfo> .TryCreateInstance())).ToList();

            return(store);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 更新店铺状态
 /// </summary>
 /// <param name="storeId">店铺id</param>
 /// <param name="state">状态</param>
 /// <param name="stateEndTime">状态结束时间</param>
 public static void UpdateStoreState(int storeId, StoreState state, DateTime stateEndTime)
 {
     BrnMall.Data.Stores.UpdateStoreState(storeId, state, stateEndTime);
 }
Ejemplo n.º 14
0
    public async void SetState(Type stateType)
    {
        GameState state = null;

        if (stateType == typeof(LoginState))
        {
            GameStateModel model = GameStateFactory
                                   .Instance
                                   .CreateModel <LoginStateModel>();
            GameStateView view = await GameStateFactory
                                 .Instance
                                 .CreateViewAsync <LoginStateView>("LoginStateView");

            LoginState loginState = GameStateFactory
                                    .Instance
                                    .CreateState <LoginState>(model, view);
            state = loginState;
        }
        else if (stateType == typeof(LobbyState))
        {
            GameStateModel model = GameStateFactory
                                   .Instance
                                   .CreateModel <LobbyStateModel>();
            GameStateView view = await GameStateFactory
                                 .Instance
                                 .CreateViewAsync <LobbyStateView>("LobbyStateView");

            LobbyState lobbyState = GameStateFactory
                                    .Instance
                                    .CreateState <LobbyState>(model, view);
            state = lobbyState;
        }
        else if (stateType == typeof(InventoryState))
        {
            GameStateModel model = GameStateFactory
                                   .Instance
                                   .CreateModel <InventoryStateModel>();
            GameStateView view = await GameStateFactory
                                 .Instance
                                 .CreateViewAsync <InventoryStateView>("InventoryStateView");

            InventoryState inventoryState = GameStateFactory
                                            .Instance
                                            .CreateState <InventoryState>(model, view);
            state = inventoryState;
        }
        else if (stateType == typeof(StoreState))
        {
            GameStateModel model = GameStateFactory
                                   .Instance
                                   .CreateModel <StoreStateModel>();
            GameStateView view = await GameStateFactory
                                 .Instance
                                 .CreateViewAsync <StoreStateView>("StoreStateView");

            StoreState storeState = GameStateFactory
                                    .Instance
                                    .CreateState <StoreState>(model, view);
            state = storeState;
        }
        else if (stateType == typeof(IngameState))
        {
            GameStateModel model = GameStateFactory
                                   .Instance
                                   .CreateModel <IngameStateModel>();
            GameStateView view = await GameStateFactory
                                 .Instance
                                 .CreateViewAsync <IngameStateView>("IngameStateView");

            IngameState ingameState = GameStateFactory
                                      .Instance
                                      .CreateState <IngameState>(model, view);
            state = ingameState;
        }
        else if (stateType == typeof(LeaderboardState))
        {
            GameStateModel model = GameStateFactory
                                   .Instance
                                   .CreateModel <LeaderboardStateModel>();
            GameStateView view = await GameStateFactory
                                 .Instance
                                 .CreateViewAsync <LeaderboardStateView>("LeaderboardStateView");

            LeaderboardState leaderboardState = GameStateFactory
                                                .Instance
                                                .CreateState <LeaderboardState>(model, view);
            state = leaderboardState;
        }
        else
        {
            // do the catch
            Debug.LogError("Setting state for an unknown state type " + stateType.GetType());
        }

        if (state != null)
        {
            SwitchState(state);
        }
    }
Ejemplo n.º 15
0
        /// <summary>
        /// 查询数据
        /// </summary>
        private void GetData()
        {
            if (HidQueryFlag.Value != null)
            {
                if (!string.IsNullOrEmpty(HidQueryFlag.Value.ToString()))
                {
                    string    query = HidQueryFlag.Value.ToString();
                    DataTable dt    = null;
                    switch (query)
                    {
                    case "1":
                        this.GridState.ColumnModel.SetColumnHeader(0, GetLangStr("DeviceStatus3", "监测点名称"));
                        QueryData.Value = GetWhere();
                        dt = deviceManager.GetStationDeviceState("*", QueryData.Value.ToString());
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            Button2.Disabled      = false;
                            Session["datatable"]  = dt;
                            StoreState.DataSource = dt;
                            StoreState.DataBind();
                        }
                        else
                        {
                            Button2.Disabled     = true;
                            Session["datatable"] = null;
                            Notice(GetLangStr("DeviceStatus4", "提示信息"), GetLangStr("DeviceStatus5", "没查询到数据"));
                            StoreState.DataSource = dt;
                            StoreState.DataBind();
                        }
                        break;

                    case "2":
                        this.GridState.ColumnModel.SetColumnHeader(0, GetLangStr("DeviceStatus6", "设备类型"));
                        QueryData.Value = GetWhere2();
                        dt = deviceManager.GetNoDeviceState("*", QueryData.Value.ToString());
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            Button2.Disabled      = false;
                            Session["datatable"]  = dt;
                            StoreState.DataSource = dt;
                            StoreState.DataBind();
                        }
                        else
                        {
                            Button2.Disabled     = true;
                            Session["datatable"] = null;
                            Notice(GetLangStr("DeviceStatus4", "提示信息"), GetLangStr("DeviceStatus7", "没查询到数据"));
                            StoreState.DataSource = dt;
                            StoreState.DataBind();
                        }
                        break;

                    case "3":
                        this.GridState.ColumnModel.SetColumnHeader(0, GetLangStr("DeviceStatus8", "服务器类型"));
                        QueryData.Value = GetWhere2();
                        dt = deviceManager.GetServiceState("*", QueryData.Value.ToString());
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            Button2.Disabled      = false;
                            Session["datatable"]  = dt;
                            StoreState.DataSource = dt;
                            StoreState.DataBind();
                        }
                        else
                        {
                            Button2.Disabled     = true;
                            Session["datatable"] = null;
                            Notice(GetLangStr("DeviceStatus4", "提示信息"), GetLangStr("DeviceStatus7", "没查询到数据"));
                            StoreState.DataSource = new DataTable();
                            StoreState.DataBind();
                        }
                        break;
                    }
                    string js = "ChangeHeaderInfo(\"" + query + "\");";
                    this.ResourceManager1.RegisterBeforeClientInitScript(js);
                }
            }
        }
Ejemplo n.º 16
0
    public override bool IsValid(Mom entity)
    {
        string[] lines       = entity.currentState.text.Split('\n');
        string   lastLine    = lines[lines.Length - 1];
        string   currentLine = "";

        switch (nextState)
        {
        case 0:
            currentLine = "Checking Child";
            if (lastLine != currentLine)
            {
                entity.currentState.text += "\n" + currentLine;
            }

            entity.child.money += entity.money;
            entity.money        = 0;
            StoreState storeState = new StoreState();
            if (storeState.IsValid(entity.child))
            {
                entity.child.currentState.text += "\nReady";
                return(true);
            }
            break;

        case 1:
            currentLine = "Checking Stove";
            if (lastLine != currentLine)
            {
                entity.currentState.text += "\n" + currentLine;
            }

            entity.stove.food = entity.food;
            CookingState cookingState = new CookingState();
            if (cookingState.IsValid(entity.stove))
            {
                entity.stove.currentState.text += "\nReady";
                return(true);
            }
            break;

        case 2:
            currentLine = "Checking Washer";
            if (lastLine != currentLine)
            {
                entity.currentState.text += "\n" + currentLine;
            }

            WashingState washingState = new WashingState();
            if (washingState.IsValid(entity.washer))
            {
                entity.washer.currentState.text += "\nReady";
                return(true);
            }
            break;

        default:
            return(true);
        }
        return(false);
    }
Ejemplo n.º 17
0
	protected void ProcessNotTouch()
	{
		if( nowState == StoreState.NOTOUCH)
		{
			if( fNotTouchPassTime >= fNotTouchTime)
			{
				nowState = StoreState.NORMAL;
				fNotTouchPassTime = 0.0f;
				LockInput( false);

				if( AsCashStore.Instance != null)
					AsCashStore.Instance.HideLoadingIndigator();
			}
			else
				fNotTouchPassTime += Time.deltaTime;
		}
	}
Ejemplo n.º 18
0
	protected virtual void Cancel()
	{
		nowState = StoreState.NOTOUCH;
	}
Ejemplo n.º 19
0
        private GenericValidator ProcessRecord(DataRowView dv)
        {
            var gVal = new GenericValidator();

            if (dv == null)
            {
                gVal.Code  = -1;
                gVal.Error = "An unknown error was encountered.";
                return(gVal);
            }
            try
            {
                using (var db = _db)
                {
                    var mInfo = new UserProfile
                    {
                        LastName = dv.Row["Last_Name"].ToString().Trim(),
                        IsActive = true
                    };

                    var outletName = dv.Row["Outlet"].ToString().Trim();
                    if (string.IsNullOrEmpty(outletName))
                    {
                        gVal.Error = "Please provide outlet.";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    var outlets = db.StoreOutlets.Where(o => o.OutletName.Trim().ToLower() == outletName.ToLower().Trim()).ToList();
                    if (!outlets.Any())
                    {
                        gVal.Error = "Outlet information could not be found.";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    var outlet = outlets[0];

                    var otherNames = dv.Row["Other_Names"].ToString();
                    if (string.IsNullOrEmpty(otherNames))
                    {
                        gVal.Error = "Please provide other names.";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    mInfo.OtherNames = otherNames;

                    var email = dv.Row["Email"].ToString().Trim();

                    if (!string.IsNullOrEmpty(email))
                    {
                        mInfo.ContactEmail = email;
                    }

                    var mobilNumber = dv.Row["Mobile_Number"].ToString().Trim();

                    if (string.IsNullOrEmpty(mobilNumber))
                    {
                        gVal.Error = "Please provide customer's phone number";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    mInfo.MobileNumber = mobilNumber;

                    var cInfo = new Customer
                    {
                        StoreOutletId = outlet.StoreOutletId
                    };

                    var gender = dv.Row["Gender"].ToString().Trim();

                    var customerType = dv.Row["Customer_Type(eg: Retail Customer)"].ToString().Trim();

                    if (string.IsNullOrEmpty(customerType))
                    {
                        gVal.Error = "Please provide customer type";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    var types = db.StoreCustomerTypes.Where(c => c.Name.ToLower().Trim() == customerType.ToLower().Trim()).ToList();
                    if (types.Any())
                    {
                        cInfo.StoreCustomerTypeId = types[0].StoreCustomerTypeId;
                    }
                    else
                    {
                        var newCustomerType = new StoreCustomerType
                        {
                            Name         = customerType,
                            Code         = customerType,
                            CreditWorthy = false,
                            CreditLimit  = 0
                        };

                        var processedType = db.StoreCustomerTypes.Add(newCustomerType);
                        db.SaveChanges();
                        cInfo.StoreCustomerTypeId = processedType.StoreCustomerTypeId;
                    }

                    var duplicates = db.UserProfiles.Count(m => m.MobileNumber.Trim() == mInfo.MobileNumber.Trim());
                    if (duplicates > 0)
                    {
                        gVal.Error = "Customer already Exists.";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    var newAddress = new DeliveryAddress
                    {
                        MobileNumber = mobilNumber,
                        ContactEmail = email
                    };

                    var countryName = dv.Row["Country_Name"].ToString().Trim();

                    if (string.IsNullOrEmpty(countryName))
                    {
                        gVal.Error = "Please provide Country";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    long countryId = 0;
                    var  countries = db.StoreCountries.Where(c => c.Name.ToLower().Trim() == countryName.ToLower().Trim()).ToList();
                    if (countries.Any())
                    {
                        countryId = countries[0].StoreCountryId;
                    }
                    else
                    {
                        var newCountry = new StoreCountry
                        {
                            Name = countryName
                        };

                        var processedCountry = db.StoreCountries.Add(newCountry);
                        db.SaveChanges();
                        countryId = processedCountry.StoreCountryId;
                    }

                    var stateName = dv.Row["State_Name"].ToString().Trim();

                    if (string.IsNullOrEmpty(stateName))
                    {
                        gVal.Error = "Please provide State";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    long stateId = 0;

                    var states = db.StoreStates.Where(c => c.Name.ToLower().Trim() == stateName.ToLower().Trim()).ToList();
                    if (states.Any())
                    {
                        stateId = states[0].StoreStateId;
                    }
                    else
                    {
                        var newState = new StoreState
                        {
                            Name           = stateName,
                            StoreCountryId = countryId
                        };

                        var processedState = db.StoreStates.Add(newState);
                        db.SaveChanges();
                        stateId = processedState.StoreStateId;
                    }

                    var cityName = dv.Row["City_Name"].ToString().Trim();

                    if (string.IsNullOrEmpty(cityName))
                    {
                        gVal.Error = "Please provide City";
                        gVal.Code  = -1;
                        return(gVal);
                    }

                    var cities = db.StoreCities.Where(c => c.Name.ToLower().Trim() == cityName.ToLower().Trim()).ToList();
                    if (cities.Any())
                    {
                        newAddress.CityId = cities[0].StoreCityId;
                    }
                    else
                    {
                        var newCity = new StoreCity
                        {
                            Name         = cityName,
                            StoreStateId = stateId
                        };

                        var processedCity = db.StoreCities.Add(newCity);
                        db.SaveChanges();
                        newAddress.CityId = processedCity.StoreCityId;
                    }

                    var address = dv.Row["Street_Address"].ToString().Trim();
                    if (string.IsNullOrEmpty(address))
                    {
                        gVal.Error = "Please provide Customer Address";
                        gVal.Code  = -1;
                        return(gVal);
                    }
                    newAddress.AddressLine1 = address;

                    if (!string.IsNullOrEmpty(gender))
                    {
                        mInfo.Gender = gender;
                    }

                    var processedUser = db.UserProfiles.Add(mInfo);
                    db.SaveChanges();

                    cInfo.UserId = processedUser.Id;
                    var processedCustomer = db.Customers.Add(cInfo);
                    db.SaveChanges();


                    newAddress.CustomerId = processedCustomer.CustomerId;
                    db.DeliveryAddresses.Add(newAddress);
                    db.SaveChanges();

                    gVal.Error = "Customer information was successfully processed";
                    gVal.Code  = processedUser.Id;
                    return(gVal);
                }
            }
            catch (Exception ex)
            {
                ErrorLogger.LogError(ex.StackTrace, ex.Source, ex.Message);
                gVal.Code  = -1;
                gVal.Error = "An unknown error was encountered.";
                return(gVal);
            }
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Set flag is call center or not
        /// </summary>
        /// <param name="flag"></param>
        public void IsCallCenter(bool flag)
        {
            var store = new StoreState();

            store.ClientPriorityBooking = flag;
        }
Ejemplo n.º 21
0
	public void PrepareBuyNowTouchItem( StoreTouchInfo _touchInfo)
	{
		nowTouchInfo = _touchInfo;
		SelectStoreItem( nowTouchInfo);
		prevTouchInfo = nowTouchInfo;
		LockInput( true);
		isDownStoreOut = false;
		nowState = StoreState.QUANTITY_BUY;

		AsSoundManager.Instance.PlaySound( AsSoundPath.ButtonClick, Vector3.zero, false);

		nowStoreItemInfo = nowTouchInfo.storeItemController.GetStoreItemInfo( nowTouchInfo.type);

		PrepareBuyItemEvent( nowStoreItemInfo);
	}
Ejemplo n.º 22
0
	public void SetTooltipClick()
	{
		LockInput( true);
		isDownStoreOut = false;
		nowState = StoreState.QUANTITY_BUY;
		nowStoreItemInfo = nowTouchInfo.storeItemController.GetStoreItemInfo( nowTouchInfo.type);
		PrepareBuyItemEvent( nowStoreItemInfo);
	}
Ejemplo n.º 23
0
	public virtual void ProcessUpClick()
	{
		if( scrollList == null || nowState == StoreState.NOTOUCH)
		{
			isClicked = false;
			return;
		}

		if( scrollList.IsAutoScrolling == true || scrollList.IsScrolling == true)
		{
			isClicked = false;
			return;
		}

		if( IsLockInput == true)
		{
			isClicked = false;
			return;
		}

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			if( isClicked == false)
				return;

			fClickTimePassed += Time.deltaTime;

			if( fClickTimePassed >= fDClickTime)
			{
				nowTouchInfo = OneClickTouchInfo;
				SelectStoreItem( nowTouchInfo);
				prevTouchInfo = nowTouchInfo;
				fStationaryPassTime = 0.0f;
				nowState = StoreState.SELECT;

				StoreItemInfoUI storeItemInfo = nowTouchInfo.storeItemController.GetStoreItemInfo( nowTouchInfo.type);

				PlayItemSound( storeItemInfo);

				if( storeItemInfo == null)
				{
					fClickTimePassed = 0.0f;
					isClicked = false;
					return;
				}

				/*
				// exception gold item
				if( storeItemInfo.item_Type == Store_Item_Type.NormalItem)
				{
					int itemID = System.Convert.ToInt32( storeItemInfo.itemID);
					Item itemData = ItemMgr.ItemManagement.GetItem( itemID);

					if( itemData.ItemData.GetItemType() == Item.eITEM_TYPE.EtcItem)
					{
						if( itemData.ItemData.GetSubType() == ( int)Item.eEtcItem.Gold)
						{
							fClickTimePassed = 0.0f;
							isClicked = false;
							PrepareBuyNowTouchItem( nowTouchInfo);
							return;
						}
					}
				}
				*/
				// exception miracle
				if( storeItemInfo.item_Type == Store_Item_Type.ChargeItem)
				{
					fClickTimePassed = 0.0f;
					isClicked = false;
					PrepareBuyNowTouchItem( nowTouchInfo);
					return;
				}

				if( storeItemInfo.item_Type == Store_Item_Type.NormalItem)
				{
					int itemID = System.Convert.ToInt32( storeItemInfo.itemID);
					Item itemData = ItemMgr.ItemManagement.GetItem( itemID);

					if( itemData != null)
					{
						RealItem haveitem = null;

						if( Item.eITEM_TYPE.EquipItem == itemData.ItemData.GetItemType())
							haveitem = ItemMgr.HadItemManagement.Inven.GetEquipItem( itemData.ItemData.GetSubType());
						else if( Item.eITEM_TYPE.CosEquipItem == itemData.ItemData.GetItemType())
							haveitem = ItemMgr.HadItemManagement.Inven.GetCosEquipItem( itemData.ItemData.GetSubType());

						OpenTooltip( haveitem, itemData, this, "SetTooltipClick", -1, storeItemInfo.itemSlot);
					}
				}

				fClickTimePassed = 0.0f;
				isClicked = false;
			}
		}
	}
Ejemplo n.º 24
0
	public void TransitionEndDelegate( EZTransition transition)
	{
		nowState = StoreState.NOTOUCH;
	}
Ejemplo n.º 25
0
	private void ChangeClassTypeDelegate( ref POINTER_INFO ptr)
	{
		if( ptr.evt != POINTER_INFO.INPUT_EVENT.TAP)
			return;

		AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false);

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT || nowState == StoreState.CHANGE_CLASS)
		{
			if( ptr.hitInfo.collider.gameObject == classTypeBtn.gameObject)
			{
				if( isShowClassPopup == false)
				{
					isShowClassPopup = true;
					LockInput( true);
					nowState = StoreState.CHANGE_CLASS;
					classTypePanel.StartTransition( UIPanelManager.SHOW_MODE.BringInForward);
				}
				else
				{
					isShowClassPopup = false;
					classTypePanel.StartTransition( UIPanelManager.SHOW_MODE.BringInBack);
				}
			}
			else
			{
				UIRadioBtn button = ( UIRadioBtn)ptr.targetObj;
				nowClass = ( eCLASS)button.data;
				textClass.Text = button.spriteText.Text;
				isShowClassPopup = false;
				RepositionKindBtn( nowNpcID, nowClass);
				SetStoreItem( nowNpcID, nowClass);
				classTypePanel.StartTransition( UIPanelManager.SHOW_MODE.BringInBack);
			}
		}
	}
Ejemplo n.º 26
0
 /// <summary>
 /// 更新店铺状态
 /// </summary>
 /// <param name="storeId">店铺id</param>
 /// <param name="state">状态</param>
 /// <param name="stateEndTime">状态结束时间</param>
 public static void UpdateStoreState(int storeId, StoreState state, DateTime stateEndTime)
 {
     NStore.Data.Stores.UpdateStoreState(storeId, state, stateEndTime);
 }
Ejemplo n.º 27
0
    void HandleModelSelection(RaycastHit hit)
    {
        switch (hit.transform.tag)
        {

            case "LawnMowerRed":
            case "LawnMowerBlue":
                playerChoice.model = "BaseMower";
                player.GetComponent<SocketEquipment>().SocketItems(itemSocketArray, playerChoice.model);

                Transform BaseMower = (Transform)Instantiate(Resources.Load<Transform>("PlayerModelBase"), player.transform.position, player.transform.rotation);
                BaseMower.parent = player.transform;

                player.GetComponent<Transform>().position = new Vector3(7.5f, 2.35f, 7.4f);

                current_state = StoreState.STATE_ITEM;
                GetComponent<Animator>().SetTrigger("toItemSelection");
                break;

            case "LawnMowerSmall":
                playerChoice.model = "AeroMower";
                player.GetComponent<SocketEquipment>().SocketItems(itemSocketArray, playerChoice.model);

                Transform AeroMower = (Transform)Instantiate(Resources.Load<Transform>("PlayerModelAero"), player.transform.position, player.transform.rotation);
                AeroMower.Rotate(0.0f, 90.0f, 0.0f, Space.World);
                AeroMower.parent = player.transform;
                AeroMower.transform.localPosition += new Vector3(0.01f, 0.0f, 0.24f);

                player.GetComponent<Transform>().position = new Vector3(7.5f, 2.45f, 7.4f);

                current_state = StoreState.STATE_ITEM;
                GetComponent<Animator>().SetTrigger("toItemSelection");
                break;

        }
        colourChange = true;
    }
Ejemplo n.º 28
0
        /// <summary>
        /// Get is call center or not
        /// </summary>
        /// <returns></returns>
        public bool IsCallCenter()
        {
            var store = new StoreState();

            return(!store.ClientPriorityBooking);
        }
Ejemplo n.º 29
0
 /// <summary>
 /// 更新店铺状态
 /// </summary>
 /// <param name="storeId">店铺id</param>
 /// <param name="state">状态</param>
 /// <param name="stateEndTime">状态结束时间</param>
 public void UpdateStoreState(int storeId, StoreState state, DateTime stateEndTime)
 {
     DbParameter[] parms = {
                             GenerateInParam("@state", SqlDbType.TinyInt,1,(int)state),
                             GenerateInParam("@stateendtime", SqlDbType.DateTime,8,stateEndTime),
                             GenerateInParam("@storeid", SqlDbType.Int,4,storeId)
                            };
     string commandText = string.Format("UPDATE [{0}stores] SET [state]=@state,[stateendtime]=@stateendtime WHERE [storeid]=@storeid",
                                         RDBSHelper.RDBSTablePre);
     RDBSHelper.ExecuteNonQuery(CommandType.Text, commandText, parms);
 }
Ejemplo n.º 30
0
	public void InputOverTwoTouchUp( Ray _ray)
	{
		// cancel move
		if( nowState == StoreState.DRAG && isDraingItem == true)
		{
			//Drop ÀÛ¾÷
			isDraingItem = false;

			LockInput( false);

			if( nowSelectIcon != null)
			{
				ReleaseStoreItem( nowTouchInfo);
				GameObject.DestroyImmediate( nowSelectIcon);
				nowSelectIcon = null;
				nowSelectIcon = null;
				nowState = StoreState.NORMAL;
	
				if( ReleaseBuyItemEvent != null)
					ReleaseBuyItemEvent( _ray);
			}
		}
	}
Ejemplo n.º 31
0
	public void InputDelegate( ref POINTER_INFO ptr)
	{
		if( scrollList == null)
			return;

		if( scrollList.IsScrolling == false)
			return;

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			if( ptr.evt == POINTER_INFO.INPUT_EVENT.DRAG && prevTouchInfo != null)
			{
				ReleaseStoreItem( prevTouchInfo);

				if( TooltipMgr.Instance != null)
					TooltipMgr.Instance.Clear();

				nowState = StoreState.NORMAL;
			}
		}
	}
Ejemplo n.º 32
0
        public void IsOffshoreCallCenter(int GroupID)
        {
            var store = new StoreState();

            store.IsOffShoreCallcenter = (GroupID == 8);
        }
Ejemplo n.º 33
0
	// InputUp
	public virtual void InputUp( Ray _ray)
	{
		if( scrollList == null || nowState == StoreState.NOTOUCH)
			return;

		if( scrollList.IsAutoScrolling == true || scrollList.IsScrolling == true)
			return;

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			StoreTouchInfo touchInfo = FindClickStoreItem( _ray);

			if( touchInfo.type != StoreTouchType.STORE_TOUCH_NONE)
			{
				if( isDownStoreOut == false)
				{
					if( isClicked == false)
					{
						OneClickTouchInfo = touchInfo;
						isClicked = true;
					}
					else // doubleClick
					{
						isClicked = false;
						fClickTimePassed = 0.0f;
						TwoClickTouchInfo = touchInfo;
						ProcessDClickUp();
					}
				}

				if( isDownStoreOut == true)
					isDownStoreOut = false;
			}
		}

		if( nowState == StoreState.DRAG && isDraingItem == true)
		{
			//Drop ÀÛ¾÷
			isDraingItem = false;

			LockInput( false);

			if( nowSelectIcon != null)
			{
				//ReleaseStoreItem( nowTouchInfo);
				GameObject.DestroyImmediate( nowSelectIcon);
				nowSelectIcon = null;
				nowSelectIcon = null;
				nowState = StoreState.NOTOUCH;
	
				if( ReleaseBuyItemEvent != null)
					ReleaseBuyItemEvent( _ray);
			}
		}

		if( AsHudDlgMgr.Instance != null)
		{
			if( true == AsHudDlgMgr.Instance.IsOpenInven)
			{
				if( true == AsHudDlgMgr.Instance.invenDlg.IsRect( _ray))
					isDownStoreOut = false;
			}
		}
	}
Ejemplo n.º 34
0
 /// <summary>
 /// 更新店铺状态
 /// </summary>
 /// <param name="storeId">店铺id</param>
 /// <param name="state">状态</param>
 /// <param name="stateEndTime">状态结束时间</param>
 public static void UpdateStoreState(int storeId, StoreState state, DateTime stateEndTime)
 {
     BrnMall.Core.BMAData.RDBS.UpdateStoreState(storeId, state, stateEndTime);
     if (_storenosql != null)
         _storenosql.UpdateStoreState(storeId, state, stateEndTime);
 }
Ejemplo n.º 35
0
	public virtual void InputMove( Ray _ray)
	{
		if (isLockInput == true)
			return;

		if( scrollList == null || nowState == StoreState.NOTOUCH)
			return;

		if( scrollList.IsAutoScrolling == true || isDownStoreOut == true || scrollList.IsScrolling == true)
			return;

		if( nowState == StoreState.NORMAL || nowState == StoreState.SELECT)
		{
			if( isDraingItem == true)
				return;

			StoreTouchInfo touchInfo = FindClickStoreItem( _ray);

			if( touchInfo.type == StoreTouchType.STORE_TOUCH_NONE)
				return;

			nowTouchInfo = touchInfo;

			fStationaryPassTime += Time.deltaTime;

			if( fStationaryPassTime >= fStationaryTime)
			{
				LockInput( true);

				SelectStoreItem( nowTouchInfo);

				prevTouchInfo = nowTouchInfo;

				StoreItemInfoUI itemInfo = touchInfo.storeItemController.GetStoreItemInfo();

				// test
				if( itemInfo.item_Type == Store_Item_Type.NormalItem)
					nowSelectIcon = GetItemIcon( itemInfo.itemID, itemInfo.itemBunch);
				else
					nowSelectIcon = GetItemIcon( "90000", 1);

				Vector3 nowMousePos = AsInputManager.Instance.UICamera.ScreenToWorldPoint( Input.mousePosition);
				touchOffset = nowTouchInfo.touchObject.transform.position - nowMousePos;
				isDraingItem = true;

				fStationaryPassTime = 0.0f;

				if( TooltipMgr.Instance != null)
					TooltipMgr.Instance.Clear();
	
				nowState = StoreState.DRAG;
			}
		}
	}
Ejemplo n.º 36
0
    void controllerHighlight()
    {
        if (current_state == StoreState.STATE_ITEM)
        {
            foreach (ItemSelectorMulti item in possibleObjects)
            {
                item.highlighted = false;
            }
            if (controllerSelected >= possibleObjects.Length)
            {
                controllerSelected = 0;
            }
            if (controllerSelected < 0)
            {
                controllerSelected = possibleObjects.Length - 1;
            }
            possibleObjects[controllerSelected].highlighted = true;
            controllerSliders();
            if (Input.GetButtonDown(controllerA) && possibleObjects[controllerSelected].isUI == false)
            {
                HandleItemSelection(possibleObjects[controllerSelected]);
            }
            if(Input.GetButtonDown(controllerX))
            {
                controllerSelected -= 1;
            }
            if (Input.GetButtonDown(controllerB))
            {
                controllerSelected += 1;
            }
        }
        else
        {
            if (Input.GetButtonDown(controllerA))
            {
                player.GetComponent<Transform>().Translate(new Vector3(0, 5.75f, 0), Space.World);

                current_state = StoreState.STATE_ITEM;
                GetComponent<Animator>().SetTrigger("toItemSelection");
            }
        }
    }
Ejemplo n.º 37
0
    void HandleItemSelection(RaycastHit hit)
    {
        selectedSocket = Socket.EMPTY;
        switch (hit.transform.tag){

            case "Phone_Model":
                if (current_state == StoreState.STATE_ITEM)
                {
                    current_state = StoreState.STATE_STORE;
                    GetComponent<Animator>().SetTrigger("toStoreSelection");
                }
                break;

            case "Item_Handle":
                selectedEquipment = Equipment.Item_Handle;
                break;

            case "Item_BasicEngine":
                selectedEquipment = Equipment.Item_BasicEngine;
                break;

            case "Item_Spike":
                selectedEquipment = Equipment.Item_Spike;
                break;

            case "Item_Flipper":
                selectedEquipment = Equipment.Item_Flipper;
                break;

            case "Item_Booster":
                selectedEquipment = Equipment.Item_Booster;
                break;

            case "Item_MetalShield":
                selectedEquipment = Equipment.Item_MetalShield;
                break;

            case "Item_CircularSaw":
                selectedEquipment = Equipment.Item_CircularSaw;
                break;

            case "Item_Hammer":
                selectedEquipment = Equipment.Item_Hammer;
                break;

            case "Item_PlasmaShield":
                selectedEquipment = Equipment.Item_PlasmaShield;
                break;

            case "Item_TeslaCoil":
                selectedEquipment = Equipment.Item_TeslaCoil;
                break;
        }
        bool available = false;

        foreach(Equipment eq in AvailableItems)
        {
            if (selectedEquipment.Equals(eq))
            {
                available = true;
            }
        }
        if (!available)
        {
            selectedEquipment = Equipment.EMPTY;
        }
    }