示例#1
0
 private void KategoriButtonOlustur()
 {
     foreach (var Kategori in worker.TanimService.Select(c => c.TanimTip == TanimTip.UrunGrup, c => new KategoriDto {
         Id = c.Id, Adi = c.Adi
     }).ToList())
     {
         ControlKategoriButton button = new ControlKategoriButton
         {
             Name       = Kategori.Id.ToString(),
             Text       = Kategori.Adi,
             Id         = Kategori.Id,
             Urunler    = worker.UrunService.GetList(c => c.UrunGrupId == Kategori.Id, c => c.Porsiyonlar, c => c.EkMalzemeler),
             GroupIndex = 1,
             Height     = 60,
             Font       = new Font("Tahoma", 12, FontStyle.Bold),
             Width      = flowKategori.Width - 6
         };
         button.CheckedChanged += KategoriSecim;
         flowKategori.Controls.Add(button);
     }
 }
示例#2
0
        private void KategoriSecim(object sender, EventArgs e)
        {
            flowKategoriUrunleri.Controls.Clear();
            ControlKategoriButton button = (ControlKategoriButton)sender;

            foreach (var item in button.Urunler)
            {
                ControlKategoriUrun urunButton = new ControlKategoriUrun
                {
                    Name         = item.Id.ToString(),
                    UrunAdi      = item.Adi,
                    Id           = item.Id,
                    UrunImage    = item.Fotograf.ByteArrayToImage(),
                    Height       = 160,
                    Width        = 160,
                    Porsiyonlar  = item.Porsiyonlar,
                    EkMalzemeler = item.EkMalzemeler
                };
                urunButton.ButtonClick += UrunClick;
                flowKategoriUrunleri.Controls.Add(urunButton);
            }
        }