using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class CheckAndRadioLists : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    /// <summary>
    /// Procedura zmiany właściwości przycisku
    /// </summary>
    protected void btnChange_Click(object sender, EventArgs e)
    {
        // zastosowanie ustawień układu dla dwóch list

        // na początek pobranie liczby kolumn
        int columns = Convert.ToInt32(drpColumns.SelectedValue);
        rlstCrust.RepeatColumns = columns;
        clstToppings.RepeatColumns = columns;

        string sLayout = drpLayout.SelectedValue;
        RepeatLayout layout = (RepeatLayout)Enum.Parse(typeof(RepeatLayout), sLayout, true);
        rlstCrust.RepeatLayout = layout;
        clstToppings.RepeatLayout = layout;

        string sDirect = drpDirection.SelectedValue;
        RepeatDirection direct = (RepeatDirection)Enum.Parse(typeof(RepeatDirection), sDirect, true);
        rlstCrust.RepeatDirection = direct;
        clstToppings.RepeatDirection = direct;
    }
    /// <summary>
    /// Procedura obsługi przycisku zamówienia
    /// </summary>
    protected void btnOrder_Click(object sender, EventArgs e)
    {
        labMessage.Text = "<b>Zamówiona pizza: </b><br>";
        labMessage.Text += rlstCrust.SelectedItem.Text;
        labMessage.Text += " ciasto<br/><b>Dodatki:</b><br/>";
        foreach (ListItem topping in clstToppings.Items)
        {
            if (topping.Selected)
            {
                labMessage.Text += topping.Text + "<br/>";
            }
        }
    }
}
