public ActionResult ProductOperation(int id) { RestoranContext context = new RestoranContext(); var model = context.Operation.Where(o => o.ProductId == id).ToList(); return(View("ProductOperation", model)); }
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()); }
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()); }
public RecipeRepository(RestoranContext context) { this.context = context; }
public ProductController() { context = new RestoranContext(); }
public StoController(RestoranContext context) { _context = context; }
public ReasonRepository(RestoranContext context) { this.context = context; }
public DrzavaController(RestoranContext context) { _context = context; }
public SupplierController() { context = new RestoranContext(); }
public SpisakzanarudzbuController(RestoranContext context) { _context = context; }
public OrderRepository(RestoranContext context) { this.context = context; }
public LocationRepository(RestoranContext context) { this.context = context; }
public SupplierRepository(RestoranContext context) { this.context = context; }
public MeniController(RestoranContext context) { _context = context; }
public UnitRepository(RestoranContext context) { this.context = context; }
public NarudzbaController(RestoranContext context) { _context = context; }
public UnitController() { context = new RestoranContext(); }
public RezervacijaController(RestoranContext context) { _context = context; }
public ProducCategoryController() { this.context = new RestoranContext(); }
public LocationController() { context = new RestoranContext(); }
public GradController(RestoranContext context) { _context = context; }
public TipmenijaController(RestoranContext context) { _context = context; }
public RestoranController(RestoranContext context) { Context = context; }
public OrderController() { context = new RestoranContext(); }
public MarketRepository(RestoranContext context) { this.context = context; }
public RecipeController() { context = new RestoranContext(); }
public ZaposleniController(RestoranContext context) { _context = context; }