示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,UMGID,Notes,CreationDate")] LVU lVU)
        {
            if (id != lVU.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    lVU.LastEditDate = DateTime.Now;

                    _context.Update(lVU);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LVUExists(lVU.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UMGID"] = new SelectList(_context.UMGs, "ID", "Name", lVU.UMGID);
            return(View(lVU));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,ShortName,City,Notes,CreationDate")] UMG uMG)
        {
            if (id != uMG.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    uMG.LastEditDate = DateTime.Now;
                    _context.Update(uMG);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UMGExists(uMG.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(uMG));
        }
示例#3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Power,EngineType,EngineName,VCNName,StationNumber,AOTypeID,CreationDate,KSID,Notes")] GPA gPA)
        {
            if (id != gPA.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    gPA.LastEditDate = DateTime.Now;

                    _context.Update(gPA);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!GPAExists(gPA.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }

            ViewData["AOTypeID"] = gPA.AOTypeID;

            ViewData["KSID"] = new SelectList(_context.KSs, "ID", "Name", gPA.KSID);
            return(View(gPA));
        }
示例#4
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,ShortName,ControllerName,AOTableName,CreationDate,Notes")] AOType aOType)
        {
            if (id != aOType.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    aOType.LastEditDate = DateTime.Now;

                    _context.Update(aOType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AOTypeExists(aOType.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(aOType));
        }
示例#5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,PLCID,Manufacturer,Seller,CommisioningDate,AOTypeID,AOID,SAKTypeID,Notes,CreationDate")] SAK sAK)
        {
            if (id != sAK.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    sAK.LastEditDate = DateTime.Now;

                    _context.Update(sAK);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SAKExists(sAK.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AOTypeID"] = new SelectList(_context.AOTypes, "ID", "Name", sAK.AOTypeID);

            ViewData["PLCID"]     = new SelectList(_context.PLCs, "ID", "Name", sAK.PLCID);
            ViewData["SAKTypeID"] = new SelectList(_context.SAKTypes, "ID", "Name", sAK.SAKTypeID);
            return(View(sAK));
        }
示例#6
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Manufacturer,Name,Notes,CreationDate")] PLC pLC)
        {
            if (id != pLC.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    pLC.LastEditDate = DateTime.Now;

                    _context.Update(pLC);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PLCExists(pLC.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(pLC));
        }
示例#7
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,ShortCompShopName,LVUID,AOTypeID,Notes,CreationDate")] KS kS)
        {
            if (id != kS.ID)
            {
                return(NotFound());
            }


            if (ModelState.IsValid)
            {
                try
                {
                    kS.LastEditDate = DateTime.Now;

                    _context.Update(kS);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KSExists(kS.ID))
                    {
                        ModelState.AddModelError(string.Empty, "КС з таким ID вже існує.");
                        return(View());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }

            ViewData["LVUID"] = new SelectList(_context.LVUs, "ID", "Name", kS.LVUID);
            return(View(kS));
        }
示例#8
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,KSID,PipelineID,CreationDate")] KSPipeline kSPipeline)
        {
            if (id != kSPipeline.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    kSPipeline.LastEditDate = DateTime.Now;

                    _context.Update(kSPipeline);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!KSPipelineExists(kSPipeline.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["KSID"]       = new SelectList(_context.KSs, "ID", "Name", kSPipeline.KSID);
            ViewData["PipelineID"] = new SelectList(_context.Pipelines, "ID", "Name", kSPipeline.PipelineID);
            return(View(kSPipeline));
        }