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 System.Globalization;

namespace Video_Club
{
    public partial class frmPush : Form
    {
        PersianCalendar pc = new PersianCalendar();
        public frmPush()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(textBox1.Text != "")
                if (textBox2.Text != "")
                {
                    statics.person = textBox1.Text;
                    statics.date = textBox2.Text;
                    statics.changed = true;
                    Close();
                }
        }

        private void frmPush_Load(object sender, EventArgs e)
        {
            textBox2.Text = pc.GetYear(DateTime.Now) + "/" + pc.GetMonth(DateTime.Now) + "/" + pc.GetDayOfMonth(DateTime.Now);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyData == Keys.Enter)
            {
                if (textBox1.Text != "")
                    if (textBox2.Text != "")
                    {
                        statics.person = textBox1.Text;
                        statics.date = textBox2.Text;
                        statics.changed = true;
                        Close();
                    }
            }
        }

        private void textBox2_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                if (textBox1.Text != "")
                    if (textBox2.Text != "")
                    {
                        statics.person = textBox1.Text;
                        statics.date = textBox2.Text;
                        statics.changed = true;
                        Close();
                    }
            }
        }

    }
}
