示例#1
0
        private void TryAgian(string message, dynamic data)
        {
            double exact = 0;

            if (data != null)
            {
                exact = (
                    0
                    + Double.Parse(data.id_prob.Value) * (data.id.Value == null?0:1)
                    + Double.Parse(data.name_prob.Value) * (data.name.Value == null ? 0 : 1)
                    + Double.Parse(data.dob_prob.Value) * (ExtraFunction.ValidDateTime(data.dob.Value) == false ? 0 : 1)
                    + Double.Parse(data.address_prob.Value) * (data.address.Value == null ? 0 : 1)
                    ) / 4;
            }

            //object a = JsonConvert.DeserializeObject<object>((string)param);

            MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show($"{message} \n Exactly :{exact}% (<75% -> Let's retry) \n Do you Try Again?", "Confirmation", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                counter = defaultLife;
                //Window_Loaded(null, null);
                Start();
            }
            else
            {
                _tcs.SetResult(data);
                myCam.Stop();
                this.Close();
            }
        }
示例#2
0
 public void SupportConvert()
 {
     Fullname     = name;
     IdentityCard = id;
     id           = "0";
     if (!ExtraFunction.ValidDateTime(dob))
     {
         dob = "";
     }
 }