public void Goin()
 {
     nextStep = null;
     MS2.Open();
     timeTag = CD.timeTag.getTag();
     BackExit.LetNextClickToMain();
     CD.business1.setBusinessValue(this);
     checkTP.start();
 }
Ejemplo n.º 2
0
 //开始并显示
 public void start()
 {
     nowTime   = maxTime;
     time.Text = nowTime.ToString("D3") + "s";
     timeTP.start();
     Visibility = Visibility.Visible;
 }
Ejemplo n.º 3
0
 public static void showLoading()
 {
     if (tw == null)
     {
         return;
     }
     if (showTP == null)
     {
         showTP = new ThreadProperty(50, true, false, showLoading_, tw);
     }
     showTP.start();
 }
Ejemplo n.º 4
0
 public static void stopLoading()
 {
     if (tw == null)
     {
         return;
     }
     if (stopTP == null)
     {
         stopTP = new ThreadProperty(50, true, false, hidenTip, tw);
     }
     stopTP.start();
 }
Ejemplo n.º 5
0
        public static void readCar(Action nextStep, UIElement ui)
        {
            if (photoSavePath2 == null)
            {
                photoSavePath2 = "D:";
                photoSavePath  = "D:\\" + "zp.bmp";
            }

            name      = null;
            persionid = null;
            error     = null;
            startTag  = CD.timeTag.getTag();
            readTime  = 0;
            readCarThread.resetTime(200);
            readCarThread.start();

            if (uiThread == null)
            {
                uiThread = new ThreadProperty(50, true, false, nextStep, ui);
            }
            uiThread.srcUI  = ui;
            uiThread.action = nextStep;
        }
Ejemplo n.º 6
0
 public void startUpdateThread()
 {
     updateTimeTP.start();
 }
Ejemplo n.º 7
0
        private static void read()
        {
            address    = "";
            nationCode = "";
            //readCarThread.resetTime(2000);
            try
            {
                int    ret = -1;
                string tag = CD.timeTag.getTag();
                //Thread.Sleep(3000);//测试
                name      = null;
                persionid = null;
                if (Config.dic("UseTestPersionalData") == "1")
                {
                    name      = Config.dic("Name");
                    persionid = Config.dic("IDCar");
                    ret       = 0;
                }
                else
                {
                    readTime++;
                    pOutInfo.Clear();
                    Log.AddLog("读身份证", "Ins:" + photoSavePath2);
                    ret = iReadMultiCard(photoSavePath, pOutInfo);
                    Log.AddLog("读身份证", "Out:ret:" + ret + " msg:" + pOutInfo.ToString());
                    //姓名|性别|民族|出生日期|地址|身份证号码|发行机关|有效开始日期|有效截止日期|照片文件存放路径
                    //姓名|性别|民族|出生日期|地址|身份证号码|发行机关|有效开始日期|有效截止日期|照片文件存放路径|
                    //0   |1   |2   |3       |4   |5         |6       |7           |8           |9               |10
                    if (ret == 0)
                    {
                        string[] array = pOutInfo.ToString().Split('|');
                        name      = array[0];
                        persionid = array[5];
                        startDate = array[7];
                        endDate   = array[8];
                        sex       = array[1];
                        if (sex == "男")
                        {
                            sexCode = "1";
                        }
                        else
                        {
                            sexCode = "2";
                        }
                        birthday   = array[3];
                        error      = null;
                        nationCode = GetNationCode(array[2]);
                        address    = array[4];
                    }
                    else if (ret == 1)
                    {
                        //英文名|中文名|性别|国籍或所在区域代码|出生日期|永久居住证号码|有效开始日期|有效截止日期|当次申请受理机关代码|证件版本号|照片文件存放路径
                        //0     |1     |2   |3                 |4       |5             |6           |7           |8                   |9         |10

                        string[] array = pOutInfo.ToString().Split('|');
                        name      = array[1];
                        persionid = array[5];
                        startDate = array[6];
                        endDate   = array[7];
                        sex       = array[2];
                        if (sex == "男")
                        {
                            sexCode = "1";
                        }
                        else
                        {
                            sexCode = "2";
                        }
                        birthday = array[4];
                        error    = null;
                    }
                    else if (ret == 2)
                    {
                        //姓名|性别|出生日期|地址|身份证号码|发行机关|有效开始日期|有效截止日期|通行证号码|签发次数|照片文件存放路径
                        //0   |1   |2       |3   |4         |5       |6           |7           |8         |9       |10
                        string[] array = pOutInfo.ToString().Split('|');
                        name      = array[0];
                        persionid = array[4];
                        startDate = array[6];
                        endDate   = array[7];
                        sex       = array[1];
                        if (sex == "男")
                        {
                            sexCode = "1";
                        }
                        else
                        {
                            sexCode = "2";
                        }
                        birthday = array[2];
                        address  = array[3];
                        error    = null;
                    }
                    if (readTime >= maxReadTime && (ret < 0 || ret > 2))
                    {
                        error = "ret:" + ret + "  msg:" + pOutInfo.ToString();
                    }
                }

                if (tag != CD.timeTag.getTag())
                {
                    Log.AddLog("读身份证", "tag:" + CD.timeTag.getTag() + "   oldTag:" + tag);
                    if (tag == startTag)
                    {
                        readCarThread.stop();
                    }
                    return;
                }
                if (ret == 0 || ret == 1 || ret == 2)
                {
                    base64 = ImgToBase64String(photoSavePath);
                    Log.AddLog("读身份证", "goto next step");
                    readCarThread.stop();
                    uiThread.start();
                }
            }
            catch (Exception e)
            {
                error = e.ToString();
            }
        }