using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EX2
{
    public partial class frmInput : Form
    {
        public frmInput()
        {
            InitializeComponent();
        }

        private void frmInput_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'studentDataSet.Student' table. You can move, or remove it, as needed.
            this.studentTableAdapter.Fill(this.studentDataSet.Student);
            for (int i = 0; i < dataGridView1.RowCount; i += 2)
                dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.SkyBlue;

        }

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

        private void button1_Click(object sender, EventArgs e)
        {
            studentTableAdapter.Update(studentDataSet.Student);
            MessageBox.Show("ذخیره اطلاعات با موفقیت انجام شد", "ثبت", MessageBoxButtons.OK, MessageBoxIcon.Information);
            for (int i = 0; i < dataGridView1.RowCount; i += 2)
                dataGridView1.Rows[i].DefaultCellStyle.BackColor = Color.SkyBlue;
        }
    }
}
