-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKitapEkle.cs
65 lines (57 loc) · 2.04 KB
/
KitapEkle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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;
using Kütüphane_Otomasyon.DataBaseManager;
namespace Kütüphane_Otomasyon
{
public partial class KitapEkle : Form
{
public KitapEkle()
{
InitializeComponent();
}
private void btnEkle_Click(object sender, EventArgs e)
{
String ad = tbKitapAd.Text.Trim();
String yazar = tbKitapYazar.Text.Trim();
short page = short.Parse(numKitapSayfa.Value.ToString().Trim());
if ((ad != "") && (yazar != ""))
{
if (!(((int)numKitapSayfa.Value) <= 0))
{
if ((!Book.isExist("kitapad", tbKitapAd.Text)) &&
(!Book.isExist("kitapsayfa", numKitapSayfa.Value.ToString())))
{
Book newBook = new Book(ad,yazar,page);
newBook.add();
DialogResult result = MessageBox.Show("İşlem Başarılı", "Başarılı",
MessageBoxButtons.OK, MessageBoxIcon.Information);
if (result == DialogResult.OK)
this.Close();
}
else
{
MessageBox.Show("Bu kitap zaten bulunmakta", "Uyarı",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
else
{
MessageBox.Show("Sayfa Sayısı 0'dan büyük olmalıdır", "Uyarı",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
else
{
MessageBox.Show("Lütfen boşlukları doldurunuz","Uyarı",
MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
}
}