Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID5,ServiceOrder5,SID5,TQ5,AO5,Name5,TglOrderItenos5,Alamat5,KomenItenos5,Pic5,AreaCode5,Metro5,Dat5,Gpon5,SN5,Vlan5,TglPerintahSurvei5,TglHasilSurvei5,TaggingPelanggan5,TeknisiSurvei5,TaggingODP5,TglPerintahPT15,TglSelesaiPTmin15,TeknisiPTmin15,TglPerintahJT5,TglJTSelesai5,Komen5,TglClosed5,Status5")] CCAN cCAN)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cCAN);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(cCAN));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID5,ServiceOrder5,SID5,TQ5,AO5,Name5,TglOrderItenos5,Alamat5,KomenItenos5,Pic5,AreaCode5,Metro5,Dat5,Gpon5,SN5,Vlan5,TglPerintahSurvei5,TglHasilSurvei5,TaggingPelanggan5,TeknisiSurvei5,TaggingODP5,TglPerintahPT15,TglSelesaiPTmin15,TeknisiPTmin15,TglPerintahJT5,TglJTSelesai5,Komen5,TglClosed5,Status5")] CCAN cCAN)
        {
            try
            {
                if (id != cCAN.ID5)
                {
                    return(NotFound());
                }

                if (ModelState.IsValid)
                {
                    try
                    {
                        _context.Update(cCAN);
                        await _context.SaveChangesAsync();
                    }
                    catch (DbUpdateConcurrencyException)
                    {
                        if (!CCANExists(cCAN.ID5))
                        {
                            return(NotFound());
                        }
                        else
                        {
                            throw;
                        }
                    }
                    return(RedirectToAction("Index"));
                }
            }
            catch (DbUpdateException /* ex */)
            {
                //Log the error (uncomment ex variable name and write a log.
                ModelState.AddModelError("", "Unable to save changes. " +
                                         "Try again, and if the problem persists " +
                                         "see your system administrator.");
            }
            return(View(cCAN));
        }