﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
//
using FamilySafetyControl.Helpers;

namespace FamilySafetyControl
{
    public partial class frmPass : Form
    {
        frmMain formMain;
        public frmPass(frmMain form)
        {
            InitializeComponent();
            formMain = form;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            formMain.Visible = false;
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (Password.MainAppPassEntered(txtPass.Text))
            {
                // password correct
                formMain.Visible = true;
                formMain.Show();
                this.Close();
            }
            else
            {
                // password wrong
                MessageBox.Show("Girdiğiniz şifre yanlış", "Yanlış şifre", MessageBoxButtons.OK,MessageBoxIcon.Error);
                txtPass.Clear();
                txtPass.Focus();
            }
        }

    }
}
