コード例 #1
0
ファイル: EventPricing.aspx.cs プロジェクト: BraZee/IgniteMe
        protected void btnSaveTicket_OnClick(object sender, EventArgs e)
        {
            var ticketDS = new DAL.EventTicketDataSet();

            ticketDS.EventTicket.AddEventTicketRow(Utilities.editId, txtName.Text, decimal.Parse(txtPrice.Text),
                                                   int.Parse(cbCurrency.SelectedValue), eventId, eventName, int.Parse(txtMaxEntries.Text),
                                                   int.Parse(txtNumDays.Text), chkDuplicates.Checked, chkActive.Checked, cbCurrency.SelectedItem.ToString(),
                                                   int.Parse(txtMaxSession.Text), txtDescription.Text);

            if (Utilities.editId != -1)
            {
                int result = dataProvider.UpdateEventTicketPrice(userToken, ticketDS);

                if (result != -1)
                {
                    SetToast("success", "Ticket has been succesfully updated");
                    Utilities.editId = -1;
                    btnCloseModal_OnClick(sender, e);
                }
                else
                {
                    SetToast("error", "Ticket already exists");
                }
            }
            else
            {
                if (!Utilities.CheckGridForText(dgvTicket, txtName.Text))
                {
                    int result = dataProvider.AddEventTicketPrice(Utilities.userToken, ticketDS);

                    if (result != -1)
                    {
                        Utilities.editId = -1;
                        SetToast("success", "Ticket was created successfully.");
                    }
                    else
                    {
                        SetToast("error", "An error has occured, try again.");
                    }
                }
                else
                {
                    SetToast("info", "Ticket already exists");
                }

                DisplayTicketsInGrid();
            }

            DisplayTicketsInGrid();
        }
コード例 #2
0
ファイル: EventPricing.aspx.cs プロジェクト: BraZee/IgniteMe
        protected void btnSaveTicket_OnClick(object sender, EventArgs e)
        {
            var ticketDS = new DAL.EventTicketDataSet();

            ticketDS.EventTicket.AddEventTicketRow(Utilities.editId, txtName.Text, decimal.Parse(txtPrice.Text),
                int.Parse(cbCurrency.SelectedValue), eventId, eventName, int.Parse(txtMaxEntries.Text),
                int.Parse(txtNumDays.Text), chkDuplicates.Checked, chkActive.Checked, cbCurrency.SelectedItem.ToString(),
                int.Parse(txtMaxSession.Text),txtDescription.Text);

            if (Utilities.editId != -1)
            {
                int result = dataProvider.UpdateEventTicketPrice(userToken, ticketDS);

                if (result != -1)
                {
                    SetToast("success", "Ticket has been succesfully updated");
                    Utilities.editId = -1;
                    btnCloseModal_OnClick(sender, e);
                }
                else
                {
                    SetToast("error", "Ticket already exists");
                }
            }
            else
            {
                if (!Utilities.CheckGridForText(dgvTicket, txtName.Text))
                {
                    int result = dataProvider.AddEventTicketPrice(Utilities.userToken, ticketDS);

                    if (result != -1)
                    {
                        Utilities.editId = -1;
                        SetToast("success", "Ticket was created successfully.");
                    }
                    else
                    {
                        SetToast("error", "An error has occured, try again.");
                    }
                }
                else
                {
                    SetToast("info", "Ticket already exists");
                }

                DisplayTicketsInGrid();
            }

            DisplayTicketsInGrid();
        }