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 frmConfigWarranty : DevExpress.XtraEditors.XtraForm
    {
        public frmConfigWarranty()
        {
            InitializeComponent();
        }

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

        private void frmConfigWarranty_Load(object sender, EventArgs e)
        {
            dsGarantias1.Merge(GUI.CApp.bll.getTypedDataSet(dsGarantias1.GetType(), dsGarantias1.WMS_GARANTIAS_X_CLASIFICACION.TableName));
            dsGarantias1.Merge(GUI.CApp.bll.getTypedDataSet(dsGarantias1.GetType(), dsGarantias1.WMS_RECONOCIMIENTO_GARANTIAS.TableName));
            dsGarantias1.Merge(GUI.CApp.bll.getTypedDataSet(dsGarantias1.GetType(), dsGarantias1.WMS_CLASIFICACIONES.TableName));
        }

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

        private void gridView2_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
        {
            gridView2.SetFocusedRowCellValue(colCLASIFICACION1, gridView1.GetFocusedRowCellValue(colCLASIFICACION));
        }
    }
}