//sirket baslangic deger atamasi
        public void SirketADD(string a)
        {
            Sirket s = new Sirket();

            s.Ad     = a;
            s.Adres  = "Izmir";
            s.Eposta = "sss";
            s.Fax    = 123;
            s.Tel    = 123;
            Sirketler.Insert(s);
        }
        public bool Insert(Sirket value)
        {
            if (currentSize == maxSize)
            {
                return(false);
            }
            HeapDugumu newHeapDugumu = new HeapDugumu(value);

            heapArray[currentSize] = newHeapDugumu;
            MoveToUp(currentSize++);
            return(true);
        }
 private void Form1_Load(object sender, EventArgs e)
 {
     this.ClientSize = new System.Drawing.Size(278, 148);
     Sifirla();
     btnGRSKullanici.Visible = true;
     btnGRSSirket.Visible    = true;
     AktifKisi   = new Kisi();
     AktifSirket = new Sirket();
     add1(12);
     add1(10);
     SirketADD("ades");
     SirketADD("ebay");
     MessageBox.Show(Eleman.DugumleriYazdir());
     MessageBox.Show(Sirketler.DisplayHeap());
 }
        public Sirket[] Sort()
        {
            Heap h = new Heap(dizi.Length);

            Sirket[] sorted = new Sirket[dizi.Length];
            foreach (var item in dizi)
            {
                h.Insert(item);
            }
            int i = 0;

            while (!h.IsEmpty())
            {
                sorted[i++] = h.RemoveMax().Deger;
            }
            return(sorted);
        }
        //sirket bilgilerini guncelleme
        private void btnSirketGncelle_Click(object sender, EventArgs e)
        {
            Sirket s = new Sirket();

            Sirketler.RemoveMax();
            s.Ad     = "1" + txtSRKTGNCLad.Text;
            s.Adres  = txtSRKTGNCLadres.Text;
            s.Eposta = txtSRKTGNCLePosta.Text;
            s.Fax    = Convert.ToInt32(txtSRKTGNCLfax.Text);
            s.Tel    = Convert.ToInt32(txtSRKTGNCLtel.Text);

            Sirketler.Insert(s);
            BilgiGoster(2);

            AktifSirket = s;
            MessageBox.Show(Sirketler.DisplayHeap());
        }
        //sirket kaydi yapma
        private void btnSirketKayit_Click(object sender, EventArgs e)
        {
            Sirket s = new Sirket();

            s.Ad        = "1" + txtSRKTKYTAdi.Text;
            s.Adres     = txtSRKTKYTadres.Text;
            s.Eposta    = txtSRKTKYTePosta.Text;
            s.Fax       = Convert.ToInt32(txtSRKTKYTfax.Text);
            s.Tel       = Convert.ToInt32(txtSRKTKYTtel.Text);
            AktifSirket = s;
            Sirketler.Insert(s);
            BilgiGoster(2);
            temizleClick(2);

            Yarat(1);
            MessageBox.Show(Sirketler.DisplayHeap());
        }
        //sirket girisi
        private void btnSgiris_Click(object sender, EventArgs e)
        {
            Sirket k = new Sirket();

            k = Sirketler.Getir(txtSRKTGRSad.Text).Deger;
            if (k != null)
            {
                if (k.Tel == Convert.ToInt32((txtSRKTGRStel.Text)) && (string.Compare(k.Ad, txtSRKTGRSad.Text) == 0))
                {
                    AktifSirket = k;
                    MessageBox.Show("Giris Basarili");
                    BilgiGoster(2);
                    tabControlSirket.Visible       = true;
                    this.tabControlSirket.Location = new System.Drawing.Point(4, 2);
                    this.ClientSize    = new System.Drawing.Size(606, 338);
                    txtSRKTGRStel.Text = txtSRKTGRSad.Text = "";
                    Yarat(1);
                }
                else
                {
                    MessageBox.Show("Hatali giris...");
                }
            }
        }
Ejemplo n.º 8
0
 public HeapDugumu(Sirket deger)
 {
     this.Deger = deger;
 }