public async Task <IActionResult> Edit(int id, [Bind("Id,Token,Name,Sex,BirthDate,Phone,Address,Cities,Height,Weight,Appointments")] PatientsData patientsData)
        {
            if (id != patientsData.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patientsData);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientsDataExists(patientsData.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(patientsData));
        }
        public async Task <IActionResult> Create([Bind("Id,Token,Name,Sex,BirthDate,Phone,Address,Cities,Height,Weight,Appointments")] PatientsData patientsData)
        {
            if (ModelState.IsValid)
            {
                _context.Add(patientsData);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(patientsData));
        }
예제 #3
0
        public PatientsData GetPatientsData(PatientsDataType dataType, string value, string recordTime, string recordData, Patient patient, DateTime createDateTime, PatientsDataFormType formType = PatientsDataFormType.None, Dal.Report report = null)
        {
            PatientsData data = new PatientsData();

            data.DataCode   = (int)dataType;
            data.DataValue  = value;
            data.RecordTime = recordTime;
            data.RecordDate = recordData;
            data.Patient    = patient;
            data.FormType   = (int)formType;
            data.CreateTime = createDateTime;
            if (report != null)
            {
                data.Report = report;
            }
            return(data);
        }