示例#1
0
 private void FrmUpdateData_Load(object sender, EventArgs e)
 {
     try
     {
         BuildCmbGroup();
         BuildCmbAccount(cmbGroup.Text);
         BuildLstCars(ConfigCtrl.GetCarsInMarket());
         BuildLstMatches(ConfigCtrl.GetMatches());
         BuildLstFruits(ConfigCtrl.GetFruits());
         BuildLstCalves(ConfigCtrl.GetCalvesInShop());
         BuildLstAnimalProducts(ConfigCtrl.GetAnimalProducts());
         BuildLstFishFrys(ConfigCtrl.GetFishFrysInShop());
         BuildLstFishTackles(ConfigCtrl.GetFishTacklesInShop());
         BuildLstFishMatured(ConfigCtrl.GetFishMaturedInMarket());
         BuildLstAssets(ConfigCtrl.GetAssetsInShop());
         BuildLstDishes(ConfigCtrl.GetDishesInMenu());
         BuildGridViewSeeds(AddColumnsToTable(ConfigCtrl.GetSeedsToTable()), "种子列表读取失败!");
         BuildRankGridViewSeeds(AddRankColumnsToTable(ConfigCtrl.GetRankSeedsToTable()), "等级种子列表读取失败!");
         BuildDgvAssetRecommends(AddColumnsToAssetRecommends(ConfigCtrl.GetAssetsToTable()), "推荐买卖率表读取失败!");
         BuildDgvAdvancedPurchase(AddColumnsToAdvancedPurchase(ConfigCtrl.GetAdvancedPurchaseToTable()), "高级购买配置表读取失败!");
         BuildDgvTransactionDishes(AddColumnsToTransactionDishes(ConfigCtrl.GetTransactionDishesToTable()), "菜肴交易价格表读取失败!");
         _shopseeds = ConfigCtrl.GetSeedsInShop();
     }
     catch (Exception ex)
     {
         Program.ShowMessageBox("FrmUpdateData", ex);
     }
 }
示例#2
0
        private void FrmBuildTeam_Load(object sender, EventArgs e)
        {
            try
            {
                cmbMaxCarCount.SelectedIndex = cmbMaxCarCount.Items.Count - 2;

                //市场上的汽车
                _carsInMarket = ConfigCtrl.GetCarsInMarket();
                if (_carsInMarket == null)
                {
                    return;
                }
                lstViewCarsInMarket.Items.Clear();

                int num = 1;
                foreach (NewCarInfo car in _carsInMarket)
                {
                    string[] subItem = new string[4];
                    subItem[0] = num.ToString();
                    subItem[1] = car.CarName;
                    subItem[2] = car.CarPrice.ToString();
                    subItem[3] = car.CarId.ToString();
                    lstViewCarsInMarket.Items.Add(new ListViewItem(subItem));
                    num++;
                }

                BuildCmbGroup();
                BuildCmbAccount(cmbGroup.Text);
            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("FrmBuildTeam", ex);
            }
        }
示例#3
0
        private void FrmBuyCards_Load(object sender, EventArgs e)
        {
            try
            {
                //build group combox
                string[] groups = ConfigCtrl.GetGroups();
                if (groups != null)
                {
                    foreach (string group in groups)
                    {
                        cmbGroup.Items.Add(group);
                    }
                }

                if (cmbGroup.Items.Count > 0)
                {
                    cmbGroup.SelectedIndex = 0;
                }

                cmbGroup_SelectedIndexChanged(null, null);

                //市场上的汽车
                _carsinmarket = ConfigCtrl.GetCarsInMarket();
                listBoxSelectorCars.Clear();
                listBoxSelectorCars.AllItems = _carsinmarket;

                chkUpgradeFreeGarage.Checked = true;
                chkBuyNewCars.Checked        = true;
                chkBuyNewCars_CheckedChanged(null, null);

                cmbMaxCars.SelectedIndex = 8;
            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("FrmUpgradeGarage", ex);
            }
        }
示例#4
0
        void _toolbuildteam_MyCarFetched(Collection <CarInfo> cars, int parkcash, int carprice)
        {
            try
            {
                if (this.InvokeRequired)
                {
                    this.Invoke(new GamePark.MyCarFetchedEventHandler(_toolbuildteam_MyCarFetched), new object[] { cars, parkcash, carprice });
                }
                else
                {
                    if (cars != null && cars.Count > 0 && parkcash > 0 && carprice > 0)
                    {
                        txtCash.Text         = parkcash.ToString();
                        txtCarPrice.Text     = carprice.ToString();
                        txtSum.Text          = (parkcash + carprice).ToString();
                        txtAllAsset.Text     = txtSum.Text;
                        txtAveragePrice.Text = ((parkcash + carprice) / 6).ToString();
                        lstViewMyCars.Items.Clear();
                        int num = 1;
                        foreach (CarInfo car in SortCarsList(cars))
                        {
                            string[] subItem = new string[4];
                            subItem[0] = num.ToString();
                            subItem[1] = car.CarName;
                            subItem[2] = car.CarPrice.ToString();
                            subItem[3] = car.CarId.ToString();
                            lstViewMyCars.Items.Add(new ListViewItem(subItem));
                            num++;
                        }

                        Collection <NewCarInfo> allbuildablecars = _toolbuildteam.GetBuildableCars(parkcash, carprice, ConfigCtrl.GetCarsInMarket());
                        lstViewValidCars.Items.Clear();
                        num = 1;
                        foreach (NewCarInfo car in allbuildablecars)
                        {
                            string[] subItem = new string[4];
                            subItem[0] = num.ToString();
                            subItem[1] = car.CarName;
                            subItem[2] = car.CarPrice.ToString();
                            subItem[3] = car.CarId.ToString();
                            lstViewValidCars.Items.Add(new ListViewItem(subItem));
                            num++;
                        }
                    }
                    SetControlStatus(true);
                }
            }
            catch (Exception ex)
            {
                Program.ShowMessageBox("FrmBuildTeam", ex);
            }
        }