namespace VeritabanıÖdev
{
public partial class Form1 : Form
{
public Form1 frm;
public Form2 frm2;
public extra frmex;
public Personel frmpersonel;
public Sube frmsube;
public subeyönetici frmy;
public Ürüncs frmü;
public Malzemegelen frmM;
public MalzemeTedarik frmT;
public Müsteri frmMü;
public MüsteriSiparisBilgileri frmB;
public Form1()
{
InitializeComponent();
frm2 = new Form2();
frmex = new extra();
frmpersonel = new Personel();
frmsube = new Sube();
frmy = new subeyönetici();
frmü = new Ürüncs();
frmM = new Malzemegelen();
frmT = new MalzemeTedarik();
frmMü = new Müsteri();
frmB = new MüsteriSiparisBilgileri();
}
private void simpleButton4_Click(object sender, EventArgs e)
{
frm2.ShowDialog();
}
private void simpleButton5_Click(object sender, EventArgs e)
{
frmex.ShowDialog();
}
private void simpleButton3_Click(object sender, EventArgs e)
{
frmpersonel.ShowDialog();
}
private void simpleButton2_Click(object sender, EventArgs e)
{
frmsube.ShowDialog();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
frmy.ShowDialog();
}
private void simpleButton6_Click(object sender, EventArgs e)
{
frmü.ShowDialog();
}
private void simpleButton7_Click(object sender, EventArgs e)
{
frmM.ShowDialog();
}
private void simpleButton10_Click(object sender, EventArgs e)
{
frmT.ShowDialog();
}
private void simpleButton9_Click(object sender, EventArgs e)
{
frmMü.ShowDialog();
}
private void simpleButton8_Click(object sender, EventArgs e)
{
frmB.ShowDialog();
}
private void simpleButton11_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
--------------------------------------------------------------------
Firma
--------------------------------------------------------------------
namespace VeritabanıÖdev
{
public partial class Form2 : Form
{
public Müşterilerimiz frmM;
public Tedarikçilerimiz frmT;
public Form2()
{
frmM = new Müşterilerimiz();
frmT = new Tedarikçilerimiz();
InitializeComponent();
}
private void simpleButton3_Click(object sender, EventArgs e)
{
// sayfanın kapatılması
this.Close();
}
SqlConnection baglanti = new SqlConnection("Data Source=YENEN\\SQL_2014;Initial Catalog=VeritabanıProje;Integrated Security=True");
public void verilerigöster(string veriler)// Sql baglanti verilerin gösterilmesi
{
SqlDataAdapter da = new SqlDataAdapter(veriler, baglanti);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void simpleButton1_Click(object sender, EventArgs e)// Kaydet
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into Firma (FirmaAdı,FirmaSahibi,FirmaIletisim) values (@ad,@shb,@iletisim)", baglanti);
komut.Parameters.AddWithValue("@ad", textBox1.Text);
komut.Parameters.AddWithValue("@shb", textBox2.Text);
komut.Parameters.AddWithValue("@iletisim", textBox3.Text);
komut.ExecuteNonQuery();
verilerigöster("Select * from Firma");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
private void simpleButton5_Click(object sender, EventArgs e)
{
verilerigöster("Select *from Firma");
}
private void simpleButton4_Click(object sender, EventArgs e)// Silme
{
baglanti.Open();
SqlCommand komut = new SqlCommand("delete from Firma where FirmaID=@ID",baglanti);
komut.Parameters.AddWithValue("@ID", textBox4.Text);
komut.ExecuteNonQuery();
verilerigöster("select * from Firma");
baglanti.Close();
textBox4.Clear();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int secilialan = dataGridView1.SelectedCells[0].RowIndex;
string FirmaID = dataGridView1.Rows[secilialan].Cells[0].Value.ToString();
string MusteriID= dataGridView1.Rows[secilialan].Cells[1].Value.ToString();
textBox1.Text = FirmaID;
textBox2.Text = MusteriID;
}
private void simpleButton2_Click(object sender, EventArgs e)//Güncelle
{
baglanti.Open();
SqlCommand komut = new SqlCommand(" update Firma set FirmaAdı='" + textBox1.Text + "',FirmaSahibi='" + textBox2.Text + "',FirmaIletisim='" + textBox3.Text + "' where FirmaAdı='" + textBox1.Text + "'", baglanti);
komut.ExecuteNonQuery();
verilerigöster("select * from Firma");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
}
private void simpleButton6_Click(object sender, EventArgs e)
{
frmM.ShowDialog();//müsteri tablo geçis
}
private void simpleButton7_Click(object sender, EventArgs e)
{
frmT.ShowDialog();//Tedarikçi tablo geçis
}
private void simpleButton8_Click(object sender, EventArgs e)// arama Yapma
{
baglanti.Open();
SqlCommand komut = new SqlCommand("select *from Firma where FirmaID like '%" + textBox5.Text + "'", baglanti);
SqlDataAdapter da = new SqlDataAdapter(komut);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
baglanti.Close();
textBox5.Clear();
}
}
}
--------------------------------------------------------------------------------------------------------------------------
Kadrolu
-------------
namespace VeritabanıÖdev
{
public partial class Kadrolu : Form
{
public Kadrolu()
{
InitializeComponent();
}
private void simpleButton3_Click(object sender, EventArgs e)
{
this.Close();
}
SqlConnection baglanti = new SqlConnection("Data Source=YENEN\\SQL_2014;Initial Catalog=VeritabanıProje;Integrated Security=True");
public void verilerigöster(string veriler)
{
SqlDataAdapter da = new SqlDataAdapter(veriler, baglanti);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void simpleButton6_Click_1(object sender, EventArgs e)
{
verilerigöster("select *from Kadrolu");
}
private void simpleButton1_Click_1(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into Kadrolu (PersonelID,YıllıkUcret) values (@id,@c)", baglanti);
komut.Parameters.AddWithValue("@id", textBox1.Text);
komut.Parameters.AddWithValue("@c", textBox2.Text);
komut.ExecuteNonQuery();
verilerigöster("Select * from Kadrolu");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
}
private void simpleButton2_Click_1(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand(" update Kadrolu set PersonelID='" + textBox1.Text + "',YıllıkUcret='" + textBox2.Text + "' where PersonelID='" + textBox1.Text + "'", baglanti);
komut.ExecuteNonQuery();
verilerigöster("select * from Kadrolu");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
}
private void simpleButton5_Click_1(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("delete from Kadrolu where PersonelID=@ID", baglanti);
komut.Parameters.AddWithValue("@ID", textBox6.Text);
komut.ExecuteNonQuery();
verilerigöster("select * from Kadrolu");
textBox6.Clear();
baglanti.Close();
}
private void simpleButton7_Click_1(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("select *from Kadrolu where PersonelID like '%" + textBox7.Text + "'", baglanti);
SqlDataAdapter da = new SqlDataAdapter(komut);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
baglanti.Close();
textBox7.Clear();
}
private void dataGridView1_CellClick_1(object sender, DataGridViewCellEventArgs e)
{
int secilialan = dataGridView1.SelectedCells[0].RowIndex;
string PersonelID = dataGridView1.Rows[secilialan].Cells[0].Value.ToString();
string YıllıkUcret = dataGridView1.Rows[secilialan].Cells[1].Value.ToString();
textBox1.Text = PersonelID;
textBox2.Text = YıllıkUcret;
}
}
}
Malzeme Gelen
----------------------------------
namespace VeritabanıÖdev
{
public partial class Malzemegelen : Form
{
public Malzemegelen()
{
InitializeComponent();
}
SqlConnection baglanti = new SqlConnection("Data Source=YENEN\\SQL_2014;Initial Catalog=VeritabanıProje;Integrated Security=True");
public void verilerigöster(string veriler)
{
SqlDataAdapter da = new SqlDataAdapter(veriler, baglanti);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void simpleButton3_Click(object sender, EventArgs e)
{
this.Close();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into Malzeme (ÜrünAdı,StokDurumu,MTID,FirmaID) values (@ad,@stok,@MTID,@Firma)", baglanti);
komut.Parameters.AddWithValue("@ad", textBox1.Text);
komut.Parameters.AddWithValue("@stok", textBox2.Text);
komut.Parameters.AddWithValue("@Firma", textBox3.Text);
komut.Parameters.AddWithValue("@MTID", textBox9.Text);
komut.ExecuteNonQuery();
verilerigöster("Select * from Malzeme");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox9.Clear();
}
private void simpleButton5_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("delete from Malzeme where MalzemeID=@ID", baglanti);
komut.Parameters.AddWithValue("@ID", textBox6.Text);
komut.ExecuteNonQuery();
verilerigöster("select * from Malzeme");
textBox6.Clear();
baglanti.Close();
}
private void simpleButton6_Click(object sender, EventArgs e)
{
verilerigöster("Select * from Malzeme");
}
private void simpleButton2_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand(" update Malzeme set ÜrünAdı='" + textBox1.Text + "',StokDurumu='" + textBox2.Text +"',FirmaID='"+textBox3.Text+"',MTID='"+textBox9.Text+"' where ÜrünAdı='" + textBox1.Text + "'", baglanti);
komut.ExecuteNonQuery();
verilerigöster("select * from Malzeme");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
textBox9.Clear();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int secilialan = dataGridView1.SelectedCells[0].RowIndex;
string MalzemeID = dataGridView1.Rows[secilialan].Cells[0].Value.ToString();
string ÜrünAdı = dataGridView1.Rows[secilialan].Cells[1].Value.ToString();
string StokDurumu = dataGridView1.Rows[secilialan].Cells[2].Value.ToString();
string MTID = dataGridView1.Rows[secilialan].Cells[3].Value.ToString();
string FirmaID = dataGridView1.Rows[secilialan].Cells[3].Value.ToString();
textBox3.Text = FirmaID;
textBox1.Text = ÜrünAdı;
textBox2.Text = StokDurumu;
textBox9.Text = MTID;
}
private void simpleButton7_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("select *from Malzeme where MalzemeID like '%" + textBox7.Text + "'", baglanti);
SqlDataAdapter da = new SqlDataAdapter(komut);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
baglanti.Close();
textBox7.Clear();
}
}
}
-------------------------------------------------
Malzeme Tedarikçi
-------------------------------------------------
namespace VeritabanıÖdev
{
public partial class MalzemeTedarik : Form
{
public MalzemeTedarik()
{
InitializeComponent();
}
SqlConnection baglanti = new SqlConnection("Data Source=YENEN\\SQL_2014;Initial Catalog=VeritabanıProje;Integrated Security=True");
public void verilerigöster(string veriler)
{
SqlDataAdapter da = new SqlDataAdapter(veriler, baglanti);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void simpleButton1_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into MalzemeTedarikçisi (MTAd,MTIletisim,MTUrunadı,MTUcret,MTMiktar,MTTarih) values (@ad,@iletişim,@ürünadı,@fiyat,@miktar,@tarih)", baglanti);
komut.Parameters.AddWithValue("@ad", textBox1.Text);
komut.Parameters.AddWithValue("@iletişim", textBox2.Text);
komut.Parameters.AddWithValue("@ürünadı", textBox3.Text);
komut.Parameters.AddWithValue("@fiyat", textBox4.Text);
komut.Parameters.AddWithValue("@miktar", textBox9.Text);
komut.Parameters.AddWithValue("@tarih", dateTimePicker1.Text);
komut.ExecuteNonQuery();
verilerigöster("Select * from MalzemeTedarikçisi");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox9.Clear();
}
private void simpleButton3_Click(object sender, EventArgs e)
{
this.Close();
}
private void simpleButton6_Click(object sender, EventArgs e)
{
verilerigöster("select * from MalzemeTedarikçisi");
}
private void simpleButton2_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand(" update MalzemeTedarikçisi set MTAd='" + textBox1.Text + "',MTIletisim='" + textBox2.Text + "',MTUrunAdı='" + textBox3.Text + "',MTUcret='" + textBox4.Text + "',MTMiktar='" +textBox9.Text +"',MTTarih='" + dateTimePicker1.Text + "' where MTAd='" + textBox1.Text + "'", baglanti);
komut.ExecuteNonQuery();
verilerigöster("select * from MalzemeTedarikçisi");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
textBox3.Clear();
textBox4.Clear();
textBox9.Clear();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int secilialan = dataGridView1.SelectedCells[0].RowIndex;
string MTID = dataGridView1.Rows[secilialan].Cells[0].Value.ToString();
string MTAd = dataGridView1.Rows[secilialan].Cells[1].Value.ToString();
string MTIletisim = dataGridView1.Rows[secilialan].Cells[2].Value.ToString();
string MTUrunadı= dataGridView1.Rows[secilialan].Cells[3].Value.ToString();
string MTUcret = dataGridView1.Rows[secilialan].Cells[4].Value.ToString();
string MTMiktar = dataGridView1.Rows[secilialan].Cells[5].Value.ToString();
string MTTarih = dataGridView1.Rows[secilialan].Cells[6].Value.ToString();
textBox1.Text = MTAd;
textBox2.Text = MTIletisim;
textBox3.Text = MTUrunadı;
textBox4.Text = MTUcret;
textBox9.Text = MTMiktar;
dateTimePicker1.Text = MTTarih;
}
private void simpleButton5_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("delete from MalzemeTedarikçisi where ÜrünID=@ID", baglanti);
komut.Parameters.AddWithValue("@ID", textBox6.Text);
komut.ExecuteNonQuery();
verilerigöster("select * from MalzemeTedarikçisi");
textBox6.Clear();
baglanti.Close();
}
private void simpleButton7_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("select *from MalzemeTedarikçisi where MTID like '%" + textBox7.Text + "'", baglanti);
SqlDataAdapter da = new SqlDataAdapter(komut);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
baglanti.Close();
textBox7.Clear();
}
}
}
------------------------------------------------
Müsteri-Siparis
------------------------------------------------
namespace VeritabanıÖdev
{
public partial class Müsteri_Siparis : Form
{
public Müsteri_Siparis()
{
InitializeComponent();
}
SqlConnection baglanti = new SqlConnection("Data Source=YENEN\\SQL_2014;Initial Catalog=VeritabanıProje;Integrated Security=True");
public void verilerigöster(string veriler)
{
SqlDataAdapter da = new SqlDataAdapter(veriler, baglanti);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
}
private void simpleButton3_Click(object sender, EventArgs e)
{
this.Close();
}
private void simpleButton6_Click(object sender, EventArgs e)
{
verilerigöster("select *from MüsteriSiparis");
}
private void simpleButton1_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("insert into MüsteriSiparis (MüsteriID,SiparisID) values (@id,@idS)", baglanti);
komut.Parameters.AddWithValue("@id", textBox1.Text);
komut.Parameters.AddWithValue("@idS", textBox2.Text);
komut.ExecuteNonQuery();
verilerigöster("Select * from MüsteriSiparis");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
}
private void simpleButton5_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("delete from MüsteriSiparis where MüsteriID=@ID", baglanti);
komut.Parameters.AddWithValue("@ID", textBox6.Text);
komut.ExecuteNonQuery();
verilerigöster("select * from MüsteriSiparis");
textBox6.Clear();
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
}
private void simpleButton2_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand(" update MüsteriSiparis set MüsteriID='" + textBox1.Text + "',SiparisID='" + textBox2.Text + "' where MüsteriID='" + textBox1.Text + "'", baglanti);
komut.ExecuteNonQuery();
verilerigöster("select * from MüsteriSiparis");
baglanti.Close();
textBox1.Clear();
textBox2.Clear();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
int secilialan = dataGridView1.SelectedCells[0].RowIndex;
string MüsteriID = dataGridView1.Rows[secilialan].Cells[0].Value.ToString();
string SiparisID = dataGridView1.Rows[secilialan].Cells[1].Value.ToString();
textBox1.Text = MüsteriID;
textBox2.Text = SiparisID;
}
private void simpleButton7_Click(object sender, EventArgs e)
{
baglanti.Open();
SqlCommand komut = new SqlCommand("select *from MüsteriSiparis where MusteriID like '%" + textBox7.Text + "'", baglanti);
SqlDataAdapter da = new SqlDataAdapter(komut);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
baglanti.Close();
textBox7.Clear();
}
}
}
--------------------------------------------
Kodların bi Kısmı böyledir Genel Olrak Yapı Aynı
-----------------------------------------------------------------------------------
Veritabanı Use Case
----------------------------------------------------------------------------------------
Veritabanı Diyagramı
DataBase Görüntü
------------------------------------------------------------------------------------------
Database Saklı yordamlar
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[enyüksekmaas] Script Date: 27.12.2015 03:29:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[enyüksekmaas]
AS
BEGIN
SELECT TOP 2 *FROM Kadrolu ORDER BY YıllıkUcret DESC
END
---------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[FirmaExtraGiderGör] Script Date: 27.12.2015 03:27:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[FirmaExtraGiderGör]
AS
BEGIN
select EXID, GiderAdı , Fiyat , Tarih, s.SubeID
from Extra as ex
INNER JOIN Sube as s
on ex.SubeID = s.SubeID
END
----------------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[sp_Mtad] Script Date: 27.12.2015 03:30:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_Mtad]
@isim nchar(50)
AS
BEGIN
select *from MalzemeTedarikçisi where MTAd=@isim
END
--------------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[sp_MTtab] Script Date: 27.12.2015 03:30:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_MTtab]
AS
BEGIN
select *from MalzemeTedarikçisi
END
--------------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[MüsteriSiparisJoin] Script Date: 27.12.2015 03:29:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[MüsteriSiparisJoin]
AS
BEGIN
select m.MüsteriID, m.AdSoyad, m.Adres, m.İletişim, s.ToplamFiyat, s.içerik, s.Durum ,s.SiparisID
from Müsteri as m
INNER JOIN MüsteriSiparis as ms
on m.MüsteriID = ms.MüsteriID
inner join Siparis as s
on ms.SiparisID=s.SiparisID
ORDER BY M.MüsteriID
END
----------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[personelAra] Script Date: 27.12.2015 03:30:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[personelAra]
(
@personelAdi nchar(50)
)
AS
BEGIN
select *from Personel de where de.AdSoyad like '%' + @personelAdi + '%'
END
----------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[SubeYöneticilerijoin] Script Date: 27.12.2015 03:32:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SubeYöneticilerijoin]
AS
BEGIN
select SubeID, SubeAdı , AdSoyad , sy.İletişim, sy.SYID
from Sube as sube
INNER JOIN SubeYönetici as sy
on sube.SYID = sy.SYID
END
---------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[sp_TedarikçiEkle] Script Date: 27.12.2015 03:31:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_TedarikçiEkle]
@Ad nchar(50),
@iletisim nchar(50),
@ürünadi nchar(50),
@ucret nchar(20),
@miktar nchar(20),
@tarih nchar(30)
AS
BEGIN
insert into MalzemeTedarikçisi(MTAd,MTIletisim,MTUrunadı,MTUcret,MTMiktar,MTTarih)
values(@Ad,@iletisim,@ürünadi,@ucret,@miktar,@tarih)
END
-----------------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[SubeYöneticiAra] Script Date: 27.12.2015 03:31:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[SubeYöneticiAra]
(
@Adi nchar(50)
)
AS
BEGIN
select *from SubeYönetici sy where sy.AdSoyad like '%' + @Adi + '%'
END
----------------------------------
USE [VeritabanıProje]
GO
/****** Object: StoredProcedure [dbo].[sp_YöneticiEkle] Script Date: 27.12.2015 03:31:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sp_YöneticiEkle]
@AdSoyad nchar(50),
@İletisim nchar(50),
@Adres nchar(50)
AS
BEGIN
insert into SubeYönetici(AdSoyad,İletişim,Adres)
values (@AdSoyad,@İletisim,@Adres)
END
-----------------------------------
------------------------------------
Triggerlar
--
USE [VeritabanıProje]
GO
/****** Object: Trigger [dbo].[FRMüsidbildirim] Script Date: 27.12.2015 03:34:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[FRMüsidbildirim]
ON [dbo].[FirmaMüsteri]
after insert
as
begin
select ' Yeni Kayıt Eklendi Kayıtlarınızın Id leriniKontrol ediniz '
end
--------------------------------
USE [VeritabanıProje]
GO
/****** Object: Trigger [dbo].[FRMTidbildirim] Script Date: 27.12.2015 03:34:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[FRMTidbildirim]
ON [dbo].[FirmaMalzemeTedarikçisi]
after insert
as
begin
select ' Yeni Kayıt Eklendi Kayıtlarınızın Id leriniKontrol ediniz '
end
-----------------------------------
USE [VeritabanıProje]
GO
/****** Object: Trigger [dbo].[eklemedöndür] Script Date: 27.12.2015 03:35:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[eklemedöndür]
on [dbo].[Müsteri]
after insert
as
begin
select 'bir kayit eklendi'
end---------------------------------
-----------------------------------
USE [VeritabanıProje]
GO
/****** Object: Trigger [dbo].[silmeislemi] Script Date: 27.12.2015 03:35:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[silmeislemi]
on [dbo].[Personel]
after delete
as
begin
declare @PersID int
select @PersID =PersonelID from deleted
delete from Kadrolu where PersonelID = @PersID
delete from Sozlesmeli where PersonelID = @PersID
end
---------------------------------------
USE [VeritabanıProje]
GO
/****** Object: Trigger [dbo].[siparis_Tg] Script Date: 27.12.2015 03:36:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER trigger [dbo].[siparis_Tg]
on [dbo].[Siparis]
after update
as
begin
select 'Bir Kayıt Güncellendi'
end
-------------------------------------------
Hiç yorum yok:
Yorum Gönder