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

namespace LLNet.Tienda.MainForms.Forms
{
    public partial class frmGarantias : DevExpress.XtraEditors.XtraForm
    {
        public frmGarantias()
        {
            InitializeComponent();
        }

        private void btnAceptar_Click(object sender, EventArgs e)
        {
            gridView1.PostEditor();
            gridView1.UpdateCurrentRow();
            GUI.CApp.bll.updateDataSet(dsGarantias1);
            DialogResult = DialogResult.OK;
        }

        public virtual void Init(object[] pArgs)
        {
            if (pArgs != null)
            {
                Utils.QueryParams qp = pArgs[0] as LLNet.Utils.QueryParams;
                dsGarantias1.Merge(GUI.CApp.bll.getTypedDataSet(dsGarantias1.GetType(), dsGarantias1.WMS_GARANTIAS.TableName, qp));

            }
        }


        private void frmGarantias_Load(object sender, EventArgs e)
        {
            comboBoxEdit1.Properties.ReadOnly = !GUI.CApp.GetAccess("TDA_ImpresionGarantias", GUI.CApp.usuario);
            comboBoxEdit1.Enabled = !comboBoxEdit1.Properties.ReadOnly;
            
        }

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

    }
}