NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

using System.Collections;

// PROGRAMIN BÜTÜNÜNDE KULLANILAN DEĞİŞKENLER BURDA TANIMLANDI.
#region Değişkenler

int indx = 0;
string urunid;
string urunadett;
bool drm = true;
string siparisonay;
int sonucret;
int i = 0;
string indirim;
double sonucrett;
int indirimlihal;
#endregion

// MÜŞTERİLERİN BİLGİLERİNİN BARINDIRILDIĞI LİSTELER BURDA TANIMLANDI.
#region Müşteriler
List<string> idnumber = new List<string>() { "1", "2", "3", "4", "5" };
List<string> name = new List<string>() { "Hakan", "Aziz", "Talha", "Mücahid", "Can" };
List<string> surname = new List<string>() { "Yıldız", "Salman", "Haksever", "Eren", "Yıldız" };
List<string> phone = new List<string>() { "05526580828", "05342340101", "05326734546", "05526580672", "05362298902" };
List<string> mails = new List<string>() { "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]" };
#endregion

// ÜRÜNLERİN BİLGİLERİNİN BARINDIRILDIĞI LİSTELER BURDA TANIMLANDI.
#region Urunler
List<string> urunad = new List<string>() { "Iphone 13 Pro Max", "Iphone 13 Pro", "Iphone 13", "Iphone 13 Mini" };
List<string> urunfiyat = new List<string>() { "32000", "26000", "22000", "18000" };
List<string> urunadet = new List<string>() { "8", "6", "9", "8" };
#endregion

// SİPARİŞ BİLGİLERİNİN BARINDIRILDIĞI LİSTELER BURDA TANIMLANDI.
#region Siparişler
List<string> Musteriid = new List<string>();
List<string> Urunid = new List<string>();
List<string> Adet = new List<string>();
List<string> Ucret = new List<string>();
#endregion

// EKRANA SİPARİŞLERİ LİSTELEYEN FONKSİYON.
#region Sipariş Listele
void siparislistele()
{
Console.Clear();
Console.WriteLine("--------------------------------------SİPARİŞLER--------------------------------------------------");
try
{
for (int i = 0; i < Musteriid.Count; i++)
{
Console.WriteLine("----------------------------------------------------------------------------------------");
Console.WriteLine("Müşterinin Adı Soyadı:{0} {1} Urun Ad: {2} --- Urun Adet: {3} --- Ucret{4}", name[int.Parse(Musteriid[i])], surname[int.Parse(Musteriid[i])], urunad[int.Parse(Urunid[i])], Adet[i], Ucret[i]);
Console.WriteLine("----------------------------------------------------------------------------------------");
}
}
catch (Exception)
{
Console.WriteLine("Hata yakalandı.");
throw;
}
finally
{
backpanel();
}
}


#endregion

// ÜRÜNLERİ VE STOKLARI EKRANA LİSTELEYEN FONKSİYON.
#region Stoklar
void urunstok()
{
Console.Clear();
Console.WriteLine("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////");
for (int c = 0; c < urunad.Count; c++)
{
Console.WriteLine("Urun adı : {0} tUrun Adet: {1}t Urun Fiyat: {2} için ==> ", urunad[c], urunadet[c], urunfiyat[c]);
}
Console.WriteLine("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////");
backpanel();

}
#endregion

// SİSTEME MÜŞTERİ KAYDEDEN FONKSİYON.
#region Müşteri Ekle
void kayitekle(string tcnu, string ad, string soyad, string tel, string email)
{
idnumber.Add(tcnu);
name.Add(ad);
surname.Add(soyad);
phone.Add(tel);
mails.Add(email);
}
#endregion

// ADMİN PANELİNE YÖNLENDİREN FONKSİYON.
#region Admin Paneli
void adminpanel()
{
Console.WriteLine("Yönetim paneline gitmek için 'PANEL' yaz.");
string admin = Console.ReadLine();
if (admin == "PANEL")
{
Console.WriteLine("------------------------------------------------ADMİN PANELİ------------------------------------------------------------");
Console.WriteLine("1-)Yeni müşteri girişi ve sipariş vermek için 1'i tuşla n2-)Sipariş listelemek için 2'yi tuşla n3-)Stok durumunu öğrenmek için 3'ü tuşlan4-)Müşteri listesini görmek için 4'ü tuşlan5-)Ürün eklemk için 5'i tuşla");
string menu = Console.ReadLine();
Console.WriteLine("----------------------------------------------------------------------------------------------------------------------");
switch (Convert.ToInt32(menu))
{
case 1:
girisekrani();
break;
case 2:
siparislistele();
break;
case 3:
urunstok();
break;
case 4:
musterilistesi();
break;
case 5:
urunekle();
break;

}
}
}
#endregion

// HERHANGİ BİR MODÜLDEN ADMİN PANELİNE DÖNÜŞ FONKSİYONU.
#region RETURN PANEL
void backpanel()
{
while (true)
{
Console.WriteLine("PANELE DÖNMEK İÇİN 'BACK' YAZ");
string kmt = Console.ReadLine();
if (kmt == "BACK")
{
adminpanel();
}
}
}
#endregion

// EKRANA MÜŞTERİLERİ LİSTELEYEN FONKSİYON.
#region Müşteri Listesi
void musterilistesi()
{
Console.Clear();
Console.WriteLine("--------------------------------------MÜŞTERİ LİSTESİ--------------------------------------------------");
for (int a = 0; a < idnumber.Count; a++)
{
Console.WriteLine("----------------------------------------------------------------------------------------");
Console.WriteLine("Adı Soyadı:{0} {1} Telefonu:{2} --- Maili:{3} --- TC Kimlik No:{4}", name[a], surname[a], phone[a], mails[a], idnumber[a]);
Console.WriteLine("----------------------------------------------------------------------------------------");
}
backpanel();

}
#endregion

// TC GİRİŞ EKRANI (SİSTEME KAYITLI KULLANICIYSA OTOMATİK OLARAK SİPARİŞ EKRANINA YÖNLENDİRİLİR EĞER SİSTEME KAYIT DEĞİLSE YENİ MÜŞTERİ KAYDI EKRANINA YÖNLENDİRİR.)
#region LOGIN
void girisekrani()
{
Console.Write("TC GİRİNİZ: ");
string tc = Console.ReadLine();
foreach (string t in idnumber)
{
if (t == tc)
{
Console.WriteLine("Müşteri kayıtlı");
indx = i;
drm = true;
break;
}

else if (t != tc)
{
drm = false;
i++;
}

}
{
if (drm == true)
{
while (true)
{
Console.Clear();
Console.WriteLine("Sayın müşterimiz : {0} {1} ttelefonu: {2}te-mail: {3}", name[indx], surname[indx], phone[indx], mails[indx]);
Console.WriteLine("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////");
for (int c = 0; c < urunad.Count; c++)
{
Console.WriteLine("Urun adı : {0} tUrun Adet: {1}t Urun Fiyat: {2} için ==> " + c.ToString() + " Tuşlayın", urunad[c], urunadet[c], urunfiyat[c]);
}
Console.WriteLine("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////");
Console.WriteLine("Sipariş vermek için ürün kodunu giriniz:");
urunid = Console.ReadLine();
Console.WriteLine("Adet miktarını giriniz:");
urunadett = Console.ReadLine();
Console.WriteLine("İndirim yüzdesini giriniz:");
indirim = Console.ReadLine();
Console.WriteLine("Siparişi onaylamak 'ONAY' yazınız, sil baştan sipariş vermek için 'Enterlayın'");
siparisonay = Console.ReadLine();

if (siparisonay == "ONAY")
{

try
{
Musteriid.Add(indx.ToString());
Urunid.Add(urunid);
Adet.Add(urunadett);
sonucret = int.Parse(urunadett) * int.Parse(urunfiyat[int.Parse(urunid)]);
indirimlihal = sonucret * Convert.ToInt32(indirim) / 100;
sonucrett = sonucret - indirimlihal;
Ucret.Add(sonucrett.ToString());
urunadet[int.Parse(urunid)] = (Convert.ToInt32(urunadet[int.Parse(urunid)]) - int.Parse(urunadett)).ToString();
Console.WriteLine("Siparişiniz başarılı bir şekilde oluşturulmuştur.");
Console.Clear();
siparislistele();
adminpanel();
indx = 0;

}
catch (Exception )
{
Console.WriteLine("Giriş dizesi doğru değil");

}
finally
{
siparislistele();
}


}
}
}
else
{
Console.WriteLine("--------------------------------------");
Console.WriteLine("Böyle bir müşteri bulunamadı..");
Console.WriteLine("Kayıt ekranına yönlendiriliyorsunuz..");
System.Threading.Thread.Sleep(1000);
Console.Clear();
Console.WriteLine("--------------------------------------");
Console.WriteLine("MÜŞTERİ BİLGİLERİNİ DOLDURUNUZ..");
Console.Write("TC NO:");
string tcnum = Console.ReadLine();
Console.Write("AD:");
string add = Console.ReadLine();
Console.Write("SOYAD:");
string soyad = Console.ReadLine();
Console.Write("TELEFON:");
string tel = Console.ReadLine();
Console.Write("MAİL");
string email = Console.ReadLine();
kayitekle(tcnum, add, soyad, tel, email);
Console.WriteLine("Müşteri başarılı bir şekilde eklendi");
System.Threading.Thread.Sleep(1000);

/////////////////////////////////

Console.Clear();

indx = name.Count - 1;
while (true)
{
Console.Clear();
Console.WriteLine("Sayın müşterimiz : {0} {1} ttelefonu: {2}te-mail: {3}", name[name.Count - 1], surname[surname.Count - 1], phone[phone.Count - 1], mails[mails.Count - 1]);
Console.WriteLine("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////");
for (int c = 0; c < urunad.Count; c++)
{
Console.WriteLine("Urun adı : {0} tUrun Adet: {1}t Urun Fiyat: {2} için ==> " + c.ToString() + " Tuşlayın", urunad[c], urunadet[c], urunfiyat[c]);
}

Console.WriteLine("////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////");
Console.WriteLine("Sipariş vermek için ürün kodunu giriniz:");
urunid = Console.ReadLine();
Console.WriteLine("Adet miktarını giriniz:");
urunadett = Console.ReadLine();
Console.WriteLine("İndirim yüzdesini giriniz:");
indirim = Console.ReadLine();
Console.WriteLine("Siparişi onaylamak 'ONAY' yazınız, sil baştan sipariş vermek için 'Enterlayın'");
siparisonay = Console.ReadLine();

if (siparisonay == "ONAY")
{
Musteriid.Add(indx.ToString());
Urunid.Add(urunid);
Adet.Add(urunadett);
sonucret = int.Parse(urunadett) * int.Parse(urunfiyat[int.Parse(urunid)]);
indirimlihal = sonucret * Convert.ToInt32(indirim) / 100;
sonucrett = sonucret - indirimlihal;
Ucret.Add(sonucrett.ToString());
urunadet[int.Parse(urunid)] = (Convert.ToInt32(urunadet[int.Parse(urunid)]) - int.Parse(urunadett)).ToString();
Console.Clear();
siparislistele();
adminpanel();
indx = 0;
break;
}
}



}
}


}
#endregion

// ÜRÜN EKLE FONKSİYONU
#region Ürün Ekle
void urunekle()
{
while (true)
{
Console.Write("Ürün adını giriniz:");
string uname = Console.ReadLine();
Console.Write("Ürün fiyatını giriniz:");
string uprice = Console.ReadLine();
Console.Write("Ürün adet giriniz:");
string uadet = Console.ReadLine();
Console.Write("ÜRÜN EKLEMEYİ ONAYLAMAK 'ONAY' , PANELE DÖNMEK İÇİN 'PNL' yazınız:");
string verificiation = Console.ReadLine();

if (verificiation == "ONAY")
{
urunad.Add(uname);
urunfiyat.Add(uprice);
urunadet.Add(uadet);
Console.WriteLine("Ürün başarılı bir şekilde eklenmiştir.");
backpanel();
break;
}
else if (verificiation == "PNL")
{
adminpanel();
}
else
{
Console.WriteLine("DOĞRU KOMUT YAZDIĞINIZDAN EMİN MİSİNİZ?");
}
}


}
#endregion

// MAIN
#region MAIN CODE
girisekrani();
#endregion
     
 
what is notes.io
 

Notes.io is a web-based application for 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 12 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.