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;

namespace video_club
{
    public partial class frmaddfilm : Form
    {
        public frmaddfilm()
        {
            InitializeComponent();
        }



        private void frmaddfilm_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dataSet1.tblfilm' table. You can move, or remove it, as needed.
            this.tblfilmTableAdapter1.Fill(this.dataSet1.tblfilm);

        }

        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txtcontry.Text == "" || txtname.Text == "" || txtyear.Text == "")
            {
                MessageBox.Show("لطفا اطلاعات رو بطور کامل وارد کنید", "اخطار", MessageBoxButtons.OK);
            }
            else
            {
                tblfilmTableAdapter1.InsertQuery(txtname.Text, txtcontry.Text,cmbtypfilm.Text, txtyear.Text,int.Parse(txtcount.Text));
                txtcontry.Text = "";
                txtname.Text = "";
                txtyear.Text = "";
                txtcount.Text = "";
                MessageBox.Show("ثبت با موفقیت انجام شد", "", MessageBoxButtons.OK);
            }
        }

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












    }
}
