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

namespace Library
{
    public partial class frmBookEdit : Form
    {
        public frmBookEdit()
        {
            InitializeComponent();
        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            
        }

        private void chisfarsi_CheckedChanged(object sender, EventArgs e)
        {
            panel1.Visible = !chisfarsi.Checked;
        }

        private void frmBookEdit_Load(object sender, EventArgs e)
        {
            
        }

        private void btnok_Click(object sender, EventArgs e)
        {
            Book bk = new Book();
            bk.Name = txtname.Text;
            bk.ISBN = txtisbn.Text;
            bk.IsLanguageFarsi = chisfarsi.Checked;
            bk.PublisherID = Int32.Parse(cbpublisher.SelectedValue.ToString());
            bk.Translator = txttranslator.Text;
            bk.Author = txtauthor.Text;
            bk.CategoryID = Int32.Parse(cbcategory.SelectedValue.ToString());
            bk.ID = txtid.Text;
            bk.Count =Int32.Parse( txtcount.Text);
            bk.Year = Int32.Parse(txtyear.Text);
            bk.Update();
            this.Close();
        }
    }
}