Example #1
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));
        }
Example #2
0
 public bool HasKey(string path)
 {
     return(
         (CRK != null && CRK.HasKey(path)) ||
         (SAK != null && SAK.HasKey(path))
         );
 }
Example #3
0
 public void Delete(string id)
 {
     if (CUK != null && CUK.HasKey(id))
     {
         WCUK.ZapKey(id);
     }
     if (LMK != null && LMK.HasKey(id))
     {
         WLMK.ZapKey(id);
     }
     if (SAK != null && SAK.HasKey(id))
     {
         WSAK.ZapKey(id);
     }
 }
Example #4
0
 public void ZapKey(string path)
 {
     if (CUK != null && CUK.HasKey(path))
     {
         WCUK.ZapKey(path);
     }
     if (LMK != null && LMK.HasKey(path))
     {
         WLMK.ZapKey(path);
     }
     if (SAK != null && SAK.HasKey(path))
     {
         WSAK.ZapKey(path);
     }
 }
Example #5
0
        public async Task <IActionResult> Create(/*int AOID,*/ [Bind("ID,Name,PLCID,Manufacturer,Seller,CommisioningDate,AOTypeID,AOID,SAKTypeID,Notes")] SAK sAK)
        {
            if (ModelState.IsValid)
            {
                sAK.CreationDate = DateTime.Now;


                _context.Add(sAK);
                await _context.SaveChangesAsync();

                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));
        }
Example #6
0
    public string GetValue(string path, string name)
    {
        if (CRK != null)
        {
            RegKey k = (path != null) ? CRK.Open(path) : CRK;
            if (k != null && k[name] != null)
            {
                return(k[name]);
            }
        }

        if (SAK != null)
        {
            RegKey k = (path != null) ? SAK.Open(path) : SAK;
            if (k != null && k[name] != null)
            {
                return(k[name]);
            }
        }

        return(null);
    }