Beispiel #1
0
        protected void textdegis(object sender, KeyEventArgs e)
        {
            var kopya = (TextBox)sender;

            if (e.KeyCode == Keys.Escape)
            {
                foreach (TextBox tx in this.Controls)
                {
                    globalnesne = null;
                    tx.Dispose();
                }
                for (int i = 0; i < this.Items.Count; i++)
                {
                    this.EnableItem(i);
                }
            }
            if (e.KeyCode == Keys.Enter)
            {
                this.Items.RemoveAt(Convert.ToInt16(kopya.Name));

                foreach (TextBox tx in this.Controls)
                {
                    globalnesne.isim = tx.Text;
                    this.Items.Insert(Convert.ToInt16(kopya.Name), globalnesne);
                    Program.Anaform.adguncelle(globalnesne);
                    globalnesne = null;
                    tx.Dispose();
                }
                for (int i = 0; i < this.Items.Count; i++)
                {
                    this.EnableItem(i);
                }
            }
        }
Beispiel #2
0
        public Nesne Listele()
        {
            // KOD sınıfında bulunan nesne getir methodu ile nesne alınıyor.
            // Bu nesnenin içerisinde ev listesi bulunmaktadır.
            Nesne nesne = KOD_SINIFI.Nesne_getir();

            return(nesne);
        }
Beispiel #3
0
        public string Kontrol()
        {
            Nesne  nesne         = KOD_SINIFI.Nesne_getir();
            string json_data     = JsonConvert.SerializeObject(nesne);
            string md5_json_data = KOD_SINIFI.MD5Sifrele(json_data);

            return(md5_json_data);
        }
Beispiel #4
0
        //
        // GET: /Sorgu/

        // EKRANDAKİ TABLOLARIN LİSTELENMESİNİ SAĞLAYAN SAYFA
        public ActionResult Index()
        {
            Nesne verilerim = KOD_SINIFI.Nesne_getir();

            ViewData["ev_listesi"] = verilerim.ev_listesi;

            Resim_Tipi[] veritabanindaki_resimler = KOD_SINIFI.Veritabanindaki_Butun_Resimleri_Bul();
            ViewData["resim_listesi"] = veritabanindaki_resimler;
            return(View());
        }
        // LİSTELE SAYFASININ TEMEL ELEMANI OLAN NESNE'NİN OLUŞTURULUP İSTEYENE GÖNDERİLDİĞİ METHOD
        public static Nesne Nesne_getir()
        {
            Nesne nesne = new Nesne();

            Ev_Tipi[] ev_listesi = Evleri_Bul();

            foreach (Ev_Tipi ev in ev_listesi)
            {
                ev.resimler = Resimleri_Bul(ev.evID);
            }

            nesne.ev_listesi = ev_listesi;

            return(nesne);
        }
        public async Task <bool> UpdateNesneAsync(Nesne nesne)
        {
            try
            {
                var tracking = _databaseContext.Update(nesne);
                await _databaseContext.SaveChangesAsync();

                var isModified = tracking.State == EntityState.Modified;
                return(isModified);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
        public async Task <bool> AddNesneAsync(Nesne nesne)
        {
            try
            {
                var tracking = await _databaseContext.AddAsync <Nesne>(nesne);

                await _databaseContext.SaveChangesAsync();

                var isAdded = tracking.State == EntityState.Added;
                return(isAdded);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
        public async Task <bool> RemoveNesneAsync(Nesne nesne)
        {
            try
            {
                var asd = await _databaseContext.Nesneler.FindAsync(nesne.Id);

                var tracking = _databaseContext.Remove(asd);

                await _databaseContext.SaveChangesAsync();

                var isDeleted = tracking.State == EntityState.Deleted;
                return(isDeleted);
            }
            catch (System.Exception ex)
            {
                return(false);
            }
        }
Beispiel #9
0
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            base.OnDrawItem(e);
            if (DesignMode && Items.Count == 0)
            {
                return;
            }
            if (e.Index != OzelListbox.NoMatches)
            {
                if (Items[e.Index] is Nesne)
                {
                    Nesne a = (Nesne)Items[e.Index];
                    Image itemImage, itemLocked = null;
                    if (a.durum == 'v')
                    {
                        globalnesne = a;
                        TextBox tt = new TextBox();
                        tt.Size     = new Size(e.Bounds.Size.Width - 50, e.Bounds.Size.Height);
                        tt.Location = new Point(e.Bounds.Location.X + 17, e.Bounds.Location.Y);
                        tt.Text     = a.isim;
                        a.durum     = 'a';
                        tt.Name     = e.Index.ToString();
                        tt.KeyDown += new KeyEventHandler(textdegis);
                        for (int i = 0; i < this.Items.Count; i++)
                        {
                            this.DisableItem(i);
                        }
                        this.Controls.Add(tt);
                        tt.Focus();
                    }
                    if (a.is_klasor == 1 && a.acik == false)
                    {
                        itemImage = Properties.Resources.dosya_kapali;
                    }
                    else if (a.is_klasor == 1 && a.acik == true)
                    {
                        itemImage = Properties.Resources.dosya_acik;
                    }
                    else if (a.is_klasor == 0)
                    {
                        itemImage = Properties.Resources.alt_klasor;
                    }
                    else
                    {
                        itemImage = null;
                    }

                    if (a.sifreli == '1')
                    {
                        itemLocked = Properties.Resources.kilitkapali;
                    }
                    else if (a.sifreli == '2')
                    {
                        itemLocked = Properties.Resources.kilitacik;
                    }

                    int gnslk = (Convert.ToInt16(a.katman) - 1) * 10;
                    if (disabledIndices.Contains(e.Index))
                    {
                        e.Graphics.FillRectangle(SystemBrushes.InactiveBorder, e.Bounds);
                        if (!string.IsNullOrEmpty(a.isim))
                        {
                            TextRenderer.DrawText(e.Graphics, a.isim, e.Font, new Rectangle(ItemHeight + gnslk + 2, e.Bounds.Top, e.Bounds.Width - (ItemHeight + 2), ItemHeight), SystemColors.GrayText, TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
                        }
                    }
                    else
                    {
                        if (SelectionMode == System.Windows.Forms.SelectionMode.None)
                        {
                            e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);
                            if (!string.IsNullOrEmpty(a.isim))
                            {
                                TextRenderer.DrawText(e.Graphics, a.isim, e.Font, new Rectangle(ItemHeight + gnslk + 2, e.Bounds.Top, e.Bounds.Width - (ItemHeight + 2), ItemHeight), SystemColors.WindowText, TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
                            }
                        }
                        else
                        {
                            if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
                            {
                                e.Graphics.FillRectangle(SystemBrushes.Highlight, e.Bounds);
                                e.DrawFocusRectangle();
                                if (!string.IsNullOrEmpty(a.isim))
                                {
                                    TextRenderer.DrawText(e.Graphics, a.isim, e.Font, new Rectangle(ItemHeight + gnslk + 2, e.Bounds.Top, e.Bounds.Width - (ItemHeight + 2), ItemHeight), SystemColors.HighlightText, TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
                                }
                            }
                            else
                            {
                                e.Graphics.FillRectangle(SystemBrushes.Window, e.Bounds);
                                if (!string.IsNullOrEmpty(a.isim))
                                {
                                    TextRenderer.DrawText(e.Graphics, a.isim, e.Font, new Rectangle(ItemHeight + gnslk + 2, e.Bounds.Top, e.Bounds.Width - (ItemHeight + 2), ItemHeight), SystemColors.WindowText, TextFormatFlags.VerticalCenter | TextFormatFlags.Left);
                                }
                            }
                        }
                    }
                    if (itemImage != null)
                    {
                        e.Graphics.DrawImage(itemImage, e.Bounds.Left + gnslk, e.Bounds.Top, ItemHeight, ItemHeight);
                    }
                    if (itemLocked != null)
                    {
                        e.Graphics.DrawImage(itemLocked, e.Bounds.Right - itemLocked.Width - 2, e.Bounds.Top, ItemHeight, ItemHeight);
                    }
                }
                else
                {
                    TextRenderer.DrawText(e.Graphics, Items[e.Index].ToString(), e.Font, e.Bounds, e.ForeColor);
                }
            }
        }