Selamlar,
Bugün sizlere forum için yapmış olduğum TurkHackTeam Yönetici Takip Programını tanıtacağım.
Programda C# ve Sql Server Kullanıldı.
Öncelikle yapmamız gereken SQL serverı projemize bağlamak.
Sayfayı açmak için butona tıkladığımızda bir daha aynı sayfa açılmasın ve sayfayı tekrar açmak için yazmış olduğum kodlar yukardaki gibidir.
Eski Yöneticiler Sayfası Ve Kaynak Kodları
BLUE EKİBİ
AR-GE EKİBİ
ANKA EKİBİ
Kodlarda tek değişen şey sayfanın Timine göre Tabloyu değiştirmeniz gerekiyor.
Arge ekibi sql de ARGE tablosunda yer alacak gibi.
İyi Forumlar...
Bugün sizlere forum için yapmış olduğum TurkHackTeam Yönetici Takip Programını tanıtacağım.
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
Programda C# ve Sql Server Kullanıldı.
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
Öncelikle yapmamız gereken SQL serverı projemize bağlamak.
Ben bu işlemleri tekrarlamamak için bir class oluşturdum.
Kendi sql bağlantınızı karaladığım yere yazabilirsiniz.
SQL server da proje için açmış olduğum tablolar.
Kendi sql bağlantınızı karaladığım yere yazabilirsiniz.
SQL server da proje için açmış olduğum tablolar.
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
ANASAYFA TASARIMI
Anasayfayı DevExpressin bize sağlamış olduğu eklentileri kullanarak kendim için revize ettim.
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
ANASAYFA KODLARI
Kod:
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 Otomasyon
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Frmkullanici fr;
Frmudy fr1;
Frmarge fr2;
Frmmod fr3;
Frmblue fr4;
Frmistihbarat fr5;
Frmanka fr6;
Frmtasarım fr7;
Frmbasın fr8;
private void barButtonItem7_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr6 == null || fr6.IsDisposed)
{
fr6 = new Frmanka();
fr6.MdiParent = this;
fr6.Show();
}
}
private void barButtonItem9_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr8 == null || fr8.IsDisposed)
{
fr8 = new Frmbasın();
fr8.MdiParent = this;
fr8.Show();
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr == null || fr.IsDisposed)
{
fr = new Frmkullanici();
fr.MdiParent = this;
fr.Show();
}
}
private void btnudy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr1 == null || fr1.IsDisposed)
{
fr1 = new Frmudy();
fr1.MdiParent = this;
fr1.Show();
}
}
private void btnarge_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr2 == null || fr2.IsDisposed)
{
fr2 = new Frmarge();
fr2.MdiParent = this;
fr2.Show();
}
}
private void btnmod_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr3 == null || fr3.IsDisposed)
{
fr3 = new Frmmod();
fr3.MdiParent = this;
fr3.Show();
}
}
private void btnblue_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr4 == null || fr4.IsDisposed)
{
fr4 = new Frmblue();
fr4.MdiParent = this;
fr4.Show();
}
}
private void btnistihbarat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr5 == null || fr5.IsDisposed)
{
fr5 = new Frmistihbarat();
fr5.MdiParent = this;
fr5.Show();
}
}
private void btntasarim_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
if (fr7 == null || fr7.IsDisposed)
{
fr7 = new Frmtasarım();
fr7.MdiParent = this;
fr7.Show();
}
}
private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
}
}
}
Sayfayı açmak için butona tıkladığımızda bir daha aynı sayfa açılmasın ve sayfayı tekrar açmak için yazmış olduğum kodlar yukardaki gibidir.
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
ÜDY SAYFA TASARIMI VE KAYNAK KODLARI
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
ÜST DÜZEY YÖNETİM SAYFASI KAYNAK KODLARI
Kod:
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 System.Data.SqlClient;
namespace Otomasyon
{
public partial class Frmudy : Form
{
public Frmudy()
{
InitializeComponent();
}
sqlbaglantisi bgl = new sqlbaglantisi();
void listele()
{
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter("Select * From ÜDY", bgl.baglanti());
da.Fill(dt);
gridControl1.DataSource = dt;
}
private void simpleButton1_Click(object sender, EventArgs e)
{
//Verileri Kaydetme
SqlCommand komut = new SqlCommand("insert into ÜDY (KULLANICIADI,RÜTBE,GÖREVLENDİRME) values (@p1,@p2,@p3)", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", txtkullanici.Text);//kullanıcıadı
komut.Parameters.AddWithValue("@p2", comboBox1.Text);//rütbe
komut.Parameters.AddWithValue("@p3", richTextBox1.Text); //görevlendirme
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Sisteme Eklendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
listele();
}
private void Frmudy_Load(object sender, EventArgs e)
{
listele();
}
private void btnsil_Click(object sender, EventArgs e)
{
SqlCommand komutsil = new SqlCommand("Delete From ÜDY where KULLANICIADI=@p1", bgl.baglanti());
komutsil.Parameters.AddWithValue("@p1", txtkullanici.Text);
komutsil.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Sistemden Silindi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
listele();
}
private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
DataRow dr = gridView1.GetDataRow(gridView1.FocusedRowHandle);
txtkullanici.Text = dr["KULLANICIADI"].ToString();
comboBox1.Text = dr["RÜTBE"].ToString();
richTextBox1.Text = dr["GÖREVLENDİRME"].ToString();
}
private void btnguncelle_Click(object sender, EventArgs e)
{
SqlCommand komut = new SqlCommand("update ÜDY set KULLANICIADI=@p1, RÜTBE=@p2, GÖREVLENDİRME=@p3 where KULLANICIADI=@p1", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", txtkullanici.Text);
komut.Parameters.AddWithValue("@p2", comboBox1.Text);
komut.Parameters.AddWithValue("@p3", richTextBox1.Text);
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Güncellendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
listele();
}
}
}
Üdy için sadece kullanıcı adı giriş yeri ve rütbesini yazıp kaydedip,silip veya güncelleyebiliriz.![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
Eski Yöneticiler Sayfası Ve Kaynak Kodları
Kod:
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 System.Data.SqlClient;
namespace Otomasyon
{
public partial class Frmkullanici : Form
{
public Frmkullanici()
{
InitializeComponent();
}
sqlbaglantisi bgl = new sqlbaglantisi();
void listele()
{
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter("Select * From kullaniciara", bgl.baglanti());
da.Fill(dt);
gridControl1.DataSource = dt;
}
private void gridControl1_Click(object sender, EventArgs e)
{
}
private void Frmkullanici_Load(object sender, EventArgs e)
{
listele();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
//Verileri Kaydetme
SqlCommand komut = new SqlCommand("insert into kullaniciara (KULLANICIAD,TİM,YAŞ,RÜTBE,GİRİŞZAMANI,ÇIKIŞZAMANI,DETAY) values (@p1,@p2,@p3,@p4,@p5,@p6,@p7)", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", txtkullanici.Text);
komut.Parameters.AddWithValue("@p2", comboBox2.Text);
komut.Parameters.AddWithValue("@p3", maskedTextBox1.Text);
komut.Parameters.AddWithValue("@p4", comboBox1.Text);
komut.Parameters.AddWithValue("@p5", maskedTextBox2.Text);
komut.Parameters.AddWithValue("@p6", maskedTextBox3.Text);
komut.Parameters.AddWithValue("@p7", richTextBox1.Text);
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Sisteme Eklendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
listele();
}
private void btnsil_Click(object sender, EventArgs e)
{
SqlCommand komutsil = new SqlCommand("Delete From kullaniciara where KULLANICIAD=@p1", bgl.baglanti());
komutsil.Parameters.AddWithValue("@p1", txtkullanici.Text);
komutsil.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Sistemden Silindi!","Bilgi",MessageBoxButtons.OK, MessageBoxIcon.Error);
listele();
}
private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
DataRow dr = gridView1.GetDataRow(gridView1.FocusedRowHandle);
txtkullanici.Text = dr["KULLANICIAD"].ToString();
comboBox2.Text = dr["TİM"].ToString();
maskedTextBox1.Text = dr["YAŞ"].ToString();
comboBox1.Text = dr["RÜTBE"].ToString();
maskedTextBox2.Text = dr["GİRİŞZAMANI"].ToString();
maskedTextBox3.Text = dr["ÇIKIŞZAMANI"].ToString();
richTextBox1.Text = dr["DETAY"].ToString();
}
private void btnguncelle_Click(object sender, EventArgs e)
{
SqlCommand komut = new SqlCommand("update kullaniciara set KULLANICIAD=@p1, TİM=@p2, YAŞ=@p3, RÜTBE=@p4, GİRİŞZAMANI=@p5, ÇIKIŞZAMANI=@p6, DETAY=@p7 where KULLANICIAD=@p1", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", txtkullanici.Text);
komut.Parameters.AddWithValue("@p2", comboBox2.Text);
komut.Parameters.AddWithValue("@p3", maskedTextBox1.Text);
komut.Parameters.AddWithValue("@p4", comboBox1.Text);
komut.Parameters.AddWithValue("@p5", maskedTextBox2.Text);
komut.Parameters.AddWithValue("@p6", maskedTextBox3.Text);
komut.Parameters.AddWithValue("@p7", richTextBox1.Text);
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Güncellendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
listele();
}
private void groupControl1_Paint(object sender, PaintEventArgs e)
{
}
private void Frmkullanici_FormClosed(object sender, FormClosedEventArgs e)
{
}
}
}
Burdaki bilgilerin daha fazla olması gerektiğini düşündüğüm için
Rütbesi
Çıkmadan Önceki Tim
Yönetime Giriş Zamanı
Yönetimden Çıkış Zamanı
Çıkma Sebebi (Yönetici Notu)
Rütbesi
Çıkmadan Önceki Tim
Yönetime Giriş Zamanı
Yönetimden Çıkış Zamanı
Çıkma Sebebi (Yönetici Notu)
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
TİMLER SAYFASI TASARIMI VE KAYNAK KODLARI
TASARIM EKİBİ
MODERASYON EKİBİ
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
MODERASYON EKİBİ
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
İSTİHBARAT EKİBİ
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
BLUE EKİBİ
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
BASIN MEDYA EKİBİ
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
AR-GE EKİBİ
![5aE7rL.png](https://i.hizliresim.com/5aE7rL.png)
ANKA EKİBİ
KAYNAK KODLARI
Kod:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Otomasyon
{
public partial class Frmarge : Form
{
public Frmarge()
{
InitializeComponent();
}
sqlbaglantisi bgl = new sqlbaglantisi();
void listele()
{
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter("Select * From ARGE", bgl.baglanti());
da.Fill(dt);
gridControl1.DataSource = dt;
}
private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
DataRow dr = gridView1.GetDataRow(gridView1.FocusedRowHandle);
txtkullanici.Text = dr["KULLANICIADI"].ToString();
maskedTextBox1.Text = dr["YAŞ"].ToString();
comboBox1.Text = dr["RÜTBE"].ToString();
maskedTextBox2.Text = dr["GİRİŞZAMANI"].ToString();
richTextBox1.Text = dr["YÖNETİCİNOTLARI"].ToString();
maskedTextBox3.Text = dr["SONTERFİZAMANI"].ToString();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
//Verileri Kaydetme
SqlCommand komut = new SqlCommand("insert into ARGE (KULLANICIADI,YAŞ,RÜTBE,GİRİŞZAMANI,YÖNETİCİNOTLARI,SONTERFİZAMANI) values (@p1,@p2,@p3,@p4,@p5,@p6)", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", txtkullanici.Text); // KULLANICIADI
komut.Parameters.AddWithValue("@p2", maskedTextBox1.Text); // YAŞ
komut.Parameters.AddWithValue("@p3", comboBox1.Text); // RÜTBE
komut.Parameters.AddWithValue("@p4", maskedTextBox2.Text); // GİRİŞZAMANI
komut.Parameters.AddWithValue("@p5", richTextBox1.Text); // YÖNETİCİNOTLARI
komut.Parameters.AddWithValue("@p6", maskedTextBox3.Text); // SONTERFİZZAMANI
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Sisteme Eklendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);
listele();
}
private void btnsil_Click(object sender, EventArgs e)
{
SqlCommand komutsil = new SqlCommand("Delete From ARGE where KULLANICIADI=@p1", bgl.baglanti());
komutsil.Parameters.AddWithValue("@p1", txtkullanici.Text);
komutsil.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Sistemden Silindi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Error);
listele();
}
private void btnguncelle_Click(object sender, EventArgs e)
{
SqlCommand komut = new SqlCommand("update ARGE set KULLANICIADI=@p1, YAŞ=@p2, RÜTBE=@p3, GİRİŞZAMANI=@p4, YÖNETİCİNOTLARI=@p5, SONTERFİZAMANI=@p6 where KULLANICIADI=@p1", bgl.baglanti());
komut.Parameters.AddWithValue("@p1", txtkullanici.Text); // KULLANICIADI
komut.Parameters.AddWithValue("@p2", maskedTextBox1.Text); // YAŞ
komut.Parameters.AddWithValue("@p3", comboBox1.Text); // RÜTBE
komut.Parameters.AddWithValue("@p4", maskedTextBox2.Text); // GİRİŞZAMANI
komut.Parameters.AddWithValue("@p5", richTextBox1.Text); // YÖNETİCİNOTLARI
komut.Parameters.AddWithValue("@p6", maskedTextBox3.Text); // SONTERFİZZAMANI
komut.ExecuteNonQuery();
bgl.baglanti().Close();
MessageBox.Show("Kullanıcı Güncellendi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
listele();
}
private void Frmarge_Load(object sender, EventArgs e)
{
listele();
}
}
}
Kodlarda tek değişen şey sayfanın Timine göre Tabloyu değiştirmeniz gerekiyor.
Arge ekibi sql de ARGE tablosunda yer alacak gibi.
İyi Forumlar...
![7u7xwqk.png](https://i.hizliresim.com/7u7xwqk.png)