public override void InsertFirst(OtelCalisan value) { Node tmpHead = new Node(); tmpHead.Data = value; if (Head == null) { Head = tmpHead; } else { //En kritik nokta: tmpHead'in next'i eski Head'i göstermeli tmpHead.Next = Head; //Yeni Head artık tmpHead oldu Head = tmpHead; } //Bağlı listedeki eleman sayısı bir arttı Size++; }
private void Kayitbtn_Click(object sender, EventArgs e) { using (var db = new OtelDbcontext()) { if (string.IsNullOrWhiteSpace(TcNotbox.Text) || string.IsNullOrWhiteSpace(Adtbox.Text) || string.IsNullOrWhiteSpace(soyadtbox.Text) || string.IsNullOrWhiteSpace(adrestbox.Text) || string.IsNullOrWhiteSpace(Departmantbox.Text) || string.IsNullOrWhiteSpace(teltbox.Text) || string.IsNullOrWhiteSpace(Pozisyontbox.Text) || string.IsNullOrWhiteSpace(epostotbox.Text)) { MessageBox.Show("You must fill in the all empty fields"); } else { string TC = TcNotbox.Text, ad = Adtbox.Text, soyad = soyadtbox.Text, tel = teltbox.Text, adres = adrestbox.Text; string ePosta = epostotbox.Text, departman = Departmantbox.Text, pozisyon = Pozisyontbox.Text; int per = Convert.ToInt32(personelPuanTbox.Text); var query = new OtelCalisan { TCKimlik = TC, Ad = ad, Soyad = soyad, Telefon = tel, Adres = adres, Eposta = ePosta, Departman = departman, personelpuan = per }; db.OtelCalisans.Add(query); db.SaveChanges(); MessageBox.Show("Insertion successfully!"); } foreach (var item in db.OtelCalisans) { //metroListView2.Items.Add(item.Id.ToString()); } } }
public abstract void InsertFirst(OtelCalisan value);