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 restooran
{
    public partial class info : Form
    {
        public info()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog f = new OpenFileDialog();
                f.ShowDialog();
                pictureBox1.Image = new Bitmap(f.FileName);
            }
            catch { }

        }

        private void textBoxX4_TextChanged(object sender, EventArgs e)
        {

        }

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

        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            Bitmap b= (Bitmap)pictureBox1 .Image ;
            System .IO .MemoryStream ms = new System.IO.MemoryStream ();
            b.Save (ms , b.RawFormat );
            tbl_infoTableAdapter.myupdate(txtname.Text, txtmodir.Text, txttell1.Text, txttell2.Text, txtadres.Text, ms.GetBuffer());
            this.tbl_infoTableAdapter.Fill(this.dataSet1.tbl_info);
            MessageBox.Show("اطلاعات با موفقیت ثبت شد");
        }
    }
}
