Example #1
0
        private void btn_getMin_Click(object sender, EventArgs e)
        {
            if (cmb_abSearches.SelectedValue + "" == "-1")
            {
                MessageBox.Show("Select a search");
                return;
            }
            if (cmb_accounts.SelectedValue + "" == "-1")
            {
                MessageBox.Show("Login And select a account to run search with");
                return;
            }

            lbl_minResult.Visible = true;

            var playerSearchCriteria = SearchDAL.GetSearch <PlayerSearchCriteria>(cmb_abSearches.SelectedValue);
            var userCrendential      = UserDAL.GetUser(cmb_accounts.SelectedValue);

            var loginResult = LoginAccount(userCrendential);

            if (loginResult == "Loggedin Successfully")
            {
                TransferHelper helper          = new TransferHelper(userCrendential);
                var            minPriceResults = helper.GetMinPrice(playerSearchCriteria);
                grd_minPrices.DataSource = minPriceResults;
                grd_minPrices.Visible    = true;
                lbl_minResult.Text       = $"Top {minPriceResults.Count} Min Price for the search";
            }
            else
            {
                MessageBox.Show("Error occured when trying to login");
            }
        }