示例#1
0
        public async Task <IActionResult> Edit(string id, [Bind("place_code,confirm_date,contactor,contactor_detail,id,place_desc,ref_doc,x_log,x_note,x_status")] train_place train_place)
        {
            if (new Guid(id) != train_place.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(train_place);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!train_placeExists(train_place.place_code))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(train_place));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("place_code,confirm_date,contactor,contactor_detail,id,place_desc,ref_doc,x_log,x_note,x_status")] train_place train_place)
        {
            if (ModelState.IsValid)
            {
                _context.Add(train_place);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(train_place));
        }