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 Amozeshgah
{
    public partial class New_Lesson : DevComponents.DotNetBar.Office2007Form
    {
        public New_Lesson()
        {
            InitializeComponent();
        }

        private void New_Lesson_Load(object sender, EventArgs e)
        {

        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnInsert_Click(object sender, EventArgs e)
        {
            if (txtDuration.Text == "" || txtShahryeh.Text == "" || txtTitle.Text == "" || txtVahed.Text == "" || Kind.SelectedIndex < 0)
            {
                MessageBox.Show("اطلاعات وارد شده کامل نیست", "مدیریت آموزشگاه", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            lessonTableAdapter1.Insert(txtTitle.Text, txtVahed.Text, txtShahryeh.Text, Kind.Text, txtDuration.Text);
            MessageBox.Show("اطلاعات با موفقیت ثبت شد", "مدیریت آموزشگاه", MessageBoxButtons.OK, MessageBoxIcon.Information);
            txtDuration.Text = txtShahryeh.Text = txtTitle.Text = txtVahed.Text = string.Empty;
            Kind.SelectedIndex = -1;
            txtTitle.Focus();
        }
    }
}
