示例#1
0
        public async Task <ActionResult <maintable> > Postmaintable(maintable maintable)
        {
            _context.maintable.Add(maintable);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getmaintable", new { id = maintable.midex }, maintable));
        }
示例#2
0
        public async Task <IActionResult> Putmaintable(int id, maintable maintable)
        {
            if (id != maintable.midex)
            {
                return(BadRequest());
            }

            _context.Entry(maintable).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!maintableExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#3
0
        public JsonResult MuseumFirstPageId([FromBody] maintable maintable)
        {
            var Mbase        = "Not found";
            var Mname        = "Not found";
            var searchMuseum = _context.maintable.FirstOrDefault(m => m.midex == maintable.midex);

            if (searchMuseum != null)
            {
                Mname = searchMuseum.mname;
                Mbase = searchMuseum.mbase;
            }
            var returnMesg = new { mname = Mname, mbase = Mbase };

            return(Json(returnMesg));
        }
示例#4
0
        public JsonResult MuseumFirstPageName([FromBody] maintable maintable)
        {
            var searchMuseum = _context.maintable.Where(m => m.mname.Contains(maintable.mname));

            return(Json(new { searchMuseum }));
        }