using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ForgetPass : MonoBehaviour
{
    public ADokManager adok;

    public InputField txtUserName;
    public Text txtSecurityQuestion;
    public InputField txtAnswer;

    public InputField txtPass;

    public InputField txtPhoneNo;

    public Text txtResult;


    // Use this for initialization
    void Start()
    {
        adok.OnForgetPassAuthChange += Adok_OnForgetPassAuthChange;
        adok.OnSetPassChange += Adok_OnSetPassChange;
        adok.OnGetPassWithPhoneChange += Adok_OnGetPassWithPhoneChange;
    }

    



    // Update is called once per frame
    void Update()
    {

    }

    public void ForgetPassAuth()
    {
        adok.ForgetPassAuth(txtUserName.text, txtAnswer.text);
    }

    public void SetPass()
    {
        adok.SetPass(txtPass.text);
    }

    public void GetPassWithPhone()
    {
        adok.GetPassWithPhone(txtPhoneNo.text);
    }

    public void GetSecurityQuestion()
    {
        txtSecurityQuestion.text = FarsiSaz.MakeMePersian(adok.getSecurityQuestion());
    }

    private void Adok_OnSetPassChange(ADokManager.SetPassResult cmResult)
    {
        txtResult.text = "SetPassResult:" + cmResult.ToString();
    }

    private void Adok_OnForgetPassAuthChange(ADokManager.ForgetPassResult cmResult)
    {
        txtResult.text = "ForgetPassAuthResult:" + cmResult.ToString();
    }

    private void Adok_OnGetPassWithPhoneChange(ADokManager.GetPassWithPhoneResult cmResult)
    {
        txtResult.text = "GetPassWithPhoneResult:" + cmResult.ToString();
    }
}
