public async Task <IActionResult> Edit(int id, [Bind("MedID,MedName,MedDescription,MedAddress,Time_at")] Medical_Enterprise medical_Enterprise)
        {
            if (id != medical_Enterprise.MedID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(medical_Enterprise);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Medical_EnterpriseExists(medical_Enterprise.MedID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(medical_Enterprise));
        }
        public async Task <IActionResult> PutMedical_Enterprise([FromRoute] int id, [FromBody] Medical_Enterprise medical_Enterprise)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != medical_Enterprise.MedID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public async Task <IActionResult> Create([Bind("MedID,MedName,MedDescription,MedAddress,Time_at")] Medical_Enterprise medical_Enterprise)
        {
            if (ModelState.IsValid)
            {
                _context.Add(medical_Enterprise);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(medical_Enterprise));
        }
        public async Task <IActionResult> PostMedical_Enterprise([FromBody] Medical_Enterprise medical_Enterprise)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Medical_Enterprise.Add(medical_Enterprise);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetMedical_Enterprise", new { id = medical_Enterprise.MedID }, medical_Enterprise));
        }