Example #1
0
        public ActionResult ProductOperation(int id)
        {
            RestoranContext context = new RestoranContext();
            var             model   = context.Operation.Where(o => o.ProductId == id).ToList();

            return(View("ProductOperation", model));
        }
Example #2
0
        public ActionResult Accept(InvoiceViewModel model)
        {
            var             entity  = new Invoice();
            RestoranContext context = new RestoranContext();

            entity.Date          = model.Date;
            entity.InvoiceNumber = model.InvoiceNumber;
            entity.VATInvoice    = model.VATInvoice;
            entity.SupplierId    = model.SupplierId;
            entity.LocationId    = model.LocationId;
            entity.OrderId       = model.OrderId;
            foreach (var product in model.Products)
            {
                entity.Products.Add(new ProductInvoice
                {
                    ProductId = product.ProductId,
                    Tax       = product.Tax,
                    Price     = product.Price,
                    Value     = product.InvoiceValue
                });
            }
            unitofWork.LocationRep.Get(model.LocationId).Invoices.Add(entity);
            var order = unitofWork.OrderRep.Get(model.OrderId);

            order.Accept     = true;
            order.AcceptDate = DateTime.Now;
            unitofWork.OrderRep.Update(order);
            unitofWork.Save();
            return(View());
        }
        public static List <Body> GetBody(int narudzbaId)
        {
            RestoranContext ctx = new RestoranContext();

            return((ctx.StavkeNarudzbe
                    .Where(x => x.NarudzbaId == narudzbaId)
                    .Select(x => new Body
            {
                NazivProizvoda = x.Proizvod.Naziv,
                Kolicina = x.Kolicina,
                Cijena = x.Proizvod.Cijena,
                Ukupno = x.Narudzba.Racun.Ukupno
            })).ToList());
        }
Example #4
0
 public UnitOfWork(RestoranContext context, IUnitRepository unitRep, IProductRepository productRep, ILocationRepository locationRep, IOrderRepository orderRep, ISupplierRepository supplierRep, IProductCategoryRepository productCategoryRep, IRecipeRepository recipeRep, IMarketRepository marketRep, IProductSupplierRepository prodSup, IReasonRepository reasonRep, IDisposalProductRepository dProductRep, IProductDisposalRepository productDRep)
 {
     this.context       = context;
     UnitRep            = unitRep;
     ProductRep         = productRep;
     LocationRep        = locationRep;
     RecipeRep          = recipeRep;
     OrderRep           = orderRep;
     SupplierRep        = supplierRep;
     ProductCategoryRep = productCategoryRep;
     MarketRep          = marketRep;
     ProdSup            = prodSup;
     ReasonRep          = reasonRep;
     DProductRep        = dProductRep;
     ProductDRep        = productDRep;
 }
        public static List <Header> GetHeader(int racunId)
        {
            RestoranContext ctx = new RestoranContext();

            return((ctx.Narudzbe
                    .Where(x => (x.IsDeleted == false) || (x.RacunId == racunId && x.IsDeleted == false))
                    .Include(x => x.Korisnik)
                    .Include(x => x.Racun)
                    .Select(x => new Header
            {
                Id = x.Id,
                DatumNarudzbe = x.DatumNarudzbe,
                VrijemeNarudzbe = x.VrijemeNarudzbe,
                Ime = x.Korisnik.Ime,
                Prezime = x.Korisnik.Prezime,
                UkupnaCijena = x.UkupnaCijena,
                RacunId = x.RacunId,
            })).ToList());
        }
Example #6
0
 public RecipeRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #7
0
 public ProductController()
 {
     context = new RestoranContext();
 }
Example #8
0
 public StoController(RestoranContext context)
 {
     _context = context;
 }
Example #9
0
 public ReasonRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #10
0
 public DrzavaController(RestoranContext context)
 {
     _context = context;
 }
Example #11
0
 public SupplierController()
 {
     context = new RestoranContext();
 }
Example #12
0
 public SpisakzanarudzbuController(RestoranContext context)
 {
     _context = context;
 }
Example #13
0
 public OrderRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #14
0
 public LocationRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #15
0
 public SupplierRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #16
0
 public MeniController(RestoranContext context)
 {
     _context = context;
 }
Example #17
0
 public UnitRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #18
0
 public NarudzbaController(RestoranContext context)
 {
     _context = context;
 }
Example #19
0
 public UnitController()
 {
     context = new RestoranContext();
 }
Example #20
0
 public RezervacijaController(RestoranContext context)
 {
     _context = context;
 }
 public ProducCategoryController()
 {
     this.context = new RestoranContext();
 }
Example #22
0
 public LocationController()
 {
     context = new RestoranContext();
 }
Example #23
0
 public GradController(RestoranContext context)
 {
     _context = context;
 }
 public TipmenijaController(RestoranContext context)
 {
     _context = context;
 }
Example #25
0
 public RestoranController(RestoranContext context)
 {
     Context = context;
 }
Example #26
0
 public OrderController()
 {
     context = new RestoranContext();
 }
Example #27
0
 public MarketRepository(RestoranContext context)
 {
     this.context = context;
 }
Example #28
0
 public RecipeController()
 {
     context = new RestoranContext();
 }
Example #29
0
 public ZaposleniController(RestoranContext context)
 {
     _context = context;
 }