using DevExpress.Pdf.Native;
using DevExpress.XtraEditors;
using LFP_Manager.DataStructure;
using LFP_Manager.Function;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LFP_Manager.Forms
{
    public partial class FmxPassword : DevExpress.XtraEditors.XtraForm
    {
        #region DELEGATE
        public delegate void PasswordResut(int result);
        #endregion

        #region VARIABLES

        private CommConfig Config;

        public event PasswordResut OnResult = null;

        #endregion

        #region CONSTRUCTORS
        public FmxPassword(CommConfig aConfig)
        {
            InitializeComponent();

            Config = aConfig;
        }
        #endregion

        #region BUTTON EVENT
        private void BtnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            Close();
        }

        private void BtnOk_Click(object sender, EventArgs e)
        {
            string resetPW = TeResetPW.Text;

            if (resetPW == "Delta Electronics")
            {
                this.DialogResult = DialogResult.OK;
                Close();
            }
            else
            {
                MessageBox.Show("Wrong Password - Try again", "Result", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        #endregion
    }
}