murat335
New member
- Katılım
 - 10 Eyl 2005
 
- Mesajlar
 - 874
 
- Reaction score
 - 0
 
- Puanları
 - 0
 
- Yaş
 - 43
 
		PHP:
	
	using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using nufus.tr.gov.nvi.tckimlik;
namespace nufus
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.ComboBox cmbiller;
		private System.Windows.Forms.ComboBox cmbilceler;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.Label label3;
		private System.Windows.Forms.TextBox txtadi;
		private System.Windows.Forms.Label label4;
		private System.Windows.Forms.TextBox txtsadi;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.TextBox txtano;
		private System.Windows.Forms.Label label7;
		private System.Windows.Forms.TextBox txtbno;
		private System.Windows.Forms.Button secenek1;
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.Button Secenek2;
		private System.Windows.Forms.Label label8;
		private System.Windows.Forms.TextBox txtdyili;
		private System.Windows.Forms.Label label9;
		private System.Windows.Forms.Label label10;
		private System.Windows.Forms.Label label11;
		private System.Windows.Forms.Label label12;
		private System.Windows.Forms.Label lblsonuc;
		private KPSPublicWebService servis;
		private IlBilgisi[] iller;
		private IlceBilgisi[] ilceler;
		private System.Windows.Forms.TextBox txtciltno;
		private System.Windows.Forms.TextBox txtanadi;
		private System.Windows.Forms.TextBox txtbadi;
		private System.Windows.Forms.ComboBox cmbcinsiyet;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if (components != null) 
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}
		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.label1 = new System.Windows.Forms.Label();
			this.cmbiller = new System.Windows.Forms.ComboBox();
			this.cmbilceler = new System.Windows.Forms.ComboBox();
			this.label2 = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.txtadi = new System.Windows.Forms.TextBox();
			this.label4 = new System.Windows.Forms.Label();
			this.txtsadi = new System.Windows.Forms.TextBox();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.secenek1 = new System.Windows.Forms.Button();
			this.label7 = new System.Windows.Forms.Label();
			this.txtbno = new System.Windows.Forms.TextBox();
			this.label6 = new System.Windows.Forms.Label();
			this.txtano = new System.Windows.Forms.TextBox();
			this.label5 = new System.Windows.Forms.Label();
			this.txtciltno = new System.Windows.Forms.TextBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.cmbcinsiyet = new System.Windows.Forms.ComboBox();
			this.label11 = new System.Windows.Forms.Label();
			this.Secenek2 = new System.Windows.Forms.Button();
			this.label8 = new System.Windows.Forms.Label();
			this.txtdyili = new System.Windows.Forms.TextBox();
			this.label9 = new System.Windows.Forms.Label();
			this.txtanadi = new System.Windows.Forms.TextBox();
			this.label10 = new System.Windows.Forms.Label();
			this.txtbadi = new System.Windows.Forms.TextBox();
			this.label12 = new System.Windows.Forms.Label();
			this.lblsonuc = new System.Windows.Forms.Label();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.SuspendLayout();
			// 
			// label1
			// 
			this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label1.Location = new System.Drawing.Point(16, 16);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(40, 16);
			this.label1.TabIndex = 0;
			this.label1.Text = "İller";
			// 
			// cmbiller
			// 
			this.cmbiller.Location = new System.Drawing.Point(62, 11);
			this.cmbiller.Name = "cmbiller";
			this.cmbiller.Size = new System.Drawing.Size(200, 21);
			this.cmbiller.TabIndex = 1;
			this.cmbiller.Text = "cmbiller";
			this.cmbiller.SelectedIndexChanged += new System.EventHandler(this.cmbiller_SelectedIndexChanged);
			// 
			// cmbilceler
			// 
			this.cmbilceler.Location = new System.Drawing.Point(326, 11);
			this.cmbilceler.Name = "cmbilceler";
			this.cmbilceler.Size = new System.Drawing.Size(200, 21);
			this.cmbilceler.TabIndex = 3;
			this.cmbilceler.Text = "cmbilceler";
			// 
			// label2
			// 
			this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label2.Location = new System.Drawing.Point(278, 16);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(40, 16);
			this.label2.TabIndex = 2;
			this.label2.Text = "İlçeler";
			// 
			// label3
			// 
			this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label3.Location = new System.Drawing.Point(16, 43);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(40, 16);
			this.label3.TabIndex = 4;
			this.label3.Text = "Adı";
			// 
			// txtadi
			// 
			this.txtadi.Location = new System.Drawing.Point(64, 39);
			this.txtadi.Name = "txtadi";
			this.txtadi.Size = new System.Drawing.Size(192, 20);
			this.txtadi.TabIndex = 5;
			this.txtadi.Text = "txtadi";
			// 
			// label4
			// 
			this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label4.Location = new System.Drawing.Point(280, 40);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(40, 16);
			this.label4.TabIndex = 6;
			this.label4.Text = "Soyadı";
			// 
			// txtsadi
			// 
			this.txtsadi.Location = new System.Drawing.Point(328, 37);
			this.txtsadi.Name = "txtsadi";
			this.txtsadi.Size = new System.Drawing.Size(192, 20);
			this.txtsadi.TabIndex = 7;
			this.txtsadi.Text = "txtsadi";
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.secenek1);
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Controls.Add(this.txtbno);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.txtano);
			this.groupBox1.Controls.Add(this.label5);
			this.groupBox1.Controls.Add(this.txtciltno);
			this.groupBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.groupBox1.Location = new System.Drawing.Point(16, 80);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(272, 168);
			this.groupBox1.TabIndex = 8;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "1. Seçenek";
			// 
			// secenek1
			// 
			this.secenek1.Location = new System.Drawing.Point(48, 134);
			this.secenek1.Name = "secenek1";
			this.secenek1.Size = new System.Drawing.Size(152, 24);
			this.secenek1.TabIndex = 15;
			this.secenek1.Text = "TC Kimlik No Sorgula";
			this.secenek1.Click += new System.EventHandler(this.secenek1_Click);
			// 
			// label7
			// 
			this.label7.AutoSize = true;
			this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label7.Location = new System.Drawing.Point(7, 78);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(74, 16);
			this.label7.TabIndex = 13;
			this.label7.Text = "Birey Sıra No";
			// 
			// txtbno
			// 
			this.txtbno.Location = new System.Drawing.Point(85, 76);
			this.txtbno.Name = "txtbno";
			this.txtbno.Size = new System.Drawing.Size(146, 20);
			this.txtbno.TabIndex = 14;
			this.txtbno.Text = "txtbno";
			// 
			// label6
			// 
			this.label6.AutoSize = true;
			this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label6.Location = new System.Drawing.Point(7, 52);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(67, 16);
			this.label6.TabIndex = 11;
			this.label6.Text = "Aile Sıra No";
			// 
			// txtano
			// 
			this.txtano.Location = new System.Drawing.Point(85, 48);
			this.txtano.Name = "txtano";
			this.txtano.Size = new System.Drawing.Size(146, 20);
			this.txtano.TabIndex = 12;
			this.txtano.Text = "txtano";
			// 
			// label5
			// 
			this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label5.Location = new System.Drawing.Point(8, 24);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(40, 16);
			this.label5.TabIndex = 9;
			this.label5.Text = "Cilt No";
			// 
			// txtciltno
			// 
			this.txtciltno.Location = new System.Drawing.Point(85, 20);
			this.txtciltno.Name = "txtciltno";
			this.txtciltno.Size = new System.Drawing.Size(146, 20);
			this.txtciltno.TabIndex = 10;
			this.txtciltno.Text = "txtciltno";
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.cmbcinsiyet);
			this.groupBox2.Controls.Add(this.label11);
			this.groupBox2.Controls.Add(this.Secenek2);
			this.groupBox2.Controls.Add(this.label8);
			this.groupBox2.Controls.Add(this.txtdyili);
			this.groupBox2.Controls.Add(this.label9);
			this.groupBox2.Controls.Add(this.txtanadi);
			this.groupBox2.Controls.Add(this.label10);
			this.groupBox2.Controls.Add(this.txtbadi);
			this.groupBox2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.groupBox2.Location = new System.Drawing.Point(320, 80);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(272, 168);
			this.groupBox2.TabIndex = 9;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "2. Seçenek";
			// 
			// cmbcinsiyet
			// 
			this.cmbcinsiyet.Items.AddRange(new object[] {
															 "",
															 "Erkek",
															 "Kadın"});
			this.cmbcinsiyet.Location = new System.Drawing.Point(84, 101);
			this.cmbcinsiyet.Name = "cmbcinsiyet";
			this.cmbcinsiyet.Size = new System.Drawing.Size(100, 21);
			this.cmbcinsiyet.TabIndex = 17;
			this.cmbcinsiyet.Text = "cmbcinsiyet";
			// 
			// label11
			// 
			this.label11.AutoSize = true;
			this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label11.Location = new System.Drawing.Point(8, 104);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(49, 16);
			this.label11.TabIndex = 16;
			this.label11.Text = "Cinsiyeti";
			// 
			// Secenek2
			// 
			this.Secenek2.Location = new System.Drawing.Point(48, 134);
			this.Secenek2.Name = "Secenek2";
			this.Secenek2.Size = new System.Drawing.Size(152, 24);
			this.Secenek2.TabIndex = 15;
			this.Secenek2.Text = "TC Kimlik No Sorgula";
			this.Secenek2.Click += new System.EventHandler(this.Secenek2_Click);
			// 
			// label8
			// 
			this.label8.AutoSize = true;
			this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label8.Location = new System.Drawing.Point(7, 78);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(61, 16);
			this.label8.TabIndex = 13;
			this.label8.Text = "Doğum Yılı";
			// 
			// txtdyili
			// 
			this.txtdyili.Location = new System.Drawing.Point(85, 76);
			this.txtdyili.Name = "txtdyili";
			this.txtdyili.Size = new System.Drawing.Size(146, 20);
			this.txtdyili.TabIndex = 14;
			this.txtdyili.Text = "txtdyili";
			// 
			// label9
			// 
			this.label9.AutoSize = true;
			this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label9.Location = new System.Drawing.Point(7, 52);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(52, 16);
			this.label9.TabIndex = 11;
			this.label9.Text = "Anne Adı";
			// 
			// txtanadi
			// 
			this.txtanadi.Location = new System.Drawing.Point(85, 48);
			this.txtanadi.Name = "txtanadi";
			this.txtanadi.Size = new System.Drawing.Size(146, 20);
			this.txtanadi.TabIndex = 12;
			this.txtanadi.Text = "txtanadi";
			// 
			// label10
			// 
			this.label10.AutoSize = true;
			this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label10.Location = new System.Drawing.Point(8, 24);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(52, 16);
			this.label10.TabIndex = 9;
			this.label10.Text = "Baba Adı";
			// 
			// txtbadi
			// 
			this.txtbadi.Location = new System.Drawing.Point(85, 20);
			this.txtbadi.Name = "txtbadi";
			this.txtbadi.Size = new System.Drawing.Size(146, 20);
			this.txtbadi.TabIndex = 10;
			this.txtbadi.Text = "txtbadi";
			// 
			// label12
			// 
			this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.label12.ForeColor = System.Drawing.Color.Black;
			this.label12.Location = new System.Drawing.Point(56, 264);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(56, 16);
			this.label12.TabIndex = 10;
			this.label12.Text = "SONUÇ";
			// 
			// lblsonuc
			// 
			this.lblsonuc.AutoSize = true;
			this.lblsonuc.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(162)));
			this.lblsonuc.ForeColor = System.Drawing.Color.Red;
			this.lblsonuc.Location = new System.Drawing.Point(128, 264);
			this.lblsonuc.Name = "lblsonuc";
			this.lblsonuc.Size = new System.Drawing.Size(58, 19);
			this.lblsonuc.TabIndex = 11;
			this.lblsonuc.Text = "lblsonuc";
			// 
			// Form1
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
			this.ClientSize = new System.Drawing.Size(624, 294);
			this.Controls.Add(this.lblsonuc);
			this.Controls.Add(this.label12);
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.txtsadi);
			this.Controls.Add(this.label4);
			this.Controls.Add(this.txtadi);
			this.Controls.Add(this.label3);
			this.Controls.Add(this.cmbilceler);
			this.Controls.Add(this.label2);
			this.Controls.Add(this.cmbiller);
			this.Controls.Add(this.label1);
			this.Name = "Form1";
			this.Text = "Kimlik No Sorgulama";
			this.Activated += new System.EventHandler(this.Form1_Activated);
			this.groupBox1.ResumeLayout(false);
			this.groupBox2.ResumeLayout(false);
			this.ResumeLayout(false);
		}
		#endregion
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main() 
		{
			Application.Run(new Form1());
		}
		
		private void Form1_Activated(object sender, System.EventArgs e)
		{
			servis=new KPSPublicWebService();
			iller=servis.IlListesiGetir();
			for(int i=0;i<iller.Length;i++)
				cmbiller.Items.Add(iller[i].Ad);
			//		}
	
		}
			private void cmbiller_SelectedIndexChanged(object sender, System.EventArgs e)
			{
				cmbilceler.Items.Clear();
				ilceler=servis.IleBagliIlceListesiGetir(iller[cmbiller.SelectedIndex].Kod);
				for(int i=0;i<ilceler.Length;i++)
					cmbilceler.Items.Add(ilceler[i].Ad);
			}
		private void secenek1_Click(object sender, System.EventArgs e)
		{
			try
			{
				KayitYerindenKimlikBilgisi bilgi=new KayitYerindenKimlikBilgisi();
				bilgi.AileSiraNo=int.Parse(txtano.Text);
				bilgi.BireySiraNo=int.Parse(txtbno.Text);
				bilgi.CiltKod=int.Parse(txtciltno.Text);
				bilgi.IlceKod=ilceler[cmbilceler.SelectedIndex].Kod;
				KimlikBilgisi sonuc=servis.KayitYerindenKimlikBilgisiSorgula(bilgi,txtadi.Text,txtsadi.Text);
				lblsonuc.Text=sonuc.TCKimlikNo.ToString();
			}
			catch(Exception hata)
			{
				MessageBox.Show(hata.Message);
			}
		}
		private void Secenek2_Click(object sender, System.EventArgs e)
		{
			try
			{
				TemelBilgilerdenKimlikBilgisi bilgi=new TemelBilgilerdenKimlikBilgisi();
				bilgi.Ad=txtadi.Text;
				bilgi.Soyad=txtsadi.Text;
				bilgi.AnaAd=txtanadi.Text;
				bilgi.BabaAd=txtbadi.Text;
				bilgi.DogumYil=int.Parse(txtdyili.Text);
				bilgi.IlceKod=ilceler[cmbilceler.SelectedIndex].Kod;
				if(cmbcinsiyet.Text=="Erkek")
					bilgi.Cinsiyet=CinsiyetTipi.Erkek;
				if(cmbcinsiyet.Text=="Kadın")
					bilgi.Cinsiyet=CinsiyetTipi.Kadin;
				KimlikBilgisi sonuc=servis.KisiBilgisindenKimlikBilgisiSorgula(bilgi);
				lblsonuc.Text=sonuc.TCKimlikNo.ToString();
			}
			catch(Exception hata)
			{
				MessageBox.Show(hata.Message);
			}
		}
	}
}