Esempio n. 1
0
        public async Task UserAcceptedWithdrawOfferSuccessTest()
        {
            _offerMinmalInfo.StatusCode = 6;

            var offerManager = new OfferManager(
                _fakedSteamHubConnection,
                _fakedOfferService,
                new RpcSteamListener(_loggerDummy),
                _loggerDummy,
                _fakedGrpcServiceFactory,
                _fakedUserService,
                _fakedRepoServiceFactory
                );

            await offerManager.HandleOffer(_offerMinmalInfo);

            A.CallTo(() => _fakedSteamServiceClient.GetPlayerInfoAsync(new GetPlayerInfoRequest
            {
                SteamId = _offerMinmalInfo.SteamId
            })).MustHaveHappened();

            A.CallTo(() => _fakedUserService.FindAsync(_offerMinmalInfo.SteamId)).MustHaveHappened();
            A.CallTo(() => _fakedUserService.UpdateUserInfoIfNeeded(A <DatabaseModel.User> ._, A <DatabaseModel.User> ._)).MustHaveHappened();

            A.CallTo(() => _fakedSteamHubConnection.SendOfferStatusToUser(A <OfferStatusRequest> .That.Matches(request => request.StatusCode == 6),
                                                                          ("user Steamid"))).MustHaveHappened();
            A.CallTo(() => _fakedOfferService.WithdrawalSteamOffer(A <OfferStatusRequest> ._)).MustHaveHappened();
        }
Esempio n. 2
0
 public Manager()
 {
     repo_category    = new CategoryManager();
     repo_email       = new EmailManager();
     repo_team        = new TeamManager();
     repo_product     = new ProductManager();
     repo_member      = new MemberManager();
     repo_order       = new OrderManager();
     repo_city        = new CityManager();
     repo_town        = new TownManager();
     repo_offer       = new OfferManager();
     repo_orderdetail = new OrderDetailManager();
 }
Esempio n. 3
0
        public ActionResult Create(Offer offer)
        {
            if (this.ModelState.IsValid)
            {
                //add the product to the db
                OfferManager.Create(offer);

                return(RedirectToAction(actionName: "Index", controllerName: "Dashboard"));
            }
            else
            {
                return(Content("error"));
            }
        }
    // FUNCTIONS

    // Use this for initialization
    void Start()
    {
        player       = FindObjectOfType <PlayerScript> ();
        offerManager = FindObjectOfType <OfferManager> ();
        enemy        = FindObjectOfType <AI> ();
        audioManager = FindObjectOfType <AudioManager> ();

        player.availableMoney = player.totalMoney;

        gameOver     = false;
        currentState = States.PRE_TURN;

        ResetArtifacts();
    }
Esempio n. 5
0
        public FormManagerKP()
        {
            InitializeComponent();

            _projectManager      = new ProjectManager.ProjectManager();
            _manager             = new OfferManager();
            _mappingColumnsOffer = new List <OfferColumnMapping>();

            //  ListKP.FullRowSelect = true;
            // ListKP.MultiSelect = false;
            TableColumns.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableWithoutHeaderText;

            ListKP.View = View.List;
            LoadData();
        }
Esempio n. 6
0
    public void Start()
    {
        anim          = GetComponent <UIAnimation>();
        animFramework = GetComponent <UIAnimationFramework>();
        anim.Open("menu", 0);
        offers = GetComponent <OfferManager>();

        offers.Init();


        List <SpriteRenderer> walls_renders = new List <SpriteRenderer>();

        walls_renders.Add(wallLeft1.GetComponent <SpriteRenderer>());
        walls_renders.Add(wallLeft2.GetComponent <SpriteRenderer>());
        walls_renders.Add(wallRight1.GetComponent <SpriteRenderer>());
        walls_renders.Add(wallRight2.GetComponent <SpriteRenderer>());
        walls = walls_renders.ToArray();
    }
Esempio n. 7
0
 /// <summary>
 /// Ends all timers/cooldowns and removes all offers
 /// </summary>
 public void EndCycle()
 {
     if (TimerManager != null)
     {
         TimerManager.EndAllTimers();
         TimerManager = null;
     }
     if (OfferManager != null)
     {
         OfferManager.EndAllOffers();
         OfferManager = null;
     }
     if (CooldownManager != null)
     {
         CooldownManager.EndAllCooldowns();
         CooldownManager = null;
     }
 }
Esempio n. 8
0
        public async Task OfferWillBeInEscrowNotifyUserSuccessTest()
        {
            _offerMinmalInfo.StatusCode = 3;

            var offerManager = new OfferManager(
                _fakedSteamHubConnection,
                _fakedOfferService,
                new RpcSteamListener(_loggerDummy),
                _loggerDummy,
                _fakedGrpcServiceFactory,
                _fakedUserService,
                _fakedRepoServiceFactory
                );

            await offerManager.HandleOffer(_offerMinmalInfo);

            A.CallTo(() => _fakedSteamHubConnection.SendOfferStatusToUser(A <OfferStatusRequest> .That.Matches(request => request.StatusCode == 3),
                                                                          ("user Steamid"))).MustHaveHappened();
        }
 private void BT_DeleteOffer_Click(object sender, RoutedEventArgs e)
 {
     if (DG_Offers.SelectedIndex != -1)
     {
         OfferManager offerManager = new OfferManager();
         if (offerManager.DeleteOffer((DG_Offers.SelectedItem as GridViewSources.Offer).ID))
         {
             DisplayNotifyBox("Deleted", "The offer has been deleted", 3);
             RefreshOffers();
         }
         else
         {
             DisplayNotifyBox("ERROR", "The offer could not be deleted", 5);
         }
     }
     else
     {
         DisplayNotifyBox("Cannot Delete", "Please select offer to be deleted", 5);
     }
 }
Esempio n. 10
0
        public async Task SendSellRakeOfferWasAcceptedSuccess()
        {
            _offerMinmalInfo.StatusCode = 6;
            _offerMinmalInfo.OfferSend.SteamOffer.Message = "sendSellRakeOffer";

            var offerManager = new OfferManager(
                _fakedSteamHubConnection,
                _fakedOfferService,
                new RpcSteamListener(_loggerDummy),
                _loggerDummy,
                _fakedGrpcServiceFactory,
                _fakedUserService,
                _fakedRepoServiceFactory
                );

            await offerManager.HandleOffer(_offerMinmalInfo);

            A.CallTo(() => _fakedRakeItemRepo.SetAsSold(A <List <string> > .That.Matches(l => l.Count == 6))).MustHaveHappened();
            A.CallTo(() => _fakedSteamHubConnection.SendOfferStatusToUser(A <OfferStatusRequest> ._, A <string> ._)).MustNotHaveHappened();
        }
Esempio n. 11
0
        static void Main(string[] args)
        {
            GamerManager gamerManager = new GamerManager(new UserValidationManager());

            gamerManager.Add(new Gamer
            {
                Id             = 1,
                BirthYear      = new DateTime(1988),
                FirstName      = "ETHEM ANIL",
                LastName       = "SANDALCI",
                IdentityNumber = 12345
            });

            GameManager gameManager = new GameManager();

            gameManager.Add(new Game
            {
                Id           = 3,
                ProductName  = "Diablo III",
                ProductPrice = 19
            });

            OfferManager offerManager = new OfferManager();

            offerManager.Add(new Offer
            {
                Id        = 5,
                OfferName = "Legend Of Summer",
                Discount  = 30
            });

            SaleManager salesManager = new SaleManager();

            salesManager.Add(new Gamer {
                FirstName = "ETHEM ANIL, "
            }, new Game {
                ProductName = "Diablo, "
            }, new Offer {
                OfferName = "Legend Of Summer"
            });
        }
Esempio n. 12
0
        public async Task OfferStatusReturnsError()
        {
            _offerMinmalInfo.StatusCode = 6;
            _offerMinmalInfo.Error      = new OfferStatusError
            {
                Message = "Error"
            };

            var offerManager = new OfferManager(
                _fakedSteamHubConnection,
                _fakedOfferService,
                new RpcSteamListener(_loggerDummy),
                _loggerDummy,
                _fakedGrpcServiceFactory,
                _fakedUserService,
                _fakedRepoServiceFactory
                );

            await offerManager.HandleOffer(_offerMinmalInfo);

            A.CallTo(() => _fakedSteamHubConnection.SendErrorMessageRelatedToOurApi(A <string> ._, A <string> ._)).MustHaveHappened();
            A.CallTo(() => _fakedRakeItemRepo.SetAsSold(A <List <string> > ._)).MustNotHaveHappened();
            A.CallTo(() => _fakedSteamHubConnection.SendOfferStatusToUser(A <OfferStatusRequest> ._, A <string> ._)).MustNotHaveHappened();
        }
Esempio n. 13
0
        static void Main(string[] args)
        {
            Game game1 = new Game {
                GameID = 1, GameName = "Doom Eternal", GamePrice = 60, GameStock = 451, IsOnSale = false
            };
            Game game2 = new Game {
                GameID = 2, GameName = "Cyberpunk 2077", GamePrice = 70, GameStock = 1332, IsOnSale = false
            };
            Game game3 = new Game {
                GameID = 3, GameName = "GTA V", GamePrice = 30, GameStock = 54, IsOnSale = true
            };
            Game game4 = new Game {
                GameID = 4, GameName = "Civilization VI", GamePrice = 35, GameStock = 12, IsOnSale = true
            };
            Game game5 = new Game {
                GameID = 5, GameName = "Red Dead Redemption", GamePrice = 80, GameStock = 101, IsOnSale = true
            };

            Game[]      games    = new Game[] { game1, game2, game3, game4 };
            List <Game> lstGames = new List <Game> {
                game1, game2, game3, game4
            };

            Customer customer1 = new Customer {
                Id = 1, FirstName = "Ozan", LastName = "Şengül", Password = "******", DateOfBirth = new DateTime(1997, 11, 05), NationalityID = "29300054534"
            };
            Customer customer2 = new Customer {
                Id = 2, FirstName = "Tuncay", LastName = "Göçkon", Password = "******", DateOfBirth = new DateTime(1997, 07, 30), NationalityID = "21568251100"
            };
            Customer customer3 = new Customer {
                Id = 3, FirstName = "Defne", LastName = "Demirbaş", Password = "******", DateOfBirth = new DateTime(1998, 09, 05), NationalityID = "13450066892"
            };

            Customer[] customers = new Customer[] { customer1, customer2, customer3 };

            Offer offer1 = new Offer {
                GameName = "Red Dead Redemption II", Discount = 30, OfferEnds = new DateTime(2021, 04, 01)
            };

            List <Offer> allOffers = new List <Offer> {
                offer1
            };

            OfferManager    offerManager    = new OfferManager();
            GameManager     gameManager     = new GameManager();
            EDevletManager  eDevletManager  = new EDevletManager();
            CustomerManager customerManager = new CustomerManager();

            while (true)
            {
                menu : Console.WriteLine("Please choose an option: \r\n 1. Player Options \r\n 2. Games");
                string o1 = null;
                o1 = Console.ReadLine();

                switch (o1)
                {
                case "1":
                    Console.WriteLine("Please choose an option: \r\n 1. Sign Up \r\n 2. Delete Account \r\n 3. Update Account");
                    string o2 = null;
                    o2 = Console.ReadLine();

                    switch (o2)
                    {
                    case "1":
                        Console.WriteLine("Please enter your Nationality ID Number:");
                        string enteredID = null;
                        enteredID = Console.ReadLine();
                        for (int y = 0; y < customers.Length; y++)
                        {
                            if (enteredID == customers[y].NationalityID)
                            {
                                eDevletManager.IsValidCustomer();
                                customerManager.SignUp(new Customer());
                                goto menu;
                            }
                        }
                        Console.WriteLine("You have entered a wrong Nationality ID Number.");
                        break;

                    case "2":
                        Console.WriteLine("Please enter your password to continue:");
                        customerManager.Delete(Console.ReadLine());
                        break;

                    case "3":
                        customerManager.Update();
                        goto menu;
                    }
                    break;

                case "2":
                    Console.WriteLine("All Games:");
                    gameManager.ListAll(lstGames);
                    Console.WriteLine("------------------");
                    offerManager.ShowOffers(allOffers);
                    Console.WriteLine("------------------");
                    Console.WriteLine("Games on sale:");
                    gameManager.ListOnSale(lstGames);
                    Console.WriteLine("\r\nPlease enter a game ID to continue");
                    int enteredNo = new int();
                    enteredNo = Convert.ToInt32(Console.ReadLine());
                    #region
                    for (int i = 0; i < games.Length; i++)
                    {
                        if (enteredNo == games[i].GameID)
                        {
                            Console.WriteLine("Please choose: \r\n 1. Add to cart \r\n 2. Buy now");
                            string o3 = null;
                            o3 = Console.ReadLine();
                            switch (o3)
                            {
                            case "1":
                                gameManager.AddToCart(game2);
                                Console.WriteLine("You have special offers:");
                                Console.WriteLine("Rather than $" + game2.GamePrice + "\n");
                                offerManager.CalculateOffer(game2);

                                goto menu;

                            case "2":
                                gameManager.BuyNow(game1);
                                Console.WriteLine("You have special offers:");
                                Console.WriteLine("Rather than $" + game1.GamePrice + "\n");
                                offerManager.CalculateOffer(game1);
                                goto menu;
                            }
                        }
                    }
                    Console.WriteLine("You have entered a false game ID");
                    #endregion
                    goto menu;


                case "3":
                    customerManager.Update();
                    goto menu;
                }
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Constructs the class
        /// </summary>
        public RoleplayUser(GameClient Client, DataRow user, DataRow cooldown, DataRow farming)
        {
            // Client Info
            this.Client = Client;

            // Basic Info
            this.mId             = Convert.ToUInt32(user["id"]);
            this.mLevel          = Convert.ToInt32(user["level"]);
            this.mLevelEXP       = Convert.ToInt32(user["level_exp"]);
            this.mClass          = Convert.ToString(user["class"]);
            this.mPermanentClass = PlusEnvironment.EnumToBool(user["permanent_class"].ToString());

            // Work Related
            this.mJobId            = Convert.ToInt32(user["job_id"]);
            this.mJobRank          = Convert.ToInt32(user["job_rank"]);
            this.mJobRequest       = Convert.ToInt32(user["job_request"]);
            this.mSendHomeTimeLeft = Convert.ToInt32(user["sendhome_time_left"]);

            // Human Needs
            this.mMaxHealth = Convert.ToInt32(user["maxhealth"]);
            this.mCurHealth = Convert.ToInt32(user["curhealth"]);
            this.mMaxEnergy = Convert.ToInt32(user["maxenergy"]);
            this.mCurEnergy = Convert.ToInt32(user["curenergy"]);
            this.mHunger    = Convert.ToInt32(user["hunger"]);
            this.mHygiene   = Convert.ToInt32(user["hygiene"]);

            // Levelable Statistics
            this.mIntelligence = Convert.ToInt32(user["intelligence"]);
            this.mStrength     = Convert.ToInt32(user["strength"]);
            this.mStamina      = Convert.ToInt32(user["stamina"]);

            // Extra Variables for Levelable Stats
            this.mIntelligence = Convert.ToInt32(user["intelligence_exp"]);
            this.mStrengthEXP  = Convert.ToInt32(user["strength_exp"]);
            this.mStaminaEXP   = Convert.ToInt32(user["stamina_exp"]);

            // Jailed - Dead - Wanted - Probation
            this.mIsDead            = PlusEnvironment.EnumToBool(user["is_dead"].ToString());
            this.mDeadTimeLeft      = Convert.ToInt32(user["dead_time_left"]);
            this.mIsJailed          = PlusEnvironment.EnumToBool(user["is_jailed"].ToString());
            this.mJailedTimeLeft    = Convert.ToInt32(user["jailed_time_left"]);
            this.mIsWanted          = PlusEnvironment.EnumToBool(user["is_wanted"].ToString());
            this.mWantedLevel       = Convert.ToInt32(user["wanted_level"]);
            this.mWantedTimeLeft    = Convert.ToInt32(user["wanted_time_left"]);
            this.mOnProbation       = PlusEnvironment.EnumToBool(user["on_probation"].ToString());
            this.mProbationTimeLeft = Convert.ToInt32(user["probation_time_left"]);
            this.mCuffed            = PlusEnvironment.EnumToBool(user["is_cuffed"].ToString());
            this.mCuffedTimeLeft    = Convert.ToInt32(user["cuffed_time_left"]);

            // Statistics
            this.mPunches    = Convert.ToInt32(user["punches"]);
            this.mKills      = Convert.ToInt32(user["kills"]);
            this.mHitKills   = Convert.ToInt32(user["hit_kills"]);
            this.mGunKills   = Convert.ToInt32(user["gun_kills"]);
            this.mDeaths     = Convert.ToInt32(user["deaths"]);
            this.mCopDeaths  = Convert.ToInt32(user["cop_deaths"]);
            this.mTimeWorked = Convert.ToInt32(user["time_worked"]);
            this.mArrests    = Convert.ToInt32(user["arrests"]);
            this.mArrested   = Convert.ToInt32(user["arrested"]);
            this.mEvasions   = Convert.ToInt32(user["evasions"]);

            // Banking
            this.mBankAccount   = Convert.ToInt32(user["bank_account"]);
            this.mBankChequings = Convert.ToInt32(user["bank_chequings"]);
            this.mBankSavings   = Convert.ToInt32(user["bank_savings"]);

            // Affiliations
            this.mLastKilled = Convert.ToInt32(user["last_killed"]);
            this.mMarriedTo  = Convert.ToInt32(user["married_to"]);

            // Gangs
            this.mGangId      = Convert.ToInt32(user["gang_id"]);
            this.mGangRank    = Convert.ToInt32(user["gang_rank"]);
            this.mGangRequest = Convert.ToInt32(user["gang_request"]);

            // Inventory
            this.mPhoneApps    = Convert.ToString(user["phone_apps"]).Split(':').ToList();
            this.mPhoneType    = Convert.ToInt32(user["phone"]);
            this.mCarType      = Convert.ToInt32(user["car"]);
            this.mCarFuel      = Convert.ToInt32(user["car_fuel"]);
            this.mWeed         = Convert.ToInt32(user["weed"]);
            this.mCocaine      = Convert.ToInt32(user["cocaine"]);
            this.mCigarettes   = Convert.ToInt32(user["cigarette"]);
            this.mBullets      = Convert.ToInt32(user["bullets"]);
            this.mDynamite     = Convert.ToInt32(user["dynamite"]);
            this.mOwnedWeapons = LoadAndReturnWeapons();

            // Farming
            this.FarmingStats = new FarmingStats(farming);

            // Misc
            this.mRPQuests             = user["unlocked_quests"].ToString().Split(',');
            this.mBrawlWins            = Convert.ToInt32(user["brawl_wins"]);
            this.mCwWins               = Convert.ToInt32(user["cw_wins"]);
            this.mMwWins               = Convert.ToInt32(user["mw_wins"]);
            this.mSoloQueueWins        = Convert.ToInt32(user["soloqueue_wins"]);
            this.mIsNoob               = PlusEnvironment.EnumToBool(user["is_noob"].ToString());
            this.mNoobTimeLeft         = Convert.ToInt32(user["noob_time_left"]);
            this.AnsweredPollQuestions = new ConcurrentDictionary <int, List <PollQuestion> >();
            this.mVIPBanned            = Convert.ToInt32(user["vip_banned"]);
            this.mLastCoordinates      = user["last_coordinates"].ToString();

            // Manages the timers for the user
            this.TimerManager = new TimerManager(Client);

            // Manages the cooldowns for the user
            this.CooldownManager  = new CooldownManager(Client);
            this.SpecialCooldowns = this.LoadAndReturnCooldowns(cooldown);

            // Manages the offers for the user
            this.OfferManager = new OfferManager(Client);

            // Handles the users data
            this.UserDataHandler = new UserDataHandler(Client, this);

            // Handles bot friendships
            this.BotFriendShips = new ConcurrentDictionary <int, RoleplayBot>();

            // Fun stuff
            this.Invisible = false;

            // WebSocket
            if (user.Table.Columns.Contains("wchat_banned"))
            {
                this.BannedFromChatting = PlusEnvironment.EnumToBool(Convert.ToString(user["wchat_banned"]));
            }

            if (user.Table.Columns.Contains("wchat_making_banned"))
            {
                this.BannedFromMakingChat = PlusEnvironment.EnumToBool(Convert.ToString(user["wchat_making_banned"]));
            }
        }
Esempio n. 15
0
        static void Main(string[] args)
        {
            CustomerManager customerManager = new CustomerManager(new CustomerValidationManager());

            Customer musteri1 = new Customer();

            musteri1.FirstName      = "Ulaş";
            musteri1.CustomerID     = 1;
            musteri1.LastName       = "Bozkurt";
            musteri1.IdentityNumber = "1111111";
            musteri1.DateOfBirth    = new DateTime(1997);

            Customer musteri2 = new Customer();

            musteri2.FirstName      = "Can";
            musteri2.CustomerID     = 2;
            musteri2.LastName       = "Bozkurt";
            musteri2.IdentityNumber = "2222222";
            musteri2.DateOfBirth    = new DateTime(1998);

            Customer musteri3 = new Customer();

            musteri3.FirstName      = "Haydar";
            musteri3.CustomerID     = 3;
            musteri3.LastName       = "Bozkurt";
            musteri3.IdentityNumber = "333333";
            musteri3.DateOfBirth    = new DateTime(1999);

            customerManager.Update(musteri1);
            customerManager.Delete(musteri2);
            customerManager.Register(musteri3);

            Console.WriteLine("------------");


            Offers offer1 = new Offers();

            offer1.OfferID     = 1;
            offer1.OfferType   = "İskonto 1";
            offer1.OfferStatus = true;

            Offers offer2 = new Offers();

            offer2.OfferID     = 2;
            offer2.OfferType   = "İskonto 2";
            offer2.OfferStatus = true;

            Offers offer3 = new Offers();

            offer3.OfferID     = 3;
            offer3.OfferType   = "İskontosuz";
            offer3.OfferStatus = false;

            OfferManager offerManager = new OfferManager();

            offerManager.NewOffer(offer1);
            offerManager.UpdateOffer(offer2);
            offerManager.DeleteOffer(offer3);
            offerManager.DeleteOffer(offer1);
            offerManager.DeleteOffer(offer2);

            Console.WriteLine("------------");

            MarketManager marketManager = new MarketManager();

            marketManager.Buy(offer1, musteri1);
            marketManager.Buy(offer2, musteri2);


            marketManager.Buy(offer3, musteri3);



            Console.ReadLine();
        }
Esempio n. 16
0
 public ActionResult Delete(int id)
 {
     OfferManager.Delete(id);
     this.TempData["msg"] = "The offer with id: " + id + " has been successfully deleted";
     return(RedirectToAction(actionName: "Index", controllerName: "Dashboard"));
 }
Esempio n. 17
0
        // GET: Offer
        public ActionResult DisplayOffers()
        {
            List <Offer> allOffers = OfferManager.GetAll();

            return(PartialView(allOffers));
        }
Esempio n. 18
0
        private void BtnOpenFolder_Click(object sender, EventArgs e)
        {
            string folder = OfferManager.GetFolderSettingsKP();

            System.Diagnostics.Process.Start(folder);
        }