public void ShowShop(Shop shop)
 {
     for (int i = 0; i < slots.Length; i++)
     {
         slots[i].SetShop(shop);
     }
 }
 public void TestStaticPropertyCrash()
 {
     Product toaster = new Product { Name = "toaster" };
     Shop shop = new Shop { Products = { toaster } };
     ObjectGraph graph = new ObjectGraph(shop);
     graph.Collapse();
 }
	public void AddShop(int shopId , Shop shop){
		if(shopDic.ContainsKey(shopId)){
			shopDic[shopId] = shop;
			return;
		}
		shopDic.Add(shopId , shop);
	}
Exemple #4
0
 public JsonResult AddShopByUser(AddShopByUserPostModel model)
 {
     var result = new AddShopByUserPostResult();
     using (var db = DbContextFactory.CreateDbContext())
     {
         Account acc;
         if (TokenXCodeValidation.Validate(model, db, out acc))
         {
             var shop = new Shop()
             {
                 Account = acc,
                 ShopUrl = model.Url,
                 ShopUserName = model.ShopUserName,
                 SiteType = model.SiteType ,
                 QQ = model.QQ,
                 Tel = model.Tel
             };
             db.Shops.Add(shop);
             db.SaveChanges();
             result.ShopId = shop.Id;
             result.IsOk = true;
         }
         else
         {
             throw new HttpException(Resources.ErrorReLogin); 
         }
     }
     return new JsonResult() { Data = result };
 }
    // Use this for initialization
    void Start()
    {
        shop = transform.root.gameObject.GetComponent<Shop>();

        itemList = new List<SpeciesData>(shop.itemList.Values);
        itemList.Sort(ComparisonTypes.SortByTrophicLevels);
    }
Exemple #6
0
 public ActionResult Edit(Shop model)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return View(model);
         }
         model.RecordStatus = EnumRecordStatus.EDIT.ToString();
         model.SysCode = SecurityPortal.ApplicationName;
         BusinessResult result = BusinessPortal.Save(model);
         if (result.ResultType == 0)
         {
             this.ShowMessage(CSC.Resources.BusinessResultMessage.INF_SAVE_SUCCEED, isSucessed: true);
         }
         else
         {
             this.ShowMessage(result.GetMessage(), isSucessed: false);
         }
         return View(model);
     }
     catch (Exception ex)
     {
         this.ShowMessage(ex.Message, isSucessed: false);
         return View(model);
     }
 }
    static void Main()
    {
        Shop shop = new Shop(3);
        shop[0] = new Laptop("Asus", 4900);
        shop[1] = new Laptop("Acer", 3300);
        shop[2] = new Laptop("Dell", 2900);

        try
        {
            //for (int i = 0; i < shop.Length; i++)
            //{
            //    Console.WriteLine(shop[i].ToString());
            //}
            foreach (Laptop lt in shop)
            {
                Console.WriteLine(lt.ToString());
            }

            Console.WriteLine("===================");
            //Console.WriteLine(shop["Asus"]);
            //double p = 4900;
            Console.WriteLine(shop[(double)4900]);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
    void DrawStoryLayout(Shop shop)
    {
        SerializedProperty storyProperty = serializedObject.FindProperty("OShop");

        SerializedProperty shopId = storyProperty.FindPropertyRelative("shopId");
        shopId.stringValue = EditorGUILayout.TextField ("Shop Id", shopId.stringValue);

        SerializedProperty sellValue = storyProperty.FindPropertyRelative("sellValue");
        sellValue.intValue = int.Parse (EditorGUILayout.TextField ("sellValue", sellValue.intValue.ToString()));

        SerializedProperty listSellItem = storyProperty.FindPropertyRelative("listSellItem").FindPropertyRelative("Array");

        int length = listSellItem.arraySize;
        EditorGUILayout.LabelField("List Item : ");
        for(int i = 0;i < length;i++){
            EditorGUILayout.LabelField("=============Item " + (i+1) + "=================");
            SerializedProperty sellItem = listSellItem.FindPropertyRelative ("data[" + i + "]");
            SerializedProperty sellItemId = sellItem.FindPropertyRelative("itemId");
            SerializedProperty sellItemAmount = sellItem.FindPropertyRelative("amount");
            sellItemId.stringValue = EditorGUILayout.TextField ("Id Item " + (i+1), sellItemId.stringValue);
            sellItemAmount.intValue = EditorGUILayout.IntField ("Amount " + (i+1), sellItemAmount.intValue);
        }

        if (EditorGUILayout.Toggle("Add List Sell Item", false))
        {
            shop.listSellItem.Add(new SellItem("", 0));
        }

        EditorGUILayout.Space();
    }
        public void TestContainsObject()
        {
            Product toaster = new Product {Name = "toaster"};
            Shop shop = new Shop {Products = {toaster}};

            ObjectGraph graph = new ObjectGraph(shop);
            Assert.IsTrue(graph.ContainsNode(toaster));
        }
        public void TestResolveBackReferenceInEnumerable()
        {
            Product toaster = new Product {Name = "toaster"};
            Shop shop = new Shop {Products = {toaster}};

            ObjectGraph graph = new ObjectGraph(shop);
            object backReference = graph.ResolveBackReference(toaster);
            Assert.IsTrue(Object.ReferenceEquals(backReference, shop));
        }
        public void TestDoesNotContainObject()
        {
            Product kettle = new Product { Name = "kettle" };
            Product toaster = new Product { Name = "toaster" };
            Shop shop = new Shop {Products = {kettle}};

            ObjectGraph graph = new ObjectGraph(shop);
            Assert.IsFalse(graph.ContainsNode(toaster));
        }
        public static void Load()
        {
            string[] text = File.ReadAllLines(ServerBase.Constants.ShopsPath);
            Shop shop = new Shop();
            for (int x = 0; x < text.Length; x++)
            {
                string line = text[x];
                string[] split = line.Split('=');
               // Console.WriteLine("split[0] " + split[0] + ".");
                //Console.WriteLine("split[1] " + split[1] + ".");
                if (split[0] == "Amount")
                    Shops = new Dictionary<uint, Shop>(int.Parse(split[1]));
                else if (split[0] == "ID")
                {
                    if (shop.UID == 0)
                    {
                        shop.UID = uint.Parse(split[1]);
                        //Console.WriteLine("K split[1] " + split[1] + ".");
                    }
                    else
                    {
                        if (!Shops.ContainsKey(shop.UID))
                        {
                            Shops.Add(shop.UID, shop);
                            shop = new Shop();
                            shop.UID = uint.Parse(split[1]);
                            //Console.WriteLine("split[1] " + shop.UID + ".");
                        }
                    }
                }

                else if (split[0] == "MoneyType")
                {
                    shop.MoneyType = (MoneyType)byte.Parse(split[1]);
                }
                else if (split[0] == "ItemAmount")
                {
                    shop.Items = new List<uint>(ushort.Parse(split[1]));
                }
                else if (split[0].Contains("Item") && split[0] != "ItemAmount")
                {
                    uint ID = uint.Parse(split[1]);
                    if (!shop.Items.Contains(ID))
                        shop.Items.Add(ID);
                }
            }
            if (!Shops.ContainsKey(shop.UID))
            {

                    Shops.Add(shop.UID, shop);

            }
            LoadHonorShop();
            LoadRaceShop();
            Console.WriteLine("Shops information loaded.");
        }
Exemple #13
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        public List<BProperty> GetProperities(Product_Class category,Shop shop)
        {
            List<BProperty> properities = new List<BProperty>();
            ItempropsGetRequest req = new ItempropsGetRequest();
            req.Fields = "pid,name,must,multi,prop_values";
            if (category != null && !string.IsNullOrEmpty(category.Mall_CID))
            {
                req.Cid = long.Parse(category.Mall_CID);
            }
            else
            {
                req.Cid = 0;
            }
            //req.IsKeyProp = true;
            req.IsSaleProp = true;
            req.IsColorProp = true;
            req.IsEnumProp = true;
            req.IsInputProp = true;
            req.IsItemProp = true;
            //1=>Taobao
            //2=>TMall, need to check Mall Type from Shop object
            req.Type = 1L;

            ItempropsGetResponse response = client.Execute(req);
            if (response.IsError)
            {
                throw new KMJXCException(response.ErrMsg);
            }

            if (response.ItemProps != null)
            {
                foreach (TB.ItemProp prop in response.ItemProps)
                {
                    BProperty pro = new BProperty();
                    pro.Created = DateTimeUtil.ConvertDateTimeToInt(DateTime.Now);
                    pro.MID = prop.Pid.ToString();
                    pro.Name = prop.Name;
                    pro.CategoryId = category.Product_Class_ID;
                    pro.ID = 0;
                    pro.Shop = new BShop() { ID = category.Shop_ID };
                    pro.Created_By = new BUser() { ID = category.Create_User_ID };
                    properities.Add(pro);
                    if (prop.PropValues != null)
                    {
                        foreach (TB.PropValue pv in prop.PropValues)
                        {
                            Product_Spec_Value psv = new Product_Spec_Value();
                            psv.Name = pv.Name;
                            pro.Values.Add(psv);
                        }
                    }
                }
            }

            return properities;
        }
 public ActionResult CreateAdress(Shop.DataBase.Adress adress)
 {
     adress.UserId = new UserRepository().Find(User.Identity.Name).UserId;
     if (ModelState.IsValid)
     {
         AdressRepository.Add(adress);
         return RedirectToAction("Adress", "Personal");
     }
     return View(adress);
 }
Exemple #15
0
    void Create(string id)
    {
        OShop = new Shop();

        OShop.shopId = shopId;
        OShop.sellValue = 0;
        OShop.listSellItemId = new List<string>();
        OShop.listSellItemId.Add("");

        IsEditing = true;
    }
        public static Shop ToViewModel(this DataContracts.Stores.Store store)
        {
            var shopModel = new Shop();

            shopModel.CatalogId = store.Catalog;
            shopModel.Currency = store.DefaultCurrency;
            shopModel.Id = store.Id;
            shopModel.Name = store.Name;

            return shopModel;
        }
Exemple #17
0
    void Create(string id)
    {
        OShop = new Shop();

        OShop.shopId = shopId;
        OShop.sellValue = 0;
        OShop.listSellItem = new List<SellItem>();
        OShop.listSellItem.Add(new SellItem("", 0));

        IsEditing = true;
    }
    public void Enable(Shop newShop)
    {
		activeShop = newShop;
        //OnInventoryPressed(0);
		//ActiveShop = PlayerManager.Instance.ActiveShop;
		//ChangeShopMode(0);
		selectedItemList = activeShop.ShopItems;
		RefreshInventoryIcons();
		ShopNameLabel.text = activeShop.Name;
		isPlayerShop = false;
		Enable();
    }
Exemple #19
0
 public void AddItemToShop()
 {
     Item item = new Item("ID0001", "Cestitka 1");
     Shop shop = new Shop("trgovina 1");
     Price price = new Price(4, 3.2) {ItemId = item.UniqueId, ShopId = shop.Id};
     ShopItem shopItem = new ShopItem {ItemId = item.UniqueId, ShopId = shop.Id, PriceId = price.Id};
     Assert.IsNotNull(shopItem, "Items not added to shop!");
     shopItem.SetNumberOfItems(3);
     Assert.AreEqual(3, shopItem.NumberOfItems, "ShopItem missmatch!");
     Overview overview = new Overview();
     overview.AddShopItem(shopItem);
     Overview temp = overview;
 }
        private static void EnsureThereAreNoRelativeUris(Shop shop)
        {
            var relativeUriCount = (from l in shop.Links
                                    where l.Href.IsAbsoluteUri.Equals(false)
                                    select l.Href)
                .Union(from f in shop.Forms
                       where f.Resource.IsAbsoluteUri.Equals(false)
                       select f.Resource).Count();

            if (relativeUriCount > 0)
            {
                throw new BaseUriMissingException();
            }
        }
Exemple #21
0
        private void Setup()
        {
            commandController = new CommandController(this);
            HelpText = "Enter a Command to perform an action: @'help' to produce menu @'goto' 'place' to go somewhere (shop, vault, arena, world) @'save' to save progress @'load' to load game state from last save and return to World @'delete' to delete save @'y' or 'n' to confirm or cancel any action @Different commands also exist within zones";
            GreetingText = "Welcome to Top Deck. Enter a command to get started!";
            Shop = new Shop(commandController);
            Vault = new Vault(commandController);
            Arena = new Arena(commandController);
            Game = new Game(commandController);

            CharacterCreator = new CharacterCreator(Shop.CardLibrary);
            CardLibrary = Shop.CardLibrary;

            Front.ChangeLocation(this);
        }
        private FullShopInfo GetFacadeObjectByDomain(Shop entity)
        {
            if (entity == null) return null;

            FullShopInfo info = new FullShopInfo();
            info.Sid = entity.Sid;
            info.Cid = entity.Cid;
            info.Title = entity.Title;
            info.SellerNick = entity.SellerNick;
            info.Description = entity.Description;
            info.Bulletin = entity.Bulletin;
            info.RemainShowcase = entity.RemainShowcase;
            info.LogoUrl = entity.LogoUrl;
            info.Created = entity.Created;
            info.Modified = entity.Modified;
            return info;
        }
        internal static void Main()
        {
            VehicleBuilder builder;
            var shop = new Shop();

            builder = new ScooterBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            builder = new CarBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();

            builder = new MotorCycleBuilder();
            shop.Construct(builder);
            builder.Vehicle.Show();
        }
Exemple #24
0
        static void Main(string[] args)
        {
            DummyProduct product = new DummyProduct();

            Shop shop1 = new Shop("Shop 1");
            Shop shop2 = new Shop("Shop 2");
            Shop shop3 = new Shop("Shop 3");
            Shop shop4 = new Shop("Shop 4");

            product.Attach(shop1);
            product.Attach(shop2);
            product.Attach(shop3);
            product.Attach(shop4);

            product.ChangePrice(26.0f);

            Console.ReadLine();
        }
Exemple #25
0
    public IEnumerator ShowNPC()
    {
        yield return new WaitForEndOfFrame();
        Active = true;
        Player.Instance.ActiveNPC = this;
        //Player.Instance.ActiveNPCName = character.Name;
        if(character.ShopID > 0)
        {
            if(thisShop == null)
            {
                thisShop = Storage.LoadById<Shop>(character.ShopID, new Shop());

            }
            thisShop.PopulateItems();
            Player.Instance.ActiveShop = thisShop;
        }
        GUIManager.Instance.DisplayNPC();
    }
 public void SetShop(Shop shop)
 {
     this.shop = shop;
     Item item = shop.GetItem(index);
     if (item == null)
     {
         itemCostObject.SetActive(false);
         purchaseButtonObject.SetActive(false);
         transform.GetChild(0).GetComponent<Image>().sprite = itemImages.GetItemSprite("Null");
     }
     else
     {
         itemCostObject.SetActive(true);
         purchaseButtonObject.SetActive(true);
         transform.GetChild(0).GetComponent<Image>().sprite = itemImages.GetItemSprite(item.Name);
         itemCostObject.GetComponent<Text>().text = shop.GetItemCost(index).ToString();
     }
 }
	void Start () {
		List<string> btnName = new List<string> ();
		btnName.Clear ();
		for (int i = 1; i <= 10; i++)
			btnName.Add ("Bag_Button_" + i);
		btnName.Add ("Bag_Left");
		btnName.Add ("Bag_Right");
		//btnName.Add ("Bag_Up");
		//btnName.Add ("Bag_Down");
		btnName.Add ("Bag_Use");
		btnName.Add ("Bag_Exit");
		foreach(string btnname in btnName) {
			GameObject btnobj = GameObject.Find(btnname);
			btnobj.AddComponent<UIEventListener>();
			UIEventListener.Get (btnobj).onClick = onclick;
		}
		for (int i = 1; i <= 10; i++)
			objlist [i] = GameObject.Find ("Bag_Button_" + i);
		pageobj = GameObject.Find ("Bag_Label_1").GetComponent<UILabel> ();
		//label2 = GameObject.Find ("Bag_Label_2").GetComponent<UILabel> ();
		//label3 = GameObject.Find ("Bag_Label_3").GetComponent<UILabel> ();
		label4 = GameObject.Find ("Bag_Label_4").GetComponent<UILabel> ();
		Shop shop = new Shop ();
		shop.addGoods ("potion1", 0);
		shop.addGoods ("potion2", 0);
		shop.addGoods ("potion3", 0);
		shop.addGoods ("potion1", 0);
		shop.addGoods ("potion2", 0);
		shop.addGoods ("potion3", 0);
		shop.addGoods ("potion1", 0);
		shop.addGoods ("potion2", 0);
		shop.addGoods ("potion3", 0);
		shop.addGoods ("potion1", 0);
		shop.addGoods ("potion2", 0);
		shop.addGoods ("potion3", 0);
		shop.addGoods ("potion1", 0);
		shop.addGoods ("potion2", 0);
		shop.addGoods ("potion3", 0);
		shop.addGoods ("potion1", 0);
		shop.addGoods ("potion2", 0);
		shop.addGoods ("potion3", 0);
		shop.addGoods ("po123n1", 0);
		Init (shop);
	}
	void Start () {
		List<string> btnName = new List<string> ();
		btnName.Clear ();
		for (int i = 1; i <= 10; i++)
			btnName.Add ("Shop_Button_" + i);
		btnName.Add ("Shop_Left");
		btnName.Add ("Shop_Right");
		btnName.Add ("Shop_Up");
		btnName.Add ("Shop_Down");
		btnName.Add ("Shop_Buy");
		btnName.Add ("Shop_Exit");
		foreach(string btnname in btnName) {
			GameObject btnobj = GameObject.Find(btnname);
			btnobj.AddComponent<UIEventListener>();
			UIEventListener.Get (btnobj).onClick = onclick;
		}
		for (int i = 1; i <= 10; i++)
			objlist [i] = GameObject.Find ("Shop_Button_" + i);
		pageobj = GameObject.Find ("Shop_Label_1").GetComponent<UILabel> ();
		label2 = GameObject.Find ("Shop_Label_2").GetComponent<UILabel> ();
		label3 = GameObject.Find ("Shop_Label_3").GetComponent<UILabel> ();
		label4 = GameObject.Find ("Shop_Label_4").GetComponent<UILabel> ();
		Shop shop = new Shop ();
		shop.addGoods ("potion1", 1);
		shop.addGoods ("potion2", 2);
		shop.addGoods ("potion3", 3);
		shop.addGoods ("potion1", 4);
		shop.addGoods ("potion2", 5);
		shop.addGoods ("potion3", 6);
		shop.addGoods ("potion1", 7);
		shop.addGoods ("potion2", 8);
		shop.addGoods ("potion3", 9);
		shop.addGoods ("potion1", 10);
		shop.addGoods ("potion2", 11);
		shop.addGoods ("potion3", 12);
		shop.addGoods ("potion1", 13);
		shop.addGoods ("potion2", 14);
		shop.addGoods ("potion3", 15);
		shop.addGoods ("potion1", 16);
		shop.addGoods ("potion2", 17);
		shop.addGoods ("potion3", 18);
		shop.addGoods ("po123n1", 19);
		Init (shop);
	}
Exemple #29
0
    public void CreateShop()
    {
        List<Item> items = new List<Item> ();

        foreach (Item item in itemManager.allItems) {

            if (ItemStocked (item, 1)) {

                items.Add (item);
            }
        }

        Inventory inventory = new Inventory ();
        inventory.items = items;

        Shop shop = new Shop (inventory);
        AddShop (shop);

        shop.location = new CellLocation(9, 0, 9);
    }
Exemple #30
0
 void Start()
 {
     welcomeText.text = "Welcome to my Shop Traveler!" + "\n" + "-Press 'P' To open Shop";
     welcomeText.gameObject.SetActive(false);
     _shop = GameObject.FindWithTag(Tags.GameController).GetComponent <Shop>();
 }
 public void UpdateShop(Shop shop)
 {
     _data.UpdateShop(shop);
 }
Exemple #32
0
 public ListPage(Shop shop)
 {
     InitializeComponent();
     this.BindingContext = viewModel = new ListPageViewModel(Navigation, shop);
 }
Exemple #33
0
 /// <summary>
 /// 根据指定的过滤条件查询购物车信息
 /// </summary>
 /// <param name="shop">过滤条件</param>
 /// <returns></returns>
 public DataTable Select(Shop shop)
 {
     return(this.Select(shop, 0, 0));
 }
Exemple #34
0
 public Shop Update(Shop shops)
 {
     _context.Entry(shops).State = Microsoft.EntityFrameworkCore.EntityState.Modified;
     _context.SaveChanges();
     return(shops);
 }
Exemple #35
0
        /// <summary>
        /// 检查是否在配送范围
        /// </summary>
        /// <param name="model"></param>
        /// <param name="db"></param>
        /// <param name="shop"></param>
        public static void CheckIsInScope(this MemberAddress model, ShopDbContext db, Shop shop)
        {
            ShopTakeOutInfo toInfo = db.Query <ShopTakeOutInfo>()
                                     .Where(m => !m.IsDel)
                                     .Where(m => m.ShopId == shop.Id)
                                     .FirstOrDefault();

            if (toInfo == null)
            {
                throw new Exception("外卖基础设置不存在");
            }
            model.CheckIsInScope(shop, toInfo);
        }
Exemple #36
0
    public int GetShowItem(int id)
    {
        int planeCost = Shop.GetInstance().GetPlane(id).ID;

        return(planeCost);
    }
Exemple #37
0
 private int GetArraySizeForThis()
 {
     return(Shop.GetInstance().GetSizeCollection("PlanesCollection"));
 }
Exemple #38
0
    public int GetShowItemCost(int id)
    {
        int cost = Shop.GetInstance().GetPlane(id).Cost;

        return(cost);
    }
Exemple #39
0
 public void OnEquipClick(int collectionID)
 {
     Player.GetInstance().SetPlane(Shop.GetInstance().GetPlane(collectionID));
     PlayerPrefs.SetInt("CurrentPlane", Shop.GetInstance().GetPlane(collectionID).ID);
 }
Exemple #40
0
 private void Start()
 {
     _shop      = Shop.GetComponent <Shop>();
     _inventory = Inventory.GetComponent <Inventory>();
     AssignPlayerVariables();
 }
Exemple #41
0
 void Awake()
 {
     Current = this;
 }
 public bool UpdateShop(Shop shop)
 {
     return(_shop.Update(shop));
 }
 public DetachedShopMarketersHistoryEvent(Shop shop, Marketer marketer, UserInfo userInfo)
 {
     Shop     = shop;
     Marketer = marketer;
     UserInfo = userInfo;
 }
Exemple #44
0
 public void DisplayParameters(int id, Text text)
 {
     text.text = "НАЗВАНИЕ: " + Shop.GetInstance().GetPlane(id).Name + "\nУРОН: " + Shop.GetInstance().GetPlane(id).Damage + "\nБРОНЯ: " + Shop.GetInstance().GetPlane(id).Armor + "\nСТОИМОСТЬ: " + Shop.GetInstance().GetPlane(id).Cost;
 }
Exemple #45
0
        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (!DataGridViewUtil.CheckPerrmisson(this, sender, e))
            {
                return;
            }
            try
            {
                if (e.RowIndex > -1 && e.ColumnIndex > -1)
                {
                    if (GlobalUtil.EngineUnconnectioned(this))
                    {
                        return;
                    }
                    List <Shop> list = DataGridViewUtil.BindingListToList <Shop>(dataGridView1.DataSource);
                    Shop        item = (Shop)list[e.RowIndex];

                    if (e.ColumnIndex == Column1.Index)
                    {
                        this.SaveClick(item, this);
                    }
                    else if (e.ColumnIndex == ColumnDisable.Index)
                    {
                        if (GlobalMessageBox.Show("确定禁用吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            InteractResult result = GlobalCache.Shop_OnDisable(item.ID);

                            switch (result.ExeResult)
                            {
                            case ExeResult.Success:
                                GlobalMessageBox.Show("禁用成功!");
                                this.dataGridView1.DataSource = null;
                                item.Enabled = false;
                                this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                                break;

                            case ExeResult.Error:
                                GlobalMessageBox.Show(result.Msg);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                    else if (e.ColumnIndex == EnabledLink.Index)
                    {
                        if (GlobalMessageBox.Show("确定启用吗?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            item.Enabled = true;
                            InteractResult result = GlobalCache.ServerProxy.EnableShop(item.ID);

                            switch (result.ExeResult)
                            {
                            case ExeResult.Success:
                                GlobalMessageBox.Show("启用成功!");
                                this.dataGridView1.DataSource = null;
                                item.Enabled = true;
                                this.dataGridView1.DataSource = DataGridViewUtil.ListToBindingList(list);
                                break;

                            case ExeResult.Error:
                                item.Enabled = false;
                                GlobalMessageBox.Show(result.Msg);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                    else if (e.ColumnIndex == ColumnDelete.Index)
                    {
                        Delete(item);
                    }
                }
            }
            catch (Exception ex)
            {
                GlobalUtil.ShowError(ex);
            }
            finally
            {
                GlobalUtil.UnLockPage(this);
            }
        }
Exemple #46
0
 private void Start()
 {
     inventroy     = GetComponent <Inventory>();
     displayScript = GetComponent <ClothingDisplayOnPlayer>();
     shop          = GetComponent <Shop>();
 }
Exemple #47
0
 public int Insert(Shop entity)
 {
     db.Shops.Add(entity);
     db.SaveChanges();
     return(entity.ShopID);
 }
Exemple #48
0
 public ProductsController(Shop context)
 {
     _context = context;
 }
Exemple #49
0
    private void SetUpLevel(string LevelID)
    {
        AutoIngredientList   = new List <int>();
        NonAutoIngredientDic = new Dictionary <int, GameObject>();
        FoodMakerDic         = new Dictionary <int, List <GameObject> >();
        FoodHolderDic        = new Dictionary <int, List <GameObject> >();
        customerList         = new List <GameObject>();

        level = GameDictionary.Instance.GetLevel(LevelID);
        shop  = GameDictionary.Instance.GetShop(level.ShopID);
        var g = Resources.Load(@"Prefabs/Shops/" + shop.ID) as GameObject;

        panel = Instantiate <GameObject>(Resources.Load(@"Prefabs/Shops/" + shop.ID) as GameObject, transform);
        foreach (var item in shop.IngredientID)
        {
            if (!PlayerData.Instance.PlayerEquipmentDic.ContainsKey(item))
            {
                GameObject.Find(item + "").SetActive(false);
            }
            else
            {
                if (!GameDictionary.Instance.GetIngredient(item).IsAuto)
                {
                    var go = GameObject.Find(item + "");
                    NonAutoIngredientDic.Add(item, go);
                }
                else
                {
                    AutoIngredientList.Add(item);
                }
            }
        }
        foreach (var item in shop.FoodMakerID)
        {
            if (GameDictionary.Instance.GetFoodMaker(item).IsOneForAll)
            {
                if (!PlayerData.Instance.PlayerEquipmentDic.ContainsKey(item))
                {
                    GameObject.Find(item + "").SetActive(false);
                }
                else
                {
                    var go        = GameObject.Find(item + "");
                    int star      = PlayerData.Instance.PlayerEquipmentDic[item];
                    var foodMaker = GameDictionary.Instance.GetFoodMaker(item);
                    var setting   = go.GetComponent <FoodMakerSetting>();
                    switch (star)
                    {
                    case 1:
                        setting.MaxCookingTime = foodMaker.OneStarMakingTime;
                        setting.MaxBurningTime = foodMaker.OneStarBurntTime;
                        break;

                    case 2:
                        setting.MaxCookingTime = foodMaker.TwoStarMakingTime;
                        setting.MaxBurningTime = foodMaker.TwoStarBurntTime;
                        break;

                    case 3:
                        setting.MaxCookingTime = foodMaker.ThreeStarMakingTime;
                        setting.MaxBurningTime = foodMaker.ThreeStarBurntTime;
                        break;
                    }
                    FoodMakerDic.Add(item, new List <GameObject>());
                    FoodMakerDic[item].Add(go);
                }
            }
            else
            {
                if (!PlayerData.Instance.PlayerEquipmentDic.ContainsKey(item))
                {
                    GameObject.Find(item + "").SetActive(false);
                    if (GameDictionary.Instance.GetFoodMaker(item).ThreeStarMakerCount != 1)
                    {
                        for (int i = 1; i < GameDictionary.Instance.GetFoodMaker(item).ThreeStarMakerCount; i++)
                        {
                            GameObject.Find(item + "_" + i).SetActive(false);
                        }
                    }
                }
                else
                {
                    var    go             = GameObject.Find(item + "");
                    int    star           = PlayerData.Instance.PlayerEquipmentDic[item];
                    var    foodMaker      = GameDictionary.Instance.GetFoodMaker(item);
                    int    count          = 0;
                    double maxCookingTime = 0;
                    double maxBurningTime = 0;
                    switch (star)
                    {
                    case 1:
                        maxCookingTime = foodMaker.OneStarMakingTime;
                        maxBurningTime = foodMaker.OneStarBurntTime;
                        count          = foodMaker.OneStarMakerCount;
                        break;

                    case 2:
                        maxCookingTime = foodMaker.TwoStarMakingTime;
                        maxBurningTime = foodMaker.TwoStarBurntTime;
                        count          = foodMaker.TwoStarMakerCount;
                        break;

                    case 3:
                        maxCookingTime = foodMaker.ThreeStarMakingTime;
                        maxBurningTime = foodMaker.ThreeStarBurntTime;
                        count          = foodMaker.ThreeStarMakerCount;
                        break;
                    }

                    var Setting = go.GetComponent <FoodMakerSetting>();
                    Setting.MaxBurningTime = maxBurningTime;
                    Setting.MaxCookingTime = maxCookingTime;

                    for (int i = count; i < GameDictionary.Instance.GetFoodMaker(item).ThreeStarMakerCount; i++)
                    {
                        GameObject.Find(item + "_" + i).SetActive(false);
                    }

                    FoodMakerDic.Add(item, new List <GameObject>());
                    FoodMakerDic[item].Add(GameObject.Find(item + ""));
                    for (int i = 1; i < count; i++)
                    {
                        go      = GameObject.Find(item + "_" + i);
                        Setting = go.GetComponent <FoodMakerSetting>();
                        Setting.MaxBurningTime = maxBurningTime;
                        Setting.MaxCookingTime = maxCookingTime;
                        FoodMakerDic[item].Add(go);
                    }
                }
            }
        }
        foreach (var item in shop.FoodHolderID)
        {
            if (!PlayerData.Instance.PlayerEquipmentDic.ContainsKey(item))
            {
                GameObject.Find(item + "").SetActive(false);
                if (GameDictionary.Instance.GetFoodHolder(item).ThreeStarFoodCount != 1)
                {
                    for (int i = 1; i < GameDictionary.Instance.GetFoodHolder(item).ThreeStarFoodCount; i++)
                    {
                        GameObject.Find(item + "_" + i).SetActive(false);
                    }
                }
            }
            else
            {
                int count = 0;
                if (PlayerData.Instance.PlayerEquipmentDic[item] == 2)
                {
                    count = GameDictionary.Instance.GetFoodHolder(item).TwoStarFoodCount;
                }
                else if (PlayerData.Instance.PlayerEquipmentDic[item] == 1)
                {
                    count = GameDictionary.Instance.GetFoodHolder(item).OneStarFoodCount;
                }
                else
                {
                    count = GameDictionary.Instance.GetFoodHolder(item).ThreeStarFoodCount;
                }

                for (int i = count; i < GameDictionary.Instance.GetFoodHolder(item).ThreeStarFoodCount; i++)
                {
                    GameObject.Find(item + "_" + i).SetActive(false);
                }

                FoodHolderDic.Add(item, new List <GameObject>());
                FoodHolderDic[item].Add(GameObject.Find(item + ""));
                for (int i = 1; i < count; i++)
                {
                    FoodHolderDic[item].Add(GameObject.Find(item + "_" + i));
                }
            }
        }

        ///Test时使用
        if (true)
        {
            foreach (var item in NonAutoIngredientDic)
            {
                item.Value.GetComponentInChildren <Text>().text = GameDictionary.Instance.GetIngredient(item.Key).Name_CN;
            }

            foreach (var item in FoodMakerDic)
            {
                foreach (var go in item.Value)
                {
                    go.GetComponentInChildren <Text>().text = GameDictionary.Instance.GetFoodMaker(item.Key).Name_CN;
                }
            }

            foreach (var item in FoodHolderDic)
            {
                foreach (var go in item.Value)
                {
                    go.GetComponentInChildren <Text>().text = GameDictionary.Instance.GetFoodHolder(item.Key).Name_CN;
                }
            }
        }

        foreach (var item in NonAutoIngredientDic)
        {
            item.Value.GetComponent <Button>().onClick.AddListener(() => IngredientClick(item.Key));
        }

        foreach (var item in FoodMakerDic)
        {
            if (!GameDictionary.Instance.GetFoodMaker(item.Key).IsAuto)
            {
                foreach (var fm in item.Value)
                {
                    fm.GetComponent <Button>().onClick.AddListener(() => FoodMakerClick(item.Key, fm));
                }
            }
        }

        foreach (var item in FoodHolderDic)
        {
            foreach (var fh in item.Value)
            {
                fh.GetComponent <Button>().onClick.AddListener(() => FoodHolderClick(item.Key, fh));
            }
        }

        customerComingTimeList = new List <double>();
        for (int i = 0; i < level.MaximumCustomerWaiting; i++)
        {
            customerComingTimeList.Add(rdm.NextDouble() * 2 * level.AverageCustomerComeTime);
        }
    }
Exemple #50
0
        public TackShopGiveaway()
        {
            List <World.SpecialTile> specialTiles = new List <World.SpecialTile>();

            foreach (World.SpecialTile sTile in World.SpecialTiles)
            {
                if (sTile.Code != null)
                {
                    if (sTile.Code.StartsWith("STORE-"))
                    {
                        int  storeId  = int.Parse(sTile.Code.Split("-")[1]);
                        Shop shopData = Shop.GetShopById(storeId);

                        if (shopData.BuysItemTypes.Contains("TACK"))
                        {
                            Npc.NpcEntry[] npcShop = Npc.GetNpcByXAndY(sTile.X, sTile.Y);
                            if (npcShop.Length > 0)
                            {
                                specialTiles.Add(sTile);
                            }
                        }
                    }
                }
            }

            string npcName = "ERROR";
            string npcDesc = "OBTAINING NAME";

            int shpIdx = GameServer.RandomNumberGenerator.Next(0, specialTiles.Count);

            Location = specialTiles[shpIdx];
            Npc.NpcEntry[] npcShops = Npc.GetNpcByXAndY(Location.X, Location.Y);

            npcName = npcShops[0].Name.Split(" ")[0];
            if (npcShops[0].ShortDescription.ToLower().Contains("tack"))
            {
                npcDesc  = npcShops[0].ShortDescription.Substring(npcShops[0].ShortDescription.ToLower().IndexOf("tack"));
                ShopName = npcName + "'s " + npcDesc;
            }
            else
            {
                ShopName = npcName + "'s Gear";
            }


            while (true)
            {
                int             hrsIdx = GameServer.RandomNumberGenerator.Next(0, HorseInfo.Breeds.Length);
                HorseInfo.Breed breed  = HorseInfo.Breeds[hrsIdx];
                if (breed.SpawnInArea == "none")
                {
                    continue;
                }

                HorseGiveaway      = new HorseInstance(breed);
                HorseGiveaway.Name = "Tack Shop Giveaway";
                break;
            }

            if (World.InTown(Location.X, Location.Y))
            {
                Town = World.GetTown(Location.X, Location.Y);
            }
        }
Exemple #51
0
    void Start()
    {
        Shop shop = FindObjectOfType <Shop>();

        UpdateText(shop.info.Pause);
    }
Exemple #52
0
        public Shop FormatShop(Match match, string pageUrl)
        {
            Shop       shop   = new Shop();
            List <int> indexs = this.siteParameter.JsonIndexs.Split(',').Select(s => int.Parse(s)).ToList();

            if (indexs[1] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"name\":\"(.*?)\","))
                {
                    shop.SubbranchName = Regex.Match(match.Value, "\"name\":\"(.*?)\",").Groups[1].Value;
                }
            }

            if (indexs[2] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"country\":\"(.*?)\","))
                {
                    shop.Country = Regex.Match(match.Value, "\"country\":\"(.*?)\",").Groups[1].Value;
                }
            }

            if (indexs[3] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"city\":\"(.*?)\","))
                {
                    shop.City = Regex.Match(match.Value, "\"city\":\"(.*?)\",").Groups[1].Value;
                }
            }

            if (indexs[4] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"add1\":\"(.*?)\","))
                {
                    shop.Address = Regex.Match(match.Value, "\"add1\":\"(.*?)\",").Groups[1].Value.TrimUnicode().TrimEscape();
                }
            }

            if (indexs[5] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"lng\":(.*?),"))
                {
                    shop.Longitude = Regex.Match(match.Value, "\"lng\":(.*?),").Groups[1].Value;
                }
            }

            if (indexs[6] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"lat\":(.*?),"))
                {
                    shop.Latitude = Regex.Match(match.Value, "\"lat\":(.*?),").Groups[1].Value;
                }
            }

            if (indexs[7] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"hours\":(.*?),"))
                {
                    string   openHoursTemp = Regex.Match(match.Value, "\"hours\":(.*?),").Groups[1].Value.TrimDoubleQuote();
                    string[] openHourMeta  = openHoursTemp.Split('|');
                    string   openHour      = "";
                    foreach (var openHourItem in openHourMeta)
                    {
                        if (openHourItem.Contains("A"))
                        {
                            openHour += Regex.Replace(openHourItem, "A", "Mon: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                        if (openHourItem.Contains("B"))
                        {
                            openHour += Regex.Replace(openHourItem, "B", "Tue: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                        if (openHourItem.Contains("C"))
                        {
                            openHour += Regex.Replace(openHourItem, "C", "Wed: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                        if (openHourItem.Contains("D"))
                        {
                            openHour += Regex.Replace(openHourItem, "D", "Thu: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                        if (openHourItem.Contains("E"))
                        {
                            openHour += Regex.Replace(openHourItem, "E", "Fri: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                        if (openHourItem.Contains("F"))
                        {
                            openHour += Regex.Replace(openHourItem, "F", "Sat: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                        if (openHourItem.Contains("G"))
                        {
                            openHour += Regex.Replace(openHourItem, "G", "Sun: ").Insert(7, ":").Insert(10, " am - ").Insert(18, ":").Insert(21, " pm ");
                        }
                    }
                    shop.OpenHours = openHour;
                }
            }

            if (indexs[8] > 0)
            {
                if (Regex.IsMatch(match.Value, "\"phone\":(.*?),"))
                {
                    shop.Telphone = Regex.Match(match.Value, "\"phone\":(.*?),").Groups[1].Value.TrimDoubleQuote();
                }
            }

            if (indexs[9] > 0)
            {
                shop.ShopType = match.Groups[indexs[9]].Value;
            }

            if (indexs[11] > 0)
            {
                shop.Picture = match.Groups[indexs[11]].Value;
            }

            if (indexs[12] > 0)
            {
                if (!string.IsNullOrWhiteSpace(this.siteParameter.SiteUrlPattern) && Regex.IsMatch(this.siteParameter.SiteUrlPattern, "{\\D+}"))
                {
                    shop.SiteUrl = Regex.Replace(this.siteParameter.SiteUrlPattern, "{\\D+}", match.Groups[indexs[12]].Value, RegexOptions.IgnoreCase).UrlDecode();
                    if (match.Groups[indexs[12]].Value.Contains("http"))
                    {
                        shop.SiteUrl = match.Groups[indexs[12]].Value;
                    }
                }
                else
                {
                    shop.SiteUrl = match.Groups[indexs[12]].Value.ToAbsoluteUrl(pageUrl);
                }
                if (this.siteParameter.MerchantNamePattern.Equals("华伦天奴"))
                {
                    shop.SiteUrl = string.Format("{0},{1}", match.Groups[8].Value, match.Groups[indexs[12]].Value);
                }
            }

            if (indexs[13] > 0)
            {
                string matchValue = Regex.Replace(match.Groups[indexs[13]].Value, "<span class=\"\">.+?</span>", string.Empty, RegexOptions.IgnoreCase).Trim();
                shop.Scope = Regex.Replace(matchValue, "<span.+?>", string.Empty, RegexOptions.IgnoreCase).Replace("</span>", ",").TrimContent();
            }
            return(shop);
        }
Exemple #53
0
        protected virtual Shop GetStore(IOwinContext context, string language)
        {
            var loadDefault = true;
            //var mvcContext = new HttpContextWrapper(HttpContext.Current);
            var routeData = HttpContext.Current.Request.RequestContext.RouteData;
            //var routeData = RouteTable.Routes.GetRouteData(mvcContext);

            string storeId = null;

            if (routeData != null)
            {
                storeId = this.GetStoreIdFromRoute(routeData.Values);
            }

            if (string.IsNullOrEmpty(storeId))
            {
                storeId = this.GetStoreIdFromUrl(context.Request.Uri.Segments);
            }

            Shop store = null;

            if (String.IsNullOrEmpty(storeId))
            {
                // try getting store from URL
                var allStores = SiteContext.Current.Shops;

                var url    = context.Request.Uri.AbsoluteUri.ToLower();
                var stores = (from s in allStores where
                              (!string.IsNullOrEmpty(s.Url) && url.Contains(s.Url)) ||
                              (!string.IsNullOrEmpty(s.SecureUrl) && url.Contains(s.SecureUrl))
                              select s).ToArray();

                storeId = stores.Length > 0 ? stores[0].StoreId : String.Empty;

                if (String.IsNullOrEmpty(storeId))
                {
                    // try getting store from the cookie
                    storeId = context.Request.Cookies[StoreCookie];

                    // try getting default store from settings
                    if (String.IsNullOrEmpty(storeId))
                    {
                        storeId = ConfigurationManager.AppSettings["DefaultStore"];
                    }
                }
            }

            if (!String.IsNullOrEmpty(storeId))
            {
                store = SiteContext.Current.GetShopBySlug(storeId, language);

                if (store != null)
                {
                    if (store.State != StoreState.Closed)
                    {
                        loadDefault = false;
                    }
                    else
                    {
                        store = null;
                    }
                }
            }

            if (store == null)
            {
                if (loadDefault)
                {
                    context.Response.Cookies.Delete(StoreCookie);
                    storeId = ConfigurationManager.AppSettings["DefaultStore"];
                    store   =
                        SiteContext.Current.Shops.SingleOrDefault(
                            s => s.StoreId.Equals(storeId, StringComparison.OrdinalIgnoreCase));
                }
            }

            if (store == null)
            {
                store = SiteContext.Current.Shops.FirstOrDefault(x => x.Languages.Contains(language));
            }

            return(store);
        }
    public SaveData(int HP, Main main, Shop shop, Weapon _weapon)
    {
        //Player
        health          = Player.S.GetHP();
        maxHP           = Player.S.GetMaxHP();
        hpLevel         = Player.S.GetHpLevel();
        maxHpLevel      = Player.S.GetMaxHpLevel();
        hpBonusPerLevel = Player.S.GetHpBonusPerLevel();
        cost            = Player.S.GetCost();
        //Global
        gold         = Main.S.gold;
        currentLevel = Main.S.currentLevel;
        currentWave  = Main.S.waveCounter;
        //______WEAPONS________
        riffleAmmo = _weapon.GetRifleAmmo();
        //Pistolet
        PisCurrentAmmo     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetCurrentAmmo();
        PisAmmo            = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetAmmo();
        PisCapacity        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetCapacity();
        PisLevel           = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetLevel();
        PisFireRate        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetFireRate();
        PisMoneyForUpgrade = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetMoneyForUpgrade();
        PisBuyingPrice     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetBuyingPrice();
        PisReloadSpeed     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetReloadSpeed();
        PisDamage          = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.ePistol).GetDamage();
        //Półautomat
        if (_weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic) != null)
        {
            SemiCurrentAmmo     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetCurrentAmmo();
            SemiAmmo            = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetAmmo();
            SemiCapacity        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetCapacity();
            SemiLevel           = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetLevel();
            SemiFireRate        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetFireRate();
            SemiMoneyForUpgrade = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetMoneyForUpgrade();
            SemiBuyingPrice     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetBuyingPrice();
            SemiReloadSpeed     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetReloadSpeed();
            SemiDamage          = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSemiAutomatic).GetDamage();
            isSemiExist         = true;
        }

        //Automat
        if (_weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic) != null)
        {
            AutoCurrentAmmo     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetCurrentAmmo();
            AutoAmmo            = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetAmmo();
            AutoCapacity        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetCapacity();
            AutoLevel           = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetLevel();
            AutoFireRate        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetFireRate();
            AutoMoneyForUpgrade = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetMoneyForUpgrade();
            AutoBuyingPrice     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetBuyingPrice();
            AutoReloadSpeed     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetReloadSpeed();
            AutoDamage          = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eAutomatic).GetDamage();
            isAutoExist         = true;
        }

        //Rifle
        if (_weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle) != null)
        {
            RifleCurrentAmmo     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetCurrentAmmo();
            RifleAmmo            = _weapon.GetSniperAmmo();
            RifleCapacity        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetCapacity();
            RifleLevel           = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetLevel();
            RifleFireRate        = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetFireRate();
            RifleMoneyForUpgrade = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetMoneyForUpgrade();
            RifleBuyingPrice     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetBuyingPrice();
            RifleReloadSpeed     = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetReloadSpeed();
            RifleDamage          = _weapon.weapons.Find(gun => gun.GetType() == Weapon.WeaponType.eSniperRifle).GetDamage();
            isRifleExist         = true;
        }

        //______DEFENSIVE________
        //Płot
        FencyCurrentLevel = shop.DefensiveObjectsArray[1].prefabs.GetComponent <DefensiveObject>().currentLevel;
        FencyHealth       = shop.DefensiveObjectsArray[1].prefabs.GetComponent <DefensiveObject>().health;
        FencyUpgradePrice = shop.DefensiveObjectsArray[1].prefabs.GetComponent <DefensiveObject>().upgradePrice;
        //Kolce
        SpikeCurrentLevel = shop.DefensiveObjectsArray[0].prefabs.GetComponent <DefensiveSpikes>().currentLevel;
        SpikeHealth       = shop.DefensiveObjectsArray[0].prefabs.GetComponent <DefensiveSpikes>().health;
        SpikeDamageEnemy  = shop.DefensiveObjectsArray[0].prefabs.GetComponent <DefensiveSpikes>().damageEnemy;
        SpikeUpgradePrice = shop.DefensiveObjectsArray[0].prefabs.GetComponent <DefensiveSpikes>().upgradePrice;
        SpikeTakeDamage   = shop.DefensiveObjectsArray[0].prefabs.GetComponent <DefensiveSpikes>().takeDamage;

        GameObject objects = Camera.main.GetComponent <Shop>().objectAnchor.gameObject;

        int number = objects.transform.childCount;

        objectOnMap = new List <ObjectData>();

        for (int i = 0; i < number; ++i)
        {
            ObjectData objectData = new ObjectData();
            Transform  go         = objects.transform.GetChild(i);

            objectData.x = go.position.x;
            objectData.y = go.position.y;
            objectData.z = go.position.z;

            if (go.tag == "DefensiveObject")
            {
                objectData.Health = go.GetComponent <DefensiveObject>().health;
                objectData.tag    = "DefensiveObject";
            }
            if (go.tag == "DefensiveSpikes")
            {
                objectData.Health = go.GetComponent <DefensiveSpikes>().health;
                objectData.tag    = "DefensiveSpikes";
            }

            objectOnMap.Add(objectData);
        }
    }
        private PfInfo Build()
        {
            if (
                this.curInboundDetailList == null || this.curInboundDetailList.Count == 0)
            {
                return(null);
            }
            int     totalCount           = 0;
            decimal totalPrice           = 0;
            decimal totalCost            = 0;
            List <PfOrderDetail> details = new List <PfOrderDetail>();

            //使用补货申请单的店铺ID信息

            // Shop shop = GlobalCache.ShopList.Find(t => t.ID == this.curReplenishOrder.ShopID);
            Shop   shop = (Shop)this.skinComboBoxShopID.SelectedItem;
            string id   = IDHelper.GetID(OrderPrefix.PfDelivery, shop.AutoCode);

            if (action == OperationEnum.Pick)
            {
                id = order?.ID;
            }
            //   string pOrderID = IDHelper.GetID(OrderPrefix.PurchaseOrder, shop.AutoCode);
            foreach (PfOrderDetail detail in this.curInboundDetailList)
            {
                if (detail.SumCount <= 0)
                {
                    continue;
                }

                totalCount      += detail.SumCount;
                totalPrice      += detail.SumMoney;
                totalCost       += detail.SumCost;
                detail.PfOrderID = id;
                details.Add(detail);
            }



            PfOrder pOrder = new PfOrder()
            {
                ShopID       = shop.ID,
                PfCustomerID = selectedSupplierID,// ValidateUtil.CheckEmptyValue(this.skinComboBox_SupplierID.SelectedValue),
                ID           = id,
                AdminUserID  = GlobalCache.CurrentUserID,
                CreateTime   = dateTimePicker_Start.Value,

                EntryTime    = DateTime.Now,
                TotalCount   = totalCount,
                TotalPrice   = totalPrice,
                TotalPfPrice = totalCost,
                Remarks      = this.skinTextBox_Remarks.SkinTxt.Text

                               // InboundOrderID=
            };

            return(new PfInfo()
            {
                PfOrder = pOrder,
                PfOrderDetails = details
            });
        }
 public static void Load()
 {
     Timers.TimerStart();
     if (TeleportCheck.IsEnabled)
     {
         TeleportCheck.DetectionLogsDir();
     }
     if (FlightCheck.IsEnabled)
     {
         FlightCheck.DetectionLogsDir();
     }
     if (HatchElevator.IsEnabled)
     {
         HatchElevator.DetectionLogsDir();
     }
     if (PlayerLogs.IsEnabled)
     {
         PlayerLogs.PlayerLogsDir();
     }
     if (Report.IsEnabled)
     {
         Report.ReportLogsDir();
     }
     if (PlayerStatCheck.IsEnabled)
     {
         PlayerStatCheck.DetectionLogsDir();
     }
     if (UndergroundCheck.IsEnabled)
     {
         UndergroundCheck.DetectionLogsDir();
     }
     if (Bank.IsEnabled)
     {
         Bank.CreateFolder();
     }
     if (AuctionBox.IsEnabled)
     {
         AuctionBox.CreateFolder();
     }
     if (Bounties.IsEnabled)
     {
         Players.CreateFolder();
     }
     if (CredentialCheck.IsEnabled)
     {
         CredentialCheck.CreateFolder();
     }
     if (DupeLog.IsEnabled)
     {
         DupeLog.CreateFolder();
     }
     Poll.CreateFolder();
     if (PersistentContainer.Instance.PollOpen)
     {
         Poll.Check();
     }
     if (ChatHook.Special_Player_Name_Coloring)
     {
         ChatHook.SpecialIdCheck();
     }
     if (ClanManager.IsEnabled)
     {
         PersistentContainer.Instance.Players.GetClans();
         ClanManager.BuildList();
     }
     if (!ClanManager.IsEnabled)
     {
         PersistentContainer.Instance.Players.clans.Clear();
         ClanManager.ClanMember.Clear();
     }
     if (!InfoTicker.IsEnabled && InfoTicker.IsRunning)
     {
         InfoTicker.Unload();
     }
     if (InfoTicker.IsEnabled && !InfoTicker.IsRunning)
     {
         InfoTicker.Load();
     }
     if (Gimme.IsRunning && !Gimme.IsEnabled)
     {
         Gimme.Unload();
     }
     if (!Gimme.IsRunning && Gimme.IsEnabled)
     {
         Gimme.Load();
     }
     if (UndergroundCheck.IsRunning && !UndergroundCheck.IsEnabled)
     {
         UndergroundCheck.Unload();
     }
     if (!UndergroundCheck.IsRunning && UndergroundCheck.IsEnabled)
     {
         UndergroundCheck.Load();
     }
     if (Badwords.IsRunning && !Badwords.IsEnabled)
     {
         Badwords.Unload();
     }
     if (!Badwords.IsRunning && Badwords.IsEnabled)
     {
         Badwords.Load();
     }
     if (!LoginNotice.IsRunning && LoginNotice.IsEnabled)
     {
         LoginNotice.Load();
     }
     if (LoginNotice.IsRunning && !LoginNotice.IsEnabled)
     {
         LoginNotice.Unload();
     }
     if (!Zones.IsRunning && Zones.IsEnabled)
     {
         Zones.Load();
     }
     if (Zones.IsRunning && !Zones.IsEnabled)
     {
         Zones.Unload();
     }
     if (!VoteReward.IsRunning && VoteReward.IsEnabled)
     {
         VoteReward.Load();
     }
     if (VoteReward.IsRunning && !VoteReward.IsEnabled)
     {
         VoteReward.Unload();
     }
     if (!Watchlist.IsRunning && Watchlist.IsEnabled)
     {
         Watchlist.Load();
     }
     if (Watchlist.IsRunning && !Watchlist.IsEnabled)
     {
         Watchlist.Unload();
     }
     if (!ReservedSlots.IsRunning && ReservedSlots.IsEnabled)
     {
         ReservedSlots.Load();
     }
     if (ReservedSlots.IsRunning && !ReservedSlots.IsEnabled)
     {
         ReservedSlots.Unload();
     }
     if (!StartingItems.IsRunning && StartingItems.IsEnabled)
     {
         StartingItems.Load();
     }
     if (StartingItems.IsRunning && !StartingItems.IsEnabled)
     {
         StartingItems.Unload();
     }
     if (!Travel.IsRunning && Travel.IsEnabled)
     {
         Travel.Load();
     }
     if (Travel.IsRunning && !Travel.IsEnabled)
     {
         Travel.Unload();
     }
     if (!Shop.IsRunning && Shop.IsEnabled)
     {
         Shop.Load();
     }
     if (Shop.IsRunning && !Shop.IsEnabled)
     {
         Shop.Unload();
     }
     if (!Motd.IsRunning && Motd.IsEnabled)
     {
         Motd.Load();
     }
     if (Motd.IsRunning && !Motd.IsEnabled)
     {
         Motd.Unload();
     }
     if (InventoryCheck.IsRunning && !InventoryCheck.IsEnabled)
     {
         InventoryCheck.Unload();
     }
     if (!InventoryCheck.IsRunning && InventoryCheck.IsEnabled)
     {
         InventoryCheck.Load();
     }
     if (HighPingKicker.IsRunning && !HighPingKicker.IsEnabled)
     {
         HighPingKicker.Unload();
     }
     if (!HighPingKicker.IsRunning && HighPingKicker.IsEnabled)
     {
         HighPingKicker.Load();
     }
     if (CredentialCheck.IsRunning && !CredentialCheck.IsEnabled)
     {
         CredentialCheck.Unload();
     }
     if (!CredentialCheck.IsRunning && CredentialCheck.IsEnabled)
     {
         CredentialCheck.Load();
     }
     if (CustomCommands.IsRunning && !CustomCommands.IsEnabled)
     {
         CustomCommands.Unload();
     }
     if (!CustomCommands.IsRunning && CustomCommands.IsEnabled)
     {
         CustomCommands.Load();
     }
     if (DupeLog.IsRunning && !DupeLog.IsEnabled)
     {
         DupeLog.Unload();
     }
     if (!DupeLog.IsRunning && DupeLog.IsEnabled)
     {
         DupeLog.Load();
     }
     if (AuctionBox.IsEnabled)
     {
         AuctionBox.AuctionList();
     }
     if (MutePlayer.IsEnabled)
     {
         MutePlayer.MuteList();
     }
     if (Jail.IsEnabled)
     {
         Jail.JailList();
     }
     if (Animals.IsEnabled)
     {
         Animals.AnimalList();
     }
     if (AutoShutdown.IsEnabled)
     {
         AutoShutdown.ShutdownList();
     }
 }
Exemple #57
0
 public void Add(Shop data)
 {
     _context.Add(data);
 }
Exemple #58
0
        public EntitiesContext() : base()
        {
            if (this.Database.CreateIfNotExists())
            {
                Random random = new Random();

                //Implémentation de la table Shops
                Shop shop = new Shop();
                {
                    shop.Town       = "rennes";
                    shop.Postalcode = 35000;
                    shop.Adress     = "intermarché longchamps";
                    shop.Nameshop   = "Les bleus bike shop";
                    shop.Phone      = "+33 2 99 00 00 00";
                    shop.Email      = "*****@*****.**";
                    shop.Website    = "www.lesyeuxdanslesbleus.com";
                    this.Shops.Add(shop);
                    this.SaveChanges();
                }

                //Implémentation de la table Roles
                {
                    Role role1 = new Role();
                    role1.Name = "Admin";
                    Role role2 = new Role();
                    role2.Name = "Seller";
                    this.Roles.Add(role1);
                    this.Roles.Add(role2);
                    this.SaveChanges();
                }

                // Implémentation de la table Sellers
                for (int i = 1; i < 5; i++)
                {
                    Seller Seller = new Seller();
                    Seller.Role      = this.Roles.Find(random.Next(1, this.Roles.Count()));
                    Seller.FirstName = "firstName" + i;
                    Seller.LastName  = "lastName" + i;
                    Seller.Password  = "******" + i;
                    Seller.Shop      = this.Shops.Find(1);
                    this.Sellers.Add(Seller);
                    this.SaveChanges();
                }

                // Implémentation de la table Customers
                for (int i = 1; i < 5; i++)
                {
                    Customer customer = new Customer();
                    customer.Gender        = "male";
                    customer.Address       = "adress" + i;
                    customer.Email         = "email" + i;
                    customer.FirstName     = "firstname" + i;
                    customer.LastName      = "lastname" + i;
                    customer.LoyaltyPoints = 0;
                    customer.Phone         = "+33 6 00 00 0" + i;
                    customer.PostalCode    = 35000;
                    customer.Town          = "rennes";
                    customer.Shop          = this.Shops.Find(1);
                    this.Customers.Add(customer);
                    this.SaveChanges();
                }

                // Implémentation de la table Orders
                Order order = new Order();
                {
                    order.Date            = DateTime.Now;
                    order.Discount        = 0.1F;
                    order.Seller          = this.Sellers.Find(random.Next(1, this.Sellers.Count()));
                    order.Customer        = this.Customers.Find(random.Next(1, this.Sellers.Count()));
                    order.Shop            = this.Shops.Find(1);
                    order.UseLoyaltyPoint = false;
                    order.Tax             = 0.2F;
                    order.ShippingCost    = 0;
                    order.PayMode         = "CB";
                    this.Orders.Add(order);
                    this.SaveChanges();
                }

                // Implémentation de la table Bicycles
                Bicycle bicycle = new Bicycle();
                //non achetés
                for (int i = 1; i < 5; i++)
                {
                    bicycle.Shop         = this.Shops.Find(1);
                    bicycle.Order        = null;
                    bicycle.Customer     = null;
                    bicycle.TypeOfBike   = "xc";
                    bicycle.Exchangeable = true;
                    bicycle.Insurance    = true;
                    bicycle.Deliverable  = true;
                    bicycle.Category     = "man";
                    bicycle.Reference    = "xc000" + i;
                    bicycle.Size         = 1.75F + i * 0.01F;
                    bicycle.Weight       = 11.5F + i * 0.5F;
                    bicycle.Color        = "red and black";
                    bicycle.Confort      = "full";
                    bicycle.FreeTaxPrice = 2000F - i * 100;
                    bicycle.Electric     = false;
                    bicycle.State        = "new";
                    bicycle.Brand        = "les bleus";
                    this.Bicycles.Add(bicycle);
                    this.SaveChanges();
                }
                //acheté
                {
                    bicycle.Shop         = this.Shops.Find(1);
                    bicycle.Order        = this.Orders.Find(1);
                    bicycle.Customer     = this.Customers.Find(random.Next(1, this.Customers.Count()));
                    bicycle.TypeOfBike   = "fitness";
                    bicycle.Exchangeable = true;
                    bicycle.Insurance    = true;
                    bicycle.Deliverable  = true;
                    bicycle.Category     = "woman";
                    bicycle.Reference    = "fitness0001";
                    bicycle.Size         = 1.70F;
                    bicycle.Weight       = 8.5F;
                    bicycle.Color        = "yellow and white";
                    bicycle.Confort      = "";
                    bicycle.FreeTaxPrice = 2000F;
                    bicycle.Electric     = false;
                    bicycle.State        = "new";
                    bicycle.Brand        = "les bleus";
                    this.Bicycles.Add(bicycle);
                    this.SaveChanges();
                }
            }
        }
Exemple #59
0
 public void Update(Shop data)
 {
     _context.Update(data);
 }
Exemple #60
-1
        public void TestResolveBackReference()
        {
            Owner owner = new Owner {Name = "Arthur Dent"};
            Shop shop = new Shop {Owner = owner};

            ObjectGraph graph = new ObjectGraph(shop);
            object backReference = graph.ResolveBackReference(owner);
            Assert.IsTrue(Object.ReferenceEquals(backReference, shop));
        }