using System;
using System.Data;
using System.Windows.Forms;

namespace AyaNovaQBI
{
    public partial class MapSelectAyaNovaItem : Form
    {
        public MapSelectAyaNovaItem()
        {
            InitializeComponent();
        }

        public string SelectedItemName
        {
            get
            {
                return ((DataRowView)cbItems.SelectedItem).Row[0].ToString();
            }
        }

        public long SelectedItemId
        {
            get
            {
                return (long)((DataRowView)cbItems.SelectedItem).Row[1];
            }
        }

        public DataTable Items { get; set; }

        private void MapSelectAyaNovaItem_Load(object sender, EventArgs e)
        {

            cbItems.DataSource = Items;

            cbItems.DisplayMember = "name";
            cbItems.ValueMember = "id";
            btnCancel.Text = util.AyaTranslations["Cancel"];
            btnOK.Text = util.AyaTranslations["OK"];
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }


    }
}
