Пример #1
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Process Process)
        {
            if (ModelState.IsValid)
            {
                _context.Add(Process);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(Process));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Unit")] Method methodHeader)
        {
            if (ModelState.IsValid)
            {
                _context.Add(methodHeader);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(methodHeader));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,CompartmentId")] SubCompartment subCompartment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(subCompartment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompartmentId"] = new SelectList(_context.Compartments, "Id", "Name", subCompartment.CompartmentId);
            return(View(subCompartment));
        }
        public async Task <IActionResult> Create([Bind("Id,MethodId,ElementaryFlowId,Factor")] CharacterisationFactor methodFactors)
        {
            if (ModelState.IsValid)
            {
                _context.Add(methodFactors);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ElementaryFlowId"] = new SelectList(_context.ElementaryFlows, "Id", "Name", methodFactors.ElementaryFlowId);
            ViewData["MethodId"]         = new SelectList(_context.Set <Method>(), "Id", "Name", methodFactors.MethodId);
            return(View(methodFactors));
        }
        public async Task <IActionResult> Create([Bind("Id,ProcessId,ElementaryFlowId,Value")] ProcessExchanges processExchanges)
        {
            if (ModelState.IsValid)
            {
                _context.Add(processExchanges);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ElementaryFlowId"] = new SelectList(_context.ElementaryFlows, "Id", "Name", processExchanges.ElementaryFlowId);
            ViewData["ProcessId"]        = new SelectList(_context.Processes, "Id", "Name", processExchanges.ProcessId);
            return(View(processExchanges));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,CompartmentId,SubCompartmentId,UnitId")] ElementaryFlow elementaryFlow)
        {
            if (ModelState.IsValid)
            {
                _context.Add(elementaryFlow);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompartmentId"]    = new SelectList(_context.Compartments, "Id", "Name", elementaryFlow.CompartmentId);
            ViewData["SubCompartmentId"] = new SelectList(_context.SubCompartments, "Id", "Name", elementaryFlow.SubCompartmentId);
            ViewData["UnitId"]           = new SelectList(_context.Units, "Id", "Name", elementaryFlow.UnitId);
            return(View(elementaryFlow));
        }