public void LogoutTherapist() { PrintToLog("Logout: " + LoggedInTherapist.FirstName + " " + LoggedInTherapist.LastName + " id:" + LoggedInTherapist.Username, LogType.Information); CurrentSettings.SkyBoxColor = DefaultSettings.SkyBoxColor; CurrentSettings.ButtonsColorBlock = DefaultSettings.ButtonsColorBlock; CurrentSettings.ButtonsTextColor = DefaultSettings.ButtonsTextColor; UpdateColors(); QuestFileManager.UpdateTherapistOnFile(LoggedInTherapist, PinchConstants.TherapistsDirectoryPath + LoggedInTherapist.Username); LoggedInTherapist = null; ShowScreen(ScreensIndex.Login); }
public void OnConfirmClicked() { int UserName; try { m_statusText.text = string.Empty; if (m_userNameField.text == string.Empty || m_passwordField.text == string.Empty || m_firstNameField.text == string.Empty || m_lastNameField.text == string.Empty) { m_statusText.text = "Please fill all data"; return; } if (!int.TryParse(m_userNameField.text, out UserName)) { m_statusText.text = "Please enter only numbers on ID field"; return; } if (!m_firstNameField.text.All(char.IsLetter) || !m_lastNameField.text.All(char.IsLetter)) { m_statusText.text = "Please enter only letters on Name fields"; return; } if (!IsValidEmail(m_emailField.text)) { m_statusText.text = "Please enter a valid email address"; return; } if (QuestFileManager.GetTherapistFromFile(FilePath) == null) { m_statusText.text = "Therapist doesn't exists"; return; } Therapist therapist = GetUserFromGui(); m_mainController.LoggedInTherapist.Password = therapist.Password; m_mainController.LoggedInTherapist.FirstName = therapist.FirstName; m_mainController.LoggedInTherapist.LastName = therapist.LastName; m_mainController.LoggedInTherapist.Email = therapist.Email; QuestFileManager.UpdateTherapistOnFile(m_mainController.LoggedInTherapist, FilePath); m_mainController.ShowPopup(MessageController.MessageType.Succsess, "Therapist details has been updated!", OnPopupAnswer); PrintToLog("Therapist's details update: " + m_mainController.LoggedInTherapist.FirstName + " " + m_mainController.LoggedInTherapist.LastName + ", id: " + m_mainController.LoggedInTherapist.Username + ".", MainController.LogType.Information); } catch (Exception e) { PrintToLog(e.ToString(), MainController.LogType.Error); } }
public void LogoutTherapist() { try { PrintToLog("Therapist logout: " + LoggedInTherapist.FirstName + " " + LoggedInTherapist.LastName + ", id: " + LoggedInTherapist.Username + ".", LogType.Information); CurrentSettings.SkyBoxColor = DefaultSettings.SkyBoxColor; CurrentSettings.ButtonsColorBlock = DefaultSettings.ButtonsColorBlock; CurrentSettings.ButtonsTextColor = DefaultSettings.ButtonsTextColor; UpdateColors(); QuestFileManager.UpdateTherapistOnFile(LoggedInTherapist, PinchConstants.TherapistsDirectoryPath + LoggedInTherapist.Username); LoggedInTherapist = null; ShowScreen(ScreensIndex.Login); } catch (Exception e) { PrintToLog(e.ToString(), MainController.LogType.Error); } }