NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp30
{
internal class Program
{
// Personel bilgilerini tutacak liste
static List<(int id, string ad, string soyad, string eposta, string telefon, DateTime doğumtarihi)> personel = new List<(int, string, string, string, string, DateTime)>();

// Personel arama fonksiyonu
static (int id, string ad, string soyad, string eposta, string telefon, DateTime doğumtarihi) personelbul()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("-------Personel Arama-------");
Console.Write("Ad giriniz: ");
Console.ForegroundColor = ConsoleColor.Red;
string ad = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Soyad giriniz: ");
Console.ForegroundColor = ConsoleColor.Red;
string soyad = Console.ReadLine();

var kişi = personel.Find(o => o.ad == ad && o.soyad == soyad); // Ad ve soyad ile arama
return kişi;
}

// Personel bilgilerini gösterme fonksiyonu
static void göster()
{
var kişi = personelbul(); // Personel bulma

if (kişi.id != 0) // Eğer personel bulunduysa
Console.WriteLine($"ID: {kişi.id}, Ad: {kişi.ad}, Soyad: {kişi.soyad}, E-posta: {kişi.eposta}, Telefon: {kişi.telefon}, Doğum Tarihi: {kişi.doğumtarihi.ToShortDateString()}");
else // Eğer personel bulunamadıysa
Console.WriteLine("Bu bilgilere sahip bir personel yok.");
}

// Personel ekleme fonksiyonu
static void ekle()
{
int id = 0;

if (personel.Count == 0)
id = 1; // Eğer listede hiç personel yoksa, ID 1'den başlar
else
id = personel.Max(p => p.id) + 1; // En yüksek ID'yi bul ve bir artır

Console.Clear();
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("-------Yeni Personel Ekle-------");

Console.ForegroundColor = ConsoleColor.Green;
Console.Write("Ad giriniz: ");
string ad = Console.ReadLine();
Console.Write("Soyad giriniz: ");
string soyad = Console.ReadLine();
Console.Write("E-posta giriniz: ");
string eposta = Console.ReadLine();
Console.Write("Telefon giriniz: ");
string telefon = Console.ReadLine();
Console.Write("Doğum Tarihi (yyyy-MM-dd): ");
DateTime doğumTarihi = DateTime.Parse(Console.ReadLine());

// Yeni personeli listeye ekle
personel.Add((id, ad, soyad, eposta, telefon, doğumTarihi));
Console.WriteLine("Personel başarıyla eklendi.");
}

// Personel güncelleme fonksiyonu
static void güncelle()
{
var kişi = personelbul(); // Personel bulma fonksiyonunu çağır

if (kişi.id != 0) // Eğer personel bulunduysa
{
Console.WriteLine("Güncelleme yapmak istediğiniz alanı seçin:");
Console.WriteLine("1- Ad");
Console.WriteLine("2- Soyad");
Console.WriteLine("3- E-posta");
Console.WriteLine("4- Telefon");
Console.WriteLine("5- Doğum Tarihi");

int secim = Convert.ToInt32(Console.ReadLine());

switch (secim)
{
case 1:
Console.Write("Yeni Ad: ");
string yeniAd = Console.ReadLine();
personel[personel.IndexOf(kişi)] = (kişi.id, yeniAd, kişi.soyad, kişi.eposta, kişi.telefon, kişi.doğumtarihi);
break;
case 2:
Console.Write("Yeni Soyad: ");
string yeniSoyad = Console.ReadLine();
personel[personel.IndexOf(kişi)] = (kişi.id, kişi.ad, yeniSoyad, kişi.eposta, kişi.telefon, kişi.doğumtarihi);
break;
case 3:
Console.Write("Yeni E-posta: ");
string yeniEposta = Console.ReadLine();
personel[personel.IndexOf(kişi)] = (kişi.id, kişi.ad, kişi.soyad, yeniEposta, kişi.telefon, kişi.doğumtarihi);
break;
case 4:
Console.Write("Yeni Telefon: ");
string yeniTelefon = Console.ReadLine();
personel[personel.IndexOf(kişi)] = (kişi.id, kişi.ad, kişi.soyad, kişi.eposta, yeniTelefon, kişi.doğumtarihi);
break;
case 5:
Console.Write("Yeni Doğum Tarihi (yyyy-MM-dd): ");
DateTime yeniDogumTarihi = DateTime.Parse(Console.ReadLine());
personel[personel.IndexOf(kişi)] = (kişi.id, kişi.ad, kişi.soyad, kişi.eposta, kişi.telefon, yeniDogumTarihi);
break;
default:
Console.WriteLine("Geçersiz seçim.");
break;
}

Console.WriteLine("Personel başarıyla güncellendi.");
}
else // Personel bulunamadıysa
{
Console.WriteLine("Güncellenecek personel bulunamadı.");
}
}

// Personel silme fonksiyonu
static void sil()
{
var kişi = personelbul(); // Personel bulma fonksiyonunu çağır

if (kişi.id != 0) // Eğer personel bulunduysa
{
personel.Remove(kişi); // Personeli listeden silme
Console.WriteLine("Personel başarıyla silindi.");
}
else // Personel bulunamadıysa
{
Console.WriteLine("Silinecek personel bulunamadı.");
}
}

// Tüm personelleri listeleme fonksiyonu
static void listele()
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.White;
Console.WriteLine("Tüm Personeller:");

if (personel.Count == 0)
{
Console.WriteLine("Hiç personel bulunmamaktadır.");
}
else
{
foreach (var p in personel)
{
Console.WriteLine($"ID: {p.id}, Ad: {p.ad}, Soyad: {p.soyad}, E-posta: {p.eposta}, Telefon: {p.telefon}, Doğum Tarihi: {p.doğumtarihi.ToShortDateString()}");
}
}
}

// Menü gösterme fonksiyonu
static void menugoster()
{
Console.Clear();
Console.WriteLine("_____Galatasaray AŞ. Personel Takip Sistemi_____");
Console.WriteLine("1- Personel Göster");
Console.WriteLine("2- Personel Ekle");
Console.WriteLine("3- Personel Güncelle");
Console.WriteLine("4- Personel Sil");
Console.WriteLine("5- Personel Listele");
Console.WriteLine("6- Çıkış");
}

static void Main(string[] args)
{
int seçim = 0;
while (true)
{
menugoster(); // Menü göster
Console.WriteLine("Bir işlem seçiniz (1-6):");
seçim = Convert.ToInt32(Console.ReadLine());

switch (seçim)
{
case 1:
göster();
break;
case 2:
ekle();
break;
case 3:
güncelle();
break;
case 4:
sil();
break;
case 5:
listele();
break;
case 6:
Console.WriteLine("Çıkılıyor...");
return; // Programdan çıkmak için return
default:
Console.WriteLine("Geçersiz bir seçim yaptınız. Lütfen 1-6 arasında bir sayı girin.");
break;
}

Console.WriteLine("Devam etmek için bir tuşa basınız...");
Console.ReadKey();
}
}
}
}
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.