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

namespace LLNet.Tienda.Dialogs.Observations
{
    public partial class dlgObservationPedido : GUI.FormBases.frmBase
    {
        #region Constructores

        public dlgObservationPedido()
        {
            InitializeComponent();
            try
            {
                Utils.QueryParams qp = new LLNet.Utils.QueryParams();
                qp.Clear();
                string documento = Utils.Helpers.pdocumento.ToString();
                qp.AddReplaceParam("DOCUMENTO", documento.ToString());

                string Observ = (GUI.CApp.bll.GetSingleValue("GetComments", qp, "PDV").ToString());
                txtObservaciones.Text = Observ.ToString();
            }
            catch { }

            GUI.CApp.TraducirForm(this);
        }

        public dlgObservationPedido(string observacion)
        {
            InitializeComponent();
            Utils.QueryParams qp = new LLNet.Utils.QueryParams();
            qp.AddReplaceParam("DOCUMENTO", Utils.Helpers.pdocumento.ToString());

            string Observ = GUI.CApp.bll.GetSingleValue("GetComments", qp, "PDV").ToString();
            txtObservaciones.Text = Observ;

            GUI.CApp.TraducirForm(this);
        }

        #endregion

        private void btnAceptar_Click(object sender, EventArgs e)
        {
            
            //Program.FrmMainPos.RefreshData();
            DialogResult = DialogResult.OK;
        }

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

        private void dlgEfectivoEmpresa_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            { 
                case Keys.F12:
                    btnAceptar_Click(null, null);
                    break;
                case Keys.Escape:
                    btnCancelar_Click(null, null);
                    break;
            }
        }

        private void dlgEfectivoEmpresa_Load(object sender, EventArgs e)
        {
            txtObservaciones.Focus();
        }

        public string Observacion() {
            return this.txtObservaciones.Text;
        }
    }
}