Exemplo n.º 1
0
        public string EnYukekPersonel(OtelBilgi otel)
        {
            string temp = "";
            int    tmp1 = 0;
            Node   item = Head;

            PersonelBilgi p;

            while (item != null)
            {
                p = (PersonelBilgi)item.Data;
                for (int i = 0; i < otel.PersonelBilgiList.Size; i++)
                {
                    if (p.PersonelPuani > tmp1 && otel.PersonelBilgiList.listPer[i].Ad == p.Ad)
                    {
                        tmp1 = p.PersonelPuani;
                        temp = "";
                        temp = "En Yüksek Puanlı Personel--" + Environment.NewLine + p.Ad + "-" + p.Soyad + "- " + p.PersonelPuani.ToString();
                    }
                }

                item = item.Next;
            }
            return(temp);
        }
        public void XmlOtelListele()
        {
            aramaAgaci = new IkiliAramaAgaci();
            XDocument xDoc        = XDocument.Load(@"C:\Users\ZİŞAN\Documents\GitHub\OtelOtomasyon\OtelBilgi.xml");
            XElement  rootElement = xDoc.Root;

            foreach (XElement otelXml in rootElement.Elements())
            {
                otel = new OtelBilgi();
                //xml den otel bilgilerini çekme
                otel.OtelID       = Convert.ToInt32(otelXml.Attribute("id").Value);
                otel.OtelAdi      = otelXml.Element("OtelAdi").Value;
                otel.Il_Ilce      = otelXml.Element("Il_Ilce").Value;
                otel.Adres        = otelXml.Element("Adres").Value;
                otel.Telefon      = otelXml.Element("Telefon").Value;
                otel.EPosta       = otelXml.Element("EPosta").Value;
                otel.YildizSayisi = Convert.ToInt32(otelXml.Element("YildizSayisi").Value);
                otel.OdaSayisi    = Convert.ToInt32(otelXml.Element("OdaSayisi").Value);
                otel.OdaTipi      = otelXml.Element("OdaTipi").Value;
                otel.OtelPuani    = Convert.ToInt32(otelXml.Element("OtelPuani").Value);

                XmlPersonelListele(otel.OtelID, otel);//Şu andaki otelin otel ID si yollanır
                aramaAgaci.OtelEkle(otel);
                hashMap.Add(otel.Il_Ilce, otel);
            }
        }
Exemplo n.º 3
0
 public void OtelBilgiGuncelle(Heap h, OtelBilgi otel)
 {
     //for (int i = 0; i < h.currentSize; i++)
     //{
     //    if (h.heapArray[i].otel. == ogr.ogrenciNo)
     //        h.heapArray[i].ogr = ogr;
     //}
 }
 public void OtelBilgiGuncelle(Heap h, OtelBilgi otel)
 {
     for (int i = 0; i < h.currentSize; i++)
     {
         if (h.heapArrayPuan[i].otel.OtelID == otel.OtelID)
         {
             h.heapArrayPuan[i].otel = otel;
         }
     }
 }
        public bool InsertOtel(OtelBilgi o)
        {
            if (currentSize == maxSize)
            {
                return(false);
            }
            HeapDugumu newHeapDugumu = new HeapDugumu(o);

            heapArrayPuan[currentSize] = newHeapDugumu;
            MoveToUpPuan(currentSize++);
            return(true);
        }
        //TC ye göre aranan personele puan ekleme
        private void PersonelPuanEkle(OtelBilgi o)
        {
            foreach (PersonelBilgi p in ListPer)
            {
                if (p.TC == int.Parse(txt_puanlaTC.Text))
                {
                    p.PersonelPuani = int.Parse(cmbBox_perPuan.SelectedItem.ToString());

                    o.PersonelBilgiList.Find(p.TC).Data = p;
                    aramaAgaci.OtelBilgiGuncelle(o);
                    break;
                }
            }
        }
Exemplo n.º 7
0
        private void ZiyaretAdvanced(IkiliAramaAgaciDugumu dugum, OtelBilgi otel)
        {
            if (dugum == null)
            {
                return;
            }

            if (dugum.veri.YildizSayisi == otel.YildizSayisi)
            {
                advancedTemp += "Otel Adı:" + dugum.veri.OtelAdi + Environment.NewLine;
            }

            ZiyaretAdvanced(dugum.sol, otel);
            ZiyaretAdvanced(dugum.sag, otel);
        }
Exemplo n.º 8
0
        public void Add(string key, OtelBilgi value)
        {
            int hash = hashFonksiyonu(key, 10);

            if (table[hash] == null)
            {
                table[hash] = new HashEntry(key);
                //table[hash].h = new Heap(100);
                //table[hash].h.Insert(value);
            }
            else
            {
                // table[hash].h.Insert(value);
            }
        }
Exemplo n.º 9
0
 private IkiliAramaAgaciDugumu OtelPersonelEkle(IkiliAramaAgaciDugumu dugum, OtelBilgi otel)
 {
     if ((int)dugum.veri.OtelID == otel.OtelID)
     {
         dugum.veri.PersonelBilgiList.InsertLast(otel.personelBilgi);
         return(dugum);
     }
     else if ((int)dugum.veri.OtelID > otel.OtelID)
     {
         return(OtelBilgiGuncelle(dugum.sol, otel));
     }
     else
     {
         return(OtelBilgiGuncelle(dugum.sag, otel));
     }
 }
Exemplo n.º 10
0
 private IkiliAramaAgaciDugumu OtelBilgiGuncelle(IkiliAramaAgaciDugumu dugum, OtelBilgi otel)
 {
     if ((int)dugum.veri.OtelID == otel.OtelID)
     {
         dugum.veri = otel;
         return(dugum);
     }
     else if ((int)dugum.veri.OtelID > otel.OtelID)
     {
         return(OtelBilgiGuncelle(dugum.sol, otel));
     }
     else
     {
         return(OtelBilgiGuncelle(dugum.sag, otel));
     }
 }
Exemplo n.º 11
0
        private void ziyaretpersonel(IkiliAramaAgaciDugumu dugum, OtelBilgi _o)
        {
            if (dugum.veri == null)
            {
                return;
            }
            string Personel = dugum.veri.PersonelBilgiList.EnYukekPersonel(_o);

            if (Personel != "")
            {
                tempPersonel += dugum.veri.personelBilgi.Ad + "-" + dugum.veri.personelBilgi.Soyad + Environment.NewLine;
            }



            ziyaretpersonel(dugum.sol, _o);
            ziyaretpersonel(dugum.sag, _o);
        }
        private void btn_OtelKaydet_Click(object sender, EventArgs e)
        {
            OtelBilgi otel = new OtelBilgi();

            otel.OtelID       = otelId++;
            otel.OtelAdi      = txt_otelAdi.Text;
            otel.Il_Ilce      = cmbBox_ililceOtel.Text;
            otel.Adres        = txt_otelAdres.Text;
            otel.EPosta       = txt_OtelPosta.Text;
            otel.OdaSayisi    = Convert.ToInt32(txt_OtelOdaSayisi.Text);
            otel.Telefon      = txt_OtelTelefon.Text;
            otel.YildizSayisi = Convert.ToInt32(txt_OtelYildiz.Text);
            otel.OdaTipi      = txt_OtelOdaTipi.Text;

            hashMap.Add(otel.Il_Ilce, otel); //
            aramaAgaci.OtelEkle(otel);       //
            MessageBox.Show("Kayıt Başarılı Bir Şekilde Eklendi");
        }
        public HeapDugumu ElemanSil(OtelBilgi otel)
        {
            int indis = 0;

            for (int i = 0; i < heapArrayPuan.Length; i++)
            {
                if (heapArrayPuan[i].otel.OtelID == otel.OtelID)
                {
                    indis = i;
                    break;
                }
            }
            HeapDugumu root = heapArrayPuan[indis];

            heapArrayPuan[indis] = heapArrayPuan[--currentSize];
            MoveToDownPuan(indis);
            return(root);
        }
        private void PersonelBilgiGuncelle(OtelBilgi o)
        {
            foreach (PersonelBilgi p in ListPer)
            {
                if (p.TC == int.Parse(txt_gPerTc.Text))
                {
                    p.Ad            = txt_gPerAd.Text;
                    p.Soyad         = txt_gPerSoyad.Text;
                    p.Adres         = txt_gPerAdres.Text;
                    p.Telefon       = txt_gPerTelefon.Text;
                    p.EPosta        = txt_gPerPosta.Text;
                    p.Departman     = txt_gPerDepartman.Text;
                    p.Pozisyon      = txt_gPerPozisyon.Text;
                    p.PersonelPuani = Convert.ToInt32(txt_gPerPuan.Text);

                    o.PersonelBilgiList.Find(p.TC).Data = p;
                    aramaAgaci.OtelBilgiGuncelle(o);
                    break;
                }
            }
        }
        public void Add(string key, OtelBilgi value)
        {
            int hash = hashFonksiyonu(key, 10);
            int a    = hash;


            if (tablo[hash] == null)
            {
                tablo[hash]   = new HashEntry(key, value);
                tablo[hash].h = new Heap(100);
                tablo[hash].h.InsertOtel(value);
            }
            else
            {
                while (tablo[hash] != null)
                {
                    hash = (hash + 1) % tabloBoyutu;
                }
                tablo[a].h.InsertOtel(value);
            }
        }
Exemplo n.º 16
0
        public void OtelEkle(OtelBilgi deger)
        {
            IkiliAramaAgaciDugumu tempParent = new IkiliAramaAgaciDugumu();

            IkiliAramaAgaciDugumu tempSearch = kok;

            while (tempSearch != null)
            {
                tempParent = tempSearch;

                if (deger.OtelID == tempSearch.veri.OtelID)
                {
                    return;
                }
                else if (deger.OtelID < tempSearch.veri.OtelID)
                {
                    tempSearch = tempSearch.sol;
                }
                else
                {
                    tempSearch = tempSearch.sag;
                }
            }
            IkiliAramaAgaciDugumu eklenecek = new IkiliAramaAgaciDugumu(deger);

            if (kok == null)
            {
                kok = eklenecek;
            }
            else if (deger.OtelID < tempParent.veri.OtelID)
            {
                tempParent.sol = eklenecek;
            }
            else
            {
                tempParent.sag = eklenecek;
            }
        }
        //yukarıda çekmiş olduğumuz otelin personel biliglerini xml den alıyoruz
        public void XmlPersonelListele(int OtelID, OtelBilgi _o)
        {
            XDocument xDoc        = XDocument.Load(@"C:\Users\ZİŞAN\Documents\GitHub\OtelOtomasyon\PersonelBilgi.xml");
            XElement  rootElement = xDoc.Root;

            foreach (XElement perXml in rootElement.Elements())
            {
                if (int.Parse(perXml.Element("OtelId").Value) == OtelID)
                {
                    otel.personelBilgi               = new PersonelBilgi();
                    otel.personelBilgi.TC            = Convert.ToInt32(perXml.Attribute("id").Value);
                    otel.personelBilgi.Ad            = perXml.Element("Ad").Value;
                    otel.personelBilgi.Soyad         = perXml.Element("Soyad").Value;
                    otel.personelBilgi.Adres         = perXml.Element("Adres").Value;
                    otel.personelBilgi.Telefon       = perXml.Element("Telefon").Value;
                    otel.personelBilgi.EPosta        = perXml.Element("EPosta").Value;
                    otel.personelBilgi.Departman     = perXml.Element("Departman").Value;
                    otel.personelBilgi.Pozisyon      = perXml.Element("Pozisyon").Value;
                    otel.personelBilgi.PersonelPuani = Convert.ToInt32(perXml.Element("PersonelPuani").Value);

                    _o.PersonelBilgiList.InsertLast(otel.personelBilgi);//otelin içine eleman kaydedilir
                }
            }
        }
 public HeapDugumu(OtelBilgi o)
 {
     this.otel = o;
 }
Exemplo n.º 19
0
 public void PreOrderAdvanced(OtelBilgi otel)
 {
     ZiyaretAdvanced(kok, otel);
 }
 public IkiliAramaAgaciDugumu(OtelBilgi otl)
 {
     this.veri = otl;
     sol       = null;
     sag       = null;
 }
Exemplo n.º 21
0
 public IkiliAramaAgaciDugumu OtelBilgiGuncelle(OtelBilgi otel)
 {
     return(OtelBilgiGuncelle(kok, otel));
 }
Exemplo n.º 22
0
 public IkiliAramaAgaciDugumu OtelPersonelEkle(OtelBilgi otel)
 {
     return(OtelPersonelEkle(kok, otel));
 }
 public HashEntry(string anahtar, OtelBilgi deger)
 {
     this.anahtar = anahtar;
     this.Deger   = deger;
 }
Exemplo n.º 24
0
 public void preOrderMaxPersonel(OtelBilgi o)
 {
     ziyaretpersonel(kok, o);
 }