using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace shop
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void خريدToolStripMenuItem_Click(object sender, EventArgs e)
        {
            KHARID b = new KHARID();
            b.ShowDialog();
        }

        private void فروشToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frush b = new frush();
            b.ShowDialog();
        }

        private void دفتركلToolStripMenuItem_Click(object sender, EventArgs e)
        {
            baresi b = new baresi();
            b.ShowDialog();
        }

        private void خروجازسيستمToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("آيا مي خواهيد از برنامه خارج شويد؟", "توجه", MessageBoxButtons.YesNo) == DialogResult.Yes)
                Application.Exit();
        }

        private void كاربرانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            karbar b = new karbar();
            b.ShowDialog();
        }

        void display()
        {
            OleDbConnection con1 = new OleDbConnection();
            con1.ConnectionString = "provider=microsoft.jet.oledb.4.0; data source=shoping.mdb";
            OleDbDataAdapter da = new OleDbDataAdapter("select nam,fi from KHARID", con1);
            DataSet ds = new DataSet();
            da.Fill(ds, "kharid");
            dataGridView1.DataSource = ds.Tables["kharid"].DefaultView;
            con1.Close();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            display();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            OleDbConnection con1 = new OleDbConnection();
            con1.ConnectionString = "provider=microsoft.jet.oledb.4.0; data source=shoping.mdb";
            OleDbDataAdapter da = new OleDbDataAdapter("select nam,fi from kharid where nam like'%" + textBox1.Text + "%'", con1);
            DataSet ds = new DataSet();
            da.Fill(ds, "kharid");
            dataGridView1.DataSource = ds.Tables["kharid"].DefaultView;
            con1.Close();
        }

        private void پشتيبانگيريازبانكToolStripMenuItem_Click(object sender, EventArgs e)
        {
            backup b = new backup();
            b.ShowDialog();
        }

        private void Form1_Enter(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo language = new System.Globalization.CultureInfo("fa-ir");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(language);
        }

        private void textBox1_Enter(object sender, EventArgs e)
        {
            System.Globalization.CultureInfo language = new System.Globalization.CultureInfo("fa-ir");
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(language);
        }

        private void انجامقرعهكشيToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ghore b = new ghore();
            b.ShowDialog();
        }

        private void خريدهايبيشاز20000تومانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            saghf b = new saghf();
            b.ShowDialog();
        }

        private void گزارشازميزانسودوزيانToolStripMenuItem_Click(object sender, EventArgs e)
        {
            sud b = new sud();
            b.ShowDialog();
        }

        private void تعريفقسطجديدToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ghest b = new ghest();
            b.ShowDialog();
        }

        private void پرداختاقساطToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pardakhtghest b = new pardakhtghest();
            b.ShowDialog();
        }

        private void گزارشازهزينههايمتفرقهToolStripMenuItem_Click(object sender, EventArgs e)
        {
            gmotafareghe b = new gmotafareghe();
            b.ShowDialog();
        }

        private void سايرهزينههاToolStripMenuItem_Click(object sender, EventArgs e)
        {
            motafareghe b = new motafareghe();
            b.ShowDialog();
        }

        private void گزارشازپرداختاقساطToolStripMenuItem_Click(object sender, EventArgs e)
        {
            gpardakht b = new gpardakht();
            b.ShowDialog();
        }

        private void دفترچهتلفنToolStripMenuItem_Click(object sender, EventArgs e)
        {
            tel b = new tel();
            b.ShowDialog();
        }
    }
}
