public async Task <IActionResult> Create([Bind("IdMaterial,TypeMaterial")] MaterialTypes materialTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(materialTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(materialTypes));
        }
        public async Task <IActionResult> Create([Bind("IdSupplier,Name,Adress,TelephonNumber")] Suppliers suppliers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(suppliers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(suppliers));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("IdEmployee,Name,Adress,FirmName")] Employees employees)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employees);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employees));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("IdClient,Discount,Telephone,Adress,FirmName,Representative")] Clients clients)
        {
            if (ModelState.IsValid)
            {
                _context.Add(clients);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(clients));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("IdDetail,IdMaterial,Weight,Colour,Diameter,Cost,IdOrder,AmountDetails")] Details details)
        {
            if (ModelState.IsValid)
            {
                _context.Add(details);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdMaterial"] = new SelectList(_context.MaterialTypes, "IdMaterial", "IdMaterial", details.IdMaterial);
            ViewData["IdOrder"]    = new SelectList(_context.Orders, "IdOrder", "IdOrder", details.IdOrder);
            return(View(details));
        }
        public async Task <IActionResult> Create([Bind("IdOrder,IdClient,IdEmployee,DetailsAmount,OrderCost,Discount,AmountOrdersOnDate,Chek")] Orders orders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orders);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdClient"]   = new SelectList(_context.Clients, "IdClient", "IdClient", orders.IdClient);
            ViewData["IdEmployee"] = new SelectList(_context.Employees, "IdEmployee", "IdEmployee", orders.IdEmployee);
            return(View(orders));
        }
        public async Task <IActionResult> Create([Bind("IdInvoice,IdSupplier,IdEmployee,IdMaterial,DeliveryDate,Cost,Weight")] Invoices invoices)
        {
            if (ModelState.IsValid)
            {
                _context.Add(invoices);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdEmployee"] = new SelectList(_context.Employees, "IdEmployee", "IdEmployee", invoices.IdEmployee);
            ViewData["IdMaterial"] = new SelectList(_context.MaterialTypes, "IdMaterial", "IdMaterial", invoices.IdMaterial);
            ViewData["IdSupplier"] = new SelectList(_context.Suppliers, "IdSupplier", "IdSupplier", invoices.IdSupplier);
            return(View(invoices));
        }