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 frmeditmoshtari : Form
    {
        public frmeditmoshtari()
        {
            InitializeComponent();
        }


        private void frmeditmoshtari_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 btnexit_Click(object sender, EventArgs e)
        {
          this.Close();
        }

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

            }
            else
            {
                tblmoshtariTableAdapter.UpdateQuery(txtnamemoshtari.Text, txtfamilymoshtari.Text, txttellmoshtari.Text, int.Parse(txtmid.Text));
                this.Close();
                MessageBox.Show(".اطلاعات با موفقیت ویرایش و ثبت شد", "", MessageBoxButtons.OK);
            }
        }

      

       
    }
}
