コード例 #1
0
        public async Task UpdatePatient(UpdatePatient patient)
        {
            using (var con = mainConn)
            {
                string query = @"UPDATE [dbo].[Patients]
                                    SET
                                   UserID = IsNull(@UserID, UserID)
                                   ,FirstName = IsNull(@FirstName, FirstName)
                                   ,LastName = IsNull(@LastName, LastName)
                                   ,EmailAddress = IsNull(@EmailAddress, EmailAddress)
                                   ,Gender = IsNull(@Gender, Gender)
                                   ,DateOfBirth = IsNull(@DateOfBirth, DateOfBirth)
                                   ,Address = IsNull(@Address, Address)
                                   ,GroupInsuranceNumber = IsNull(@GroupInsuranceNumber, GroupInsuranceNumber)
                                   ,CellPhone = IsNull(@CellPhone, CellPhone)
                                   ,HomePhone = IsNull(@HomePhone, HomePhone)
                                   ,Picture = IsNull(@Picture, Picture)
                                   ,Insurance = IsNull(@Insurance, Insurance)
                                   WHERE ID = @ID";
                patient.DateOfBirth = Convert.ToDateTime(patient.DateOfBirth);
                await con.QueryAsync(query, patient);

                return;
            }
        }
コード例 #2
0
ファイル: PatientsController.cs プロジェクト: jarekjar/gmapi
        // [Authorize(Roles = Role.Clinician + "," + Role.OfficeAdmin + "," + Role.SuperAdmin)]
        public async Task <ActionResult> UpdatePatient(UpdatePatient patient)
        {
            try
            {
                await _patientRepo.UpdatePatient(patient);

                return(Ok());
            }
            catch (Exception)
            {
                return(StatusCode(500, "Internal Server Error"));
            }
        }
コード例 #3
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            UpdatePatient patient = new UpdatePatient();

            patient.Pid       = Convert.ToInt32(Text7.Value);
            patient.Name      = Text1.Value;
            patient.Surname   = Text2.Value;
            patient.Pesel     = Convert.ToInt32(Text3.Value);
            patient.Birthdate = Convert.ToDateTime(Text6.Value);
            patient.Phone     = Convert.ToInt32(Text5.Value);
            string msg = client.Update(patient);

            labelParseMessage.Text = msg.ToString();
        }
コード例 #4
0
        public ActionResult Update(int id)
        {
            //info about the patient
            Patient       selectedpatient = db.Patients.SqlQuery("select * from patients WHERE id = @id", new SqlParameter("@id", id)).FirstOrDefault();
            List <Wishes> wishes          = db.Wishes.SqlQuery("SELECT * FROM Wishes").ToList();


            UpdatePatient UpdatePatientViewModel = new UpdatePatient();

            UpdatePatientViewModel.Patient = selectedpatient;
            UpdatePatientViewModel.Wishes  = wishes;

            return(View(UpdatePatientViewModel));
        }
コード例 #5
0
        public async Task <IActionResult> PutPatient(UpdatePatient patient)
        {
            var savedPatient = Utils.GetPatient(_caller, _appDbContext);

            savedPatient.Name    = patient.Name;
            savedPatient.Surname = patient.Surname;
            savedPatient.Address = patient.Address;
            savedPatient.Phone   = patient.Phone;

            _appDbContext.Entry(savedPatient).State = EntityState.Modified;

            await _appDbContext.SaveChangesAsync();

            return(NoContent());
        }
コード例 #6
0
        public async Task <bool> UpdateUserAsync(string firstName, string lastName, string phoneNumber, string email, string token)
        {
            UpdatePatient updateModel = new UpdatePatient
            {
                firstName   = firstName,
                lastName    = lastName,
                email       = email,
                phoneNumber = phoneNumber
            };

            client.DefaultRequestHeaders.Clear();
            client.DefaultRequestHeaders.Add("Authorization", "Bearer " + token);
            var         jsonPatient = JsonConvert.SerializeObject(updateModel);
            HttpContent content     = new StringContent(jsonPatient);

            content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("application/json");
            var respons = await client.PutAsync(updatePatient, content);

            return(respons.IsSuccessStatusCode);
        }