예제 #1
0
        public GecmisSiparislerForm(KafeContext kafeVeri)
        {
            db = kafeVeri;
            InitializeComponent();

            dgvSiparisler.DataSource = db.Siparisler.Where(x => x.Durum != SiparisDurum.Aktif).ToList();
        }
예제 #2
0
 public UrunlerForm(KafeContext kafeVeri)
 {
     db = kafeVeri;
     InitializeComponent();
     dgvUrunler.AutoGenerateColumns = false;
     dgvUrunler.DataSource          = new BindingSource(db.Urunler.OrderBy(x => x.UrunAd).ToList(), null);
 }
예제 #3
0
 public SiparisForm(KafeContext kafeVeri, Siparis siparis)
 {
     db           = kafeVeri;
     this.siparis = siparis;
     InitializeComponent();
     dgvSiparisDetaylari.AutoGenerateColumns = false;
     MasaNolariYukle();
     MasaNoGuncelle();
     TutarGuncelle();
     cboUrun.DataSource = db.Urunler.Where(x => !x.StoktaYok).ToList();
     // cboUrun.SelectedItem = null;
     dgvSiparisDetaylari.DataSource = siparis.SiparisDetaylar;
 }
예제 #4
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new KafeContext(serviceProvider
                                                 .GetRequiredService <DbContextOptions <KafeContext> >())) {
                if (context.Users.Any() && context.MenuItems.Any() && context.Tables.Any())
                {
                    return;
                }

                context.Users.AddRange(
                    new User {
                    Name     = "Moch. Aji Laksono",
                    Username = "******",
                    Password = "******"
                }
                    );

                context.MenuItems.AddRange(
                    new MenuItem {
                    Name    = "Cappucino",
                    Picture = "",
                    Price   = 12000
                }
                    );

                context.Tables.AddRange(
                    new Table {
                    Name      = "Meja 1",
                    UseStatus = false
                },
                    new Table {
                    Name      = "Meja 2",
                    UseStatus = false
                }
                    );

                context.SaveChanges();
            }
        }
예제 #5
0
 public TableController(KafeContext context)
 {
     _context = context;
 }
예제 #6
0
 public UserController(KafeContext context)
 {
     _context = context;
 }
예제 #7
0
 public OrderController(KafeContext kafeContext)
 {
     context = kafeContext;
 }
예제 #8
0
 public HomeController(KafeContext kafeContext)
 {
     context = kafeContext;
 }
예제 #9
0
 public MenuController(KafeContext kafeContext)
 {
     context = kafeContext;
 }
예제 #10
0
 public MenuItemController(KafeContext context)
 {
     _context = context;
 }
예제 #11
0
 public ReportController(KafeContext kafeContext)
 {
     context = kafeContext;
 }