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.Data.SqlClient;

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

       

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

        

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

        }

        private void btnsave_Click(object sender, EventArgs e)
        {
            if (txtfamily.Text == "" || txtname.Text == "" || txttell.Text == "")
            {
                MessageBox.Show("لطفا اطلاعات رو بطور کامل وارد کنید", "اخطار", MessageBoxButtons.OK);

            }
            else
            {
                tblmoshtariTableAdapter.InsertQuery(txtname.Text, txtfamily.Text, txttell.Text);
                txtfamily.Text = "";
                txtname.Text = "";
                txttell.Text = "";
                MessageBox.Show(".اطلاعات با موفقیت ویرایش و ثبت شد", "", MessageBoxButtons.OK);

            }
        }

        

        
    }
}
