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

namespace LLNet.Tienda.MainForms.Forms.CierreConsol
{
    public partial class FrmDepositos : LLNet.GUI.FormBases.frmBase
    {
        public FrmDepositos()
        {
            InitializeComponent();
        }

        #region mCargarDepositos
        /// <summary>
        /// Carga los depósitos de la tienda
        /// </summary>
        private void mCargarDepositos()
        {
            this.gcDepositos.DataSource = null;
            this.gcDepositos.DataMember = null;

            using (DataSet vDepositos = GUI.CApp.bll.getDataSet("PDV", "ObtDepositos"))
            {
                this.gcDepositos.DataSource = vDepositos;
                this.gcDepositos.DataMember = vDepositos.Tables[0].ToString();
            }
        }
        #endregion

        #region FrmDepositos_Load
        private void FrmDepositos_Load(object sender, EventArgs e)
        {
            try
            {
                mCargarDepositos();
            }
            catch (Exception ex)
            {
                CApp.ShowMessage(ex.Message, "Depósitos de la Tienda", true);
            }
        }
        #endregion

        #region FrmDepositos_KeyDown
        private void FrmDepositos_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.Escape:
                        btnCancelar.PerformClick();
                        break;
                }
            }
            catch (Exception ex)
            {
                CApp.ShowMessage(ex.Message, "Depósitos de la Tienda", true);
            }
        }
        #endregion

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