//挂失和获取数据
        async private void handlePersionData(string style)
        {
            updateTitle();
            CD.business1.hidenBackAndExitBtn();
            CD.business1.stop();
            Loading.show1("正在申请制卡数据");
            List <Dictionary <string, string> > zkData = null;
            string error = null;
            await TaskMore.Run(new Action(() =>
            {
                int box = int.Parse(Config.dic("yzkBoxs"));
                int ret = MS2.getLetfCardNum(box, out error);
                if (error == null && ret == 0)
                {
                    error = "预制卡已用完,请联系管理员加卡";
                }
                else if (error == null && ret == -1)
                {
                    error = "料盒状态异常,请联系管理员处理!";
                }
                if (error != null)
                {
                    return;
                }
                zkData = WeiWang.getZKData(ReadIDCar.persionid, ReadIDCar.name, out error);
                if (error != null)
                {
                    error = null;
                    //一人一卡查询 00 返回
                    if (WeiWang.allDsjk(ReadIDCar.persionid, ReadIDCar.name, out error))
                    {
                        ShowTip.show(false, BackExit.Exit, "您已有卡,不能重复制卡");
                        return;
                    }
                    error = null;
                    error = WeiWang.applyDataXinBanKa(style, Config.dic("AreaCode"));
                    //获取制卡数据
                    if (error == null)
                    {
                        zkData = WeiWang.getZKData(ReadIDCar.persionid, ReadIDCar.name, out error);
                    }
                }
            })).ConfigureAwait(true);

            if (error != null)
            {
                ShowTip.show(false, BackExit.Exit, error);
                return;
            }
            check(zkData);
        }
Ejemplo n.º 2
0
        async private void handlePersionData()
        {
            Log(ReadIDCar.pOutInfo.ToString());
            updateTitle();
            CD.business1.hidenBackAndExitBtn();
            CD.business1.stop();
            Loading.show1("正在挂失");
            List <Dictionary <string, string> > zkData = null;
            string error = null;
            await TaskMore.Run(new Action(() =>
            {
                int box = int.Parse(Config.dic("yzkBoxs"));
                int ret = MS2.getLetfCardNum(box, out error);
                if (error == null && ret == 0)
                {
                    error = "预制卡已用完,请联系管理员加卡";
                }
                else if (error == null && ret == -1)
                {
                    error = "料盒状态异常,请联系管理员处理!";
                }
                if (error != null)
                {
                    return;
                }
                MakeJson mj = new MakeJson();
                deviceMsg = Network3.getJson(mj, "deviceLogin");
                error = deviceMsg.error;
                if (error != null)
                {
                    return;
                }
                //获取制卡数据

                if (error == null)
                {
                    zkData = WeiWang.getZKData(ReadIDCar.persionid, ReadIDCar.name, out error);
                }
            })).ConfigureAwait(true);

            if (error != null)
            {
                ShowTip.show(false, BackExit.Exit, error);
                return;
            }
            check(zkData);
        }