Gorsel Programlama | Görsel Programlama | C#.Net | VB.Net | C# Console

ana sayfa > C# > Sağlık Ocağı Randevu Takip Programı C#

Sağlık Ocağı Randevu Takip Programı C#

Salı, 15 Haz 2010 yorum ekle yorumlara git

Sağlık Ocağı Randevu Takip Programı C#

Bu ve benzeri takip programlar veya bu programa artı özellikler ekletmek istiyorsanız [email protected] adresine mail atın.

FORM1 İçerisine Yazılacak Kodlar…

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form2 frm2;
public Form3 frm3;
public Form1()
{
InitializeComponent();
frm2 = new Form2();
frm3 = new Form3();
frm2.frm1 = this;
frm3.frm1 = this;

}

public OleDbConnection bag = new OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=vt.mdb");
public OleDbCommand kmt = new OleDbCommand();
public OleDbDataAdapter adtr = new OleDbDataAdapter();
public DataSet dtst = new DataSet();

public void combo()
{
bag.Open();
kmt.Connection = bag;
kmt.CommandText = "Select * from bossaat";
OleDbDataReader oku;
oku = kmt.ExecuteReader();
while (oku.Read())
{
comboBox1.Items.Add(oku[0].ToString());
}
bag.Close();
oku.Dispose();
comboBox1.Sorted = true;
}

public void combo2()
{
bag.Open();
kmt.Connection = bag;
kmt.CommandText = "Select * from dolusaat";
OleDbDataReader oku;
oku = kmt.ExecuteReader();
while (oku.Read())
{
frm3.comboBox1.Items.Add(oku[0].ToString());
}
bag.Close();
oku.Dispose();
frm3.comboBox1.Sorted = true;
}

public void listele()
{
bag.Open();
OleDbDataAdapter adtr = new OleDbDataAdapter("select * From hasbil", bag);
adtr.Fill(dtst, "hasbil");
frm3.dataView1.Table = dtst.Tables[0];
frm3.dataGrid1.DataSource = frm3.dataView1;
adtr.Dispose();
bag.Close();

}

public void adyaz()
{

bag.Open();
kmt.Connection = bag;
kmt.CommandText = "Select * from hasbil";
OleDbDataReader oku;
oku = kmt.ExecuteReader();
while (oku.Read())
{
switch (oku[6].ToString())
{
case "08:00":
{
frm2.button1.Text = oku[1].ToString();
frm2.button1.BackColor = System.Drawing.Color.Red;
break;
}
case "08:30":
{
frm2.button2.Text = oku[1].ToString();
frm2.button2.BackColor = System.Drawing.Color.Red;
break;
}
case "09:00":
{
frm2.button3.Text = oku[1].ToString();
frm2.button3.BackColor = System.Drawing.Color.Red;
break;
}
case "09:30":
{
frm2.button4.Text = oku[1].ToString();
frm2.button4.BackColor = System.Drawing.Color.Red;
break;
}
case "10:00":
{
frm2.button5.Text = oku[1].ToString();
frm2.button5.BackColor = System.Drawing.Color.Red;
break;
}
case "10:30":
{
frm2.button6.Text = oku[1].ToString();
frm2.button6.BackColor = System.Drawing.Color.Red;
break;
}
case "11:00":
{
frm2.button7.Text = oku[1].ToString();
frm2.button7.BackColor = System.Drawing.Color.Red;
break;
}
case "11:30":
{
frm2.button8.Text = oku[1].ToString();
frm2.button8.BackColor = System.Drawing.Color.Red;

break;
}
case "12:00":
{
frm2.button9.Text = oku[1].ToString();
frm2.button9.BackColor = System.Drawing.Color.Red;
break;
}
case "12:30":
{
frm2.button10.Text = oku[1].ToString();
frm2.button10.BackColor = System.Drawing.Color.Red;
break;
}
case "13:00":
{

frm2.button11.Text = oku[1].ToString();
frm2.button11.BackColor = System.Drawing.Color.Red;
break;
}
case "13:30":
{
frm2.button12.Text = oku[1].ToString();
frm2.button12.BackColor = System.Drawing.Color.Red;
break;
}
case "14:00":
{
frm2.button13.Text = oku[1].ToString();
frm2.button13.BackColor = System.Drawing.Color.Red;
break;
}
case "14:30":
{
frm2.button14.Text = oku[1].ToString();
frm2.button14.BackColor = System.Drawing.Color.Red;
break;
}
case "15:00":
{
frm2.button15.Text = oku[1].ToString();
frm2.button15.BackColor = System.Drawing.Color.Red;
break;
}
case "15:30":
{
frm2.button16.Text = oku[1].ToString();
frm2.button16.BackColor = System.Drawing.Color.Red;
break;
}
case "16:00":
{
frm2.button17.Text = oku[1].ToString();
frm2.button17.BackColor = System.Drawing.Color.Red;
break;
}
case "16:30":
{
frm2.button18.Text = oku[1].ToString();
frm2.button18.BackColor = System.Drawing.Color.Red;
break;
}
case "17:00":
{
frm2.button19.Text = oku[1].ToString();
frm2.button19.BackColor = System.Drawing.Color.Red;
break;
}
case "17:30":
{
frm2.button20.Text = oku[1].ToString();
frm2.button20.BackColor = System.Drawing.Color.Red;
break;
}
}

}
bag.Close();
oku.Dispose();
}

public void adsil()
{
switch (frm3.comboBox1.Text)
{
case "08:00":
{
frm2.button1.Text = "08:00";
frm2.button1.BackColor = System.Drawing.Color.Green;
break;
}
case "08:30":
{

frm2.button2.Text = "08:30";
frm2.button2.BackColor = System.Drawing.Color.Green;
break;
}
case "09:00":
{
frm2.button3.Text = "09:00";
frm2.button3.BackColor = System.Drawing.Color.Green;
break;
}
case "09:30":
{
frm2.button4.Text = "09:30";
frm2.button4.BackColor = System.Drawing.Color.Red;
break;
}
case "10:00":
{
frm2.button5.Text = "10:00";
frm2.button5.BackColor = System.Drawing.Color.Green;
break;
}
case "10:30":
{
frm2.button6.Text = "10:30";
frm2.button6.BackColor = System.Drawing.Color.Green;
break;
}
case "11:00":
{
frm2.button7.Text = "11:00";
frm2.button7.BackColor = System.Drawing.Color.Green;
break;
}
case "11:30":
{
frm2.button8.Text = "11:30";
frm2.button8.BackColor = System.Drawing.Color.Green;
break;
}
case "12:00":
{
frm2.button9.Text = "12:00";
frm2.button9.BackColor = System.Drawing.Color.Green;
break;
}
case "12:30":
{
frm2.button10.Text = "12:30";
frm2.button10.BackColor = System.Drawing.Color.Green;
break;
}
case "13:00":
{
frm2.button11.Text = "13:00";
frm2.button11.BackColor = System.Drawing.Color.Green;
break;
}
case "13:30":
{
frm2.button12.Text = "13:30";
frm2.button12.BackColor = System.Drawing.Color.Green;
break;
}
case "14:00":
{
frm2.button13.Text = "14:00";
frm2.button13.BackColor = System.Drawing.Color.Green;
break;
}
case "14:30":
{
frm2.button14.Text = "14:30";
frm2.button14.BackColor = System.Drawing.Color.Green;
break;
}
case "15:00":
{
frm2.button15.Text = "15:00";
frm2.button15.BackColor = System.Drawing.Color.Green;
break;
}
case "15:30":
{
frm2.button16.Text = "15:30";
frm2.button16.BackColor = System.Drawing.Color.Green;
break;
}
case "16:00":
{
frm2.button17.Text = "16:00";
frm2.button17.BackColor = System.Drawing.Color.Green;
break;
}
case "16:30":
{
frm2.button18.Text = "16:30";
frm2.button18.BackColor = System.Drawing.Color.Green;
break;
}
case "17:00":
{
frm2.button19.Text = "17:00";
frm2.button19.BackColor = System.Drawing.Color.Green;
break;
}
case "17:30":
{
frm2.button20.Text = "17:30";
frm2.button20.BackColor = System.Drawing.Color.Green;
break;
}
}
}

private void button1_Click(object sender, EventArgs e)
{
frm3.Show();
this.Hide();
}

private void button2_Click(object sender, EventArgs e)
{
frm2.Show();
this.Hide();
}

private void button3_Click(object sender, EventArgs e)
{
if (textBox1.Text != "" && textBox5.Text != "" && comboBox1.Text != "")
{
bag.Open();
kmt.Connection = bag;
kmt.CommandText = "INSERT INTO hasbil(tckimlik,ad,soyad,dtarihi,doktorad,sikayet,rsaati) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + comboBox1.Text + "') ";
kmt.ExecuteNonQuery();
kmt.CommandText = "INSERT INTO dolusaat(dolu_saat) VALUES ('" + comboBox1.Text + "') ";
kmt.ExecuteNonQuery();
kmt.CommandText = "DELETE from bossaat WHERE bos_saat='" + comboBox1.Text + "'";
kmt.ExecuteNonQuery();
kmt.Dispose();
bag.Close();
comboBox1.Items.Clear();
textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear();
textBox5.Clear(); textBox6.Clear();
comboBox1.Text = "";
combo();
adyaz();
MessageBox.Show("Kayıt işlemi tamamlandı ! ","Kaydedildi!");
}
else
{
MessageBox.Show("Boş alanları doldurunuz !!!","HATA");
}
}

private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void Form1_Load(object sender, EventArgs e)
{
combo();
}
}
}

Bu ve benzeri takip programlar veya bu programa artı özellikler ekletmek istiyorsanız [email protected] adresine mail atın.

FORM1 İçerisine Yazılacak Kodlar…

public partial class Form2 : Form
{
public Form1 frm1;
public Form2()
{
InitializeComponent();
}

private void Form2_Load(object sender, EventArgs e)
{
frm1.adyaz();
}

private void button22_Click(object sender, EventArgs e)
{
frm1.Show();
this.Hide();
}

private void button21_Click(object sender, EventArgs e)
{
Application.Exit();
}
}

FORM1 İçerisine Yazılacak Kodlar…

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication4
{
public partial class Form3 : Form
{
public Form1 frm1;
public Form3()
{
InitializeComponent();
}
void sira()
{
textBox7.Text = (this.BindingContext[frm1.dtst, "hasbil"].Position + 1) + " / " + this.BindingContext[frm1.dtst, "hasbil"].Count;
}

private void Form3_Load(object sender, EventArgs e)
{
frm1.combo2();
frm1.listele();
textBox1.DataBindings.Add("Text", frm1.dtst, "hasbil.tckimlik");
textBox2.DataBindings.Add("Text", frm1.dtst, "hasbil.ad");
textBox3.DataBindings.Add("Text", frm1.dtst, "hasbil.soyad");
textBox4.DataBindings.Add("Text", frm1.dtst, "hasbil.dtarihi");
textBox5.DataBindings.Add("Text", frm1.dtst, "hasbil.doktorad");
textBox6.DataBindings.Add("Text", frm1.dtst, "hasbil.sikayet");
comboBox1.DataBindings.Add("Text", frm1.dtst, "hasbil.rsaati");
sira();

}

private void button1_Click(object sender, EventArgs e)
{

if (textBox1.Text != "" && textBox5.Text != "" && comboBox1.Text != "")
{
DialogResult cevap;
cevap = MessageBox.Show("Kaydı silmek istediğinizden eminmisiniz", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (cevap == DialogResult.Yes)
{
frm1.adsil();
frm1.bag.Open();
frm1.kmt.Connection = frm1.bag;
frm1.kmt.CommandText = "DELETE from hasbil WHERE TcKimlik='" + textBox1.Text + "'";
frm1.kmt.ExecuteNonQuery();
frm1.kmt.CommandText = "INSERT INTO bossaat(bos_saat) VALUES ('" + comboBox1.Text + "') ";
frm1.kmt.ExecuteNonQuery();
frm1.kmt.CommandText = "DELETE from dolusaat WHERE dolu_saat='" + comboBox1.Text + "'";
frm1.kmt.ExecuteNonQuery();
frm1.kmt.Dispose();
frm1.bag.Close();
comboBox1.Items.Clear();
frm1.comboBox1.Items.Clear();
comboBox1.Text = "";
frm1.combo();
frm1.combo2();
frm1.dtst.Clear();
frm1.listele();
}
}
else
{
MessageBox.Show("Boş alanları doldurunuz !!!");
}
}

private void button6_Click(object sender, EventArgs e)
{
this.BindingContext[frm1.dtst, "hasbil"].Position += 1;
sira();

}

private void button7_Click(object sender, EventArgs e)
{
this.BindingContext[frm1.dtst, "hasbil"].Position = this.BindingContext[frm1.dtst, "hasbil"].Count;
sira();
}

private void button5_Click(object sender, EventArgs e)
{
this.BindingContext[frm1.dtst, "hasbil"].Position -= 1;
sira();
}

private void button3_Click(object sender, EventArgs e)
{
this.BindingContext[frm1.dtst, "hasbil"].Position = 0;
sira();
}

private void button2_Click(object sender, EventArgs e)
{
frm1.Show();
this.Hide();
}

private void button4_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void button6_Click_1(object sender, EventArgs e)
{
this.BindingContext[frm1.dtst, "hasbil"].Position += 1;
sira();
}
}
}

Bu ve benzeri takip programlar veya bu programa artı özellikler ekletmek istiyorsanız [email protected] adresine mail atın.

Projeyi İNDİR








Rica: Sitemizin Google'da Ön Sıralarda Çıkması İçin Lütfen Alttaki Google+ Butonuna Tıklayınız , Sayfamızı Facebookta Beğeniniz veya yazıları Twitter,Facebookta paylaşınız.
Paylaş :



Böyle bir web sayfam olsun diyorsanız iletişim bölümünden veya [email protected] mail adresinden bize ulaşabilirsiniz.


Tüm cep telefonu aksesuar fırsatları için tıklayın !

  1. şimdilik yorum yok.
  1. şimdilik geri bağlantı yok