示例#1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            double amount = 0;

            if (!Double.TryParse(txtAmount.Text.Trim(), out amount))
            {
                MessageForm.Error("Please enter correct amount.");
                return;
            }

            Kv kv = new Kv();

            kv.Set("TournamentID", this.Tournament.TournamentID);
            kv.Set("PrizePosition", GetPrizeIndex(cmbPrize.Text));
            kv.Set("TournamentPrizeCategoryID", Convert.ToInt32(cmbCategory.SelectedValue));
            kv.Set("PrizeAmount", amount);

            DataSet ds = SocketClient.AddPrize(kv);

            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                TournamentPrize = new TournamentPrize(Ap.Cxt, ds.Tables[0].Rows[0]);
            }
            txtAmount.Text = "";
            RefreshGrid();
        }
示例#2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            TournamentPrize tp = new TournamentPrize();

            tp.PrizePosition             = (int)cmbPrize.SelectedValue;
            tp.TournamentPrizeCategoryID = (int)cmbCategory.SelectedValue;
            tp.PrizeAmount = BaseItem.ToDecimal(txtAmount.Text);

            tp.TournamentID = 1;

            SocketClient.AddPrize(tp.DataRow.Table);
        }