public AntrianDokterForm() { InitializeComponent(); string currentDate = Preferences.Get("currentDate", ""); tgl_regis = DateUtil.ConvertFormatDateTime(currentDate, "dd/MM/yyyy", "MM/dd/yyyy"); antrianServices = new AntrianServices(); App.KodeDokterAntrian = ""; App.DokterNamaAntrian = ""; txtDokter.Text = ""; }
private async void BtnLogin_Clicked(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtNoRM.Text)) { txtNoRM.HasError = true; return; } if (String.IsNullOrEmpty(txtPassword.Text)) { txtPassword.HasError = true; return; } loginServices = new LoginServices(); Pasien pasien = new Pasien(); pasien = await loginServices.GetLoginByNoRmServices(txtNoRM.Text); if (pasien.response == "ok") { string tglLahir = DateUtil.ConvertFormatDateTime(pasien.dtgllahir, "dd/MM/yyyy", "ddMMyyyy"); if ((tglLahir == txtPassword.Text) && (pasien.NoRM == txtNoRM.Text)) { App.IsUserLoggedIn = true; Preferences.Set("noRM", pasien.NoRM); Preferences.Set("namaPasien", pasien.NamaPasien); Preferences.Set("tglLahir", pasien.dtgllahir); Preferences.Set("alamat", pasien.alamat); if (_source == "Registration") { Navigation.InsertPageBefore(new RegistrationForm(), this); } else { Navigation.InsertPageBefore(new RegistrationHistoryForm(), this); } await Navigation.PopAsync(); } else { App.IsUserLoggedIn = false; await PopupNavigation.Instance.PushAsync(new DialogAlertCustom("Gagal Login", "Password Tidak Sesuai")); } } else { await PopupNavigation.Instance.PushAsync(new DialogAlertCustom("Gagal Login", pasien.deskripsiresponse)); } }