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 WindowsFormsApp2
{
public partial class frmFilmEkle : Form
{
public frmFilmEkle()
{
InitializeComponent();
}
// sinemaTableAdapters.Film_BilgileriTableAdapter film = new sinemaTableAdapters.Film_BilgileriTableAdapter();
sinemaTableAdapters.Film_BilgileriTableAdapter film = new sinemaTableAdapters.Film_BilgileriTableAdapter();
private void button1_Click(object sender, EventArgs e)
{
try
{
// film.FilmEkleme(txtFilmaAdi.Text, txtYonetmen.Text, cmbFilmTuru.Text, txtSure.Text, dateTimePicker1.Text, txtYapimYili.Text, pictureBox2.ImageLocation);
film.FilmEkleme(txtFilmaAdi.Text, txtYonetmen.Text, cmbFilmTuru.Text, txtSure.Text, dateTimePicker1.Text, txtYapimYili.Text, pictureBox2.ImageLocation);
MessageBox.Show("Film Bilgileri Eklendi","Kayıt");
}
catch (Exception)
{
MessageBox.Show("Bu Film Daha Önce Eklendi!!!","Uyarı");
}
foreach (Control item in Controls) if (item is TextBox) item.Text = "";
cmbFilmTuru.Text = "";
pictureBox2.Image = null;
pictureBox2.Invalidate();
}
private void button2_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
pictureBox2.ImageLocation = openFileDialog1.FileName;
}
private void button3_Click(object sender, EventArgs e)
{
Environment.Exit(0);
}
private void button4_Click(object sender, EventArgs e)
{
Form2 cc = new Form2();
cc.ShowDialog();
}
}
}
Hiç yorum yok:
Yorum Gönder