using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using OliviaAddInPro.Helper;
using OliviaAddInPro.Model;

namespace OliviaAddInPro
{
    /// <summary>
    /// Interaction logic for PaneRecogidaView.xaml
    /// </summary>
    public partial class PaneRecogidaView : UserControl
    {
        public PaneRecogidaView()
        {
            InitializeComponent();
        }

        private void button_secto_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is PaneRecogidaViewModel mod)
            {
                if (mod.PaneSub1.CapaAbierta)
                    mod.Ejecuta(OliviaAddInPro.Services.ModosEjec.Sectoriza);
                else
                    HelperGlobal.ponMsg("No se ha seleccionado ninguna capa de Recogida");
            }
        }

        private void button_planif_Click(object sender, RoutedEventArgs e)
        {
            if (DataContext is PaneRecogidaViewModel mod)
            {
                if (mod.PaneSub1.CapaAbierta)
                    mod.Ejecuta(OliviaAddInPro.Services.ModosEjec.Planifica);
                else
                    HelperGlobal.ponMsg("No se ha seleccionado ninguna capa de Recogida");
            }

        }

        private void button_help_Click(object sender, RoutedEventArgs e)
        {
            OliviaGlob.OpenManual();
        }
    }
}
