using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using LLNet.GUI;
using LLNet.Utils;

namespace LLNet.Tienda.MainForms.Forms.GiftCard
{
    public partial class FrmOpciones : Form
    {
        public string GiftCard = "";

        public FrmOpciones()
        {
            InitializeComponent();
        }

        #region sbtnNuevo_Click
        private void sbtnNuevo_Click(object sender, EventArgs e)
        {
            try
            {
                FrmGiftCard fgc = new FrmGiftCard(true);
                fgc.ShowDialog();
                this.GiftCard = fgc.GiftCard;
                this.Dispose();
            }
            catch (Exception ex)
            {
                CApp.ShowMessage(ex.Message, "Gift Card", true);
            }
        }
        #endregion

        #region btnRecargar_Click
        private void btnRecargar_Click(object sender, EventArgs e)
        {
            try
            {
                FrmGiftCard fgc = new FrmGiftCard(false);
                fgc.ShowDialog();
                this.GiftCard = fgc.GiftCard;
                this.Dispose();
            }
            catch (Exception ex)
            {
                CApp.ShowMessage(ex.Message, "Gift Card", true);
            }
        }
        #endregion

        #region sbtnSalir_Click
        private void sbtnSalir_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }
        #endregion

        #region FrmOpciones_KeyDown
        private void FrmOpciones_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.Escape:
                        this.Dispose();
                        break;
                    case Keys.F10:
                        sbtnNuevo_Click(null, null);
                        break;
                    case Keys.F11:
                        btnRecargar_Click(null, null);
                        break;
                    case Keys.F12:
                        btnSaldo_Click(null, null);
                        break;
                }
            }
            catch (Exception ex)
            {
                CApp.ShowMessage(ex.Message, "Gift Card", true);
            }
        }
        #endregion

        #region sbtnReemplazar_Click
        private void sbtnReemplazar_Click(object sender, EventArgs e)
        {
            try
            {
                FrmReemplazar fr = new FrmReemplazar();
                fr.ShowDialog();
            }
            catch (Exception ex)
            {
                CApp.ShowMessage(ex.Message, "Gift Card", true);
            }
        }
        #endregion

        private void btnSaldo_Click(object sender, EventArgs e)
        {
            LLNet.Tienda.MainForms.Forms.GiftCard.FrmNumGiftCard frmtrj = new LLNet.Tienda.MainForms.Forms.GiftCard.FrmNumGiftCard();
            frmtrj.ShowDialog();
        }
    }
}