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 ApartmanYonetim
{
public partial class Giris : Form
{
public Giris()
{
InitializeComponent();
}
private void simpleButton3_Click(object sender, EventArgs e)
{
MessageBox.Show("Yeni Şifrenizi almak için uygulama programcısını arayın...");
private void Giris_Load(object sender, EventArgs e)
{
}
private void simpleButton1_Click(object sender, EventArgs e)
{
Aidat a = new Aidat();
if (kullaniciAdi.Text == "Gokhan" && sifre.Text == "123456")
{
a.Show();
}
}
}
}
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;
using System.Data;
namespace ApartmanYonetim
{
public partial class Aidat : Form
{
public Aidat()
{
InitializeComponent();
}
void griddoldur()
{
SqlConnection con = new SqlConnection("server=LOCALHOST; Initial Catalog=ApartmanYonetim;Integrated Security=SSPI");
SqlDataAdapter da = new SqlDataAdapter("Select *FROM aidat order by blok,daireNo", con);
DataSet ds = new DataSet();
con.Open();
da.Fill(ds, "aidat");
dataGridView1.DataSource = ds.Tables["aidat"];
con.Close();
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void Aidat_Load(object sender, EventArgs e)
{
}
private void veriGirisi_Click(object sender, EventArgs e)
{
ListeyeEkle l = new ListeyeEkle();
l.Show();
}
private void sil_Click(object sender, EventArgs e)
{
ListedenSil sil = new ListedenSil();
sil.Show();
}
private void yazdir_Click(object sender, EventArgs e)
{
griddoldur();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
Guncelle g = new Guncelle();
g.Show();
}
private void ode_Click(object sender, EventArgs e)
{
ekleOde ek = new ekleOde();
ek.ShowDialog();
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
}
}
}
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 ApartmanYonetim
{
public partial class ListeyeEkle : Form
{
public ListeyeEkle()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
string sorgu = "insert into aidat(blok,kat,daireNo,borc,borcSahibi) values (@blok,@kat,@daireNo,@borc,@borcSahibi)";
SqlConnection con = new SqlConnection("server=LOCALHOST; Initial Catalog=ApartmanYonetim;Integrated Security=SSPI");
SqlCommand cmd = new SqlCommand(sorgu,con);
cmd.Parameters.AddWithValue("@blok", tBlok.Text);
cmd.Parameters.AddWithValue("@kat", tKat.Text);
cmd.Parameters.AddWithValue("@daireNo", tDaire.Text);
cmd.Parameters.AddWithValue("@borc", tBorc.Text);
cmd.Parameters.AddWithValue("@borcSahibi", tBorcSahibi.Text);
con.Open();
cmd.Connection = con;
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex) {
MessageBox.Show("Bu daire dolu!!!");
}
con.Close();
}
private void simpleButton2_Click(object sender, EventArgs e)
{
Close();
}
}
}
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 ApartmanYonetim
{
public partial class ListedenSil : Form
{
public ListedenSil()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("server=LOCALHOST; Initial Catalog=ApartmanYonetim;Integrated Security=SSPI");
string sorgu = "Delete From aidat Where daireNo=@no";
SqlCommand cmd = new SqlCommand(sorgu, con);
cmd.Parameters.AddWithValue("@no", Convert.ToInt32(tdaireNo.Text));
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
private void simpleButton2_Click(object sender, EventArgs e)
{
Close();
}
}
}
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 ApartmanYonetim
{
public partial class ekleOde : Form
{
public ekleOde()
{
InitializeComponent();
}
private void groupControl1_Paint(object sender, PaintEventArgs e)
{
}
private void simpleButton1_Click(object sender, EventArgs e)
{
string sorgu = "update aidat set borc=borc+@eklenecek";
SqlConnection con = new SqlConnection("server=LOCALHOST; Initial Catalog=ApartmanYonetim;Integrated Security=SSPI");
SqlCommand cmd = new SqlCommand(sorgu, con);
int aidat=Convert.ToInt32(tBekle.Text);
cmd.Parameters.AddWithValue("@eklenecek",aidat);
con.Open();
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
}
private void simpleButton2_Click(object sender, EventArgs e)
{
string sorgu = "update aidat set borc=borc-@odenecek where daireno=@daireNo";
SqlConnection con = new SqlConnection("server=LOCALHOST; Initial Catalog=ApartmanYonetim;Integrated Security=SSPI");
SqlCommand cmd = new SqlCommand(sorgu, con);
int aidat = Convert.ToInt32(tOdenecek.Text);
cmd.Parameters.AddWithValue("@odenecek", aidat);
cmd.Parameters.AddWithValue("@daireNo", tDaireNo.Text);
con.Open();
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
}
}
}
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 ApartmanYonetim
{
public partial class Guncelle : Form
{
public Guncelle()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("server=LOCALHOST; Initial Catalog=ApartmanYonetim;Integrated Security=SSPI");
if(cKayit.Text=="Borc"){
int cevir = Convert.ToInt32(tDeger.Text);
string sorgu="Update aidat set borc=@borc where daireNo=@daireNo";
SqlCommand cmd = new SqlCommand(sorgu, con);
con.Open();
cmd.Connection = con;
cmd.Parameters.AddWithValue("@borc",cevir);
cmd.Parameters.AddWithValue("@daireNo", tdaireNO.Text);
cmd.ExecuteNonQuery();
con.Close();
}
else if (cKayit.Text=="BorcSahibi")
{
string sorgu="Update aidat set borcSahibi=@borcSahibi where daireNo=@daireNo";
SqlCommand cmd = new SqlCommand(sorgu, con);
con.Open();
cmd.Connection = con;
cmd.Parameters.AddWithValue("@borcSahibi",tDeger.Text);
cmd.Parameters.AddWithValue("@daireNo", tdaireNO.Text);
cmd.ExecuteNonQuery();
con.Close();
}
else if (cKayit.Text == "Blok")
{
string sorgu = "Update aidat set blok=@blok where daireNo=@daireNo";
SqlCommand cmd = new SqlCommand(sorgu, con);
con.Open();
cmd.Connection = con;
cmd.Parameters.AddWithValue("@blok", tDeger.Text);
cmd.Parameters.AddWithValue("@daireNo", tdaireNO.Text);
cmd.ExecuteNonQuery();
con.Close();
}
else if (cKayit.Text == "Kat")
{
string sorgu = "Update aidat set kat=@kat where daireNo=@daireNo";
SqlCommand cmd = new SqlCommand(sorgu, con);
con.Open();
cmd.Connection = con;
cmd.Parameters.AddWithValue("@kat", tDeger.Text);
cmd.Parameters.AddWithValue("@daireNo", tdaireNO.Text);
cmd.ExecuteNonQuery();
con.Close();
}
else if (cKayit.Text == "DaireNo")
{
string sorgu = "Update aidat set daireNo=@daireNoo where daireNo=@daireNo";
SqlCommand cmd = new SqlCommand(sorgu, con);
con.Open();
cmd.Connection = con;
cmd.Parameters.AddWithValue("@daireNoo", tDeger.Text);
cmd.Parameters.AddWithValue("@daireNo", tdaireNO.Text);
cmd.ExecuteNonQuery();
con.Close();
}
}
}
}