async private void WriteCar()
        {
            updateTitle();
            CD.business1.hidenBackAndExitBtn();
            Loading.show1("制卡中,请稍候...");
            string error = null;
            string atr2  = null;

            await TaskMore.Run(new Action(() =>
            {
                //==制卡
                string result = WeiWang.iWrite(out error);
                if (error != null)
                {
                    if (MS2.PutCardToReject() != null)
                    {
                        error += "-卡回收失败";
                    }
                    return;
                }
            })).ConfigureAwait(true);

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

            updateTitle();
            // Autograph.GetObject().Goin(sign);
            putCardOut();
        }
        //挂失和获取数据
        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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        //5.取卡
        async private void PutCardOut()
        {
            string error = null;

            updateTitle();
            Loading.show1("正在启用社保卡,请稍候....");
            await TaskMore.Run(new Action(() =>
            {
                //激活
                error = WeiWang.setStart(ssid);
                MS2.PutCardOut();
            })).ConfigureAwait(true);

            new Task(new Action(() => {
                //打印凭条
                List <string> printDatas = new List <string>();
                printDatas.Add("        肇庆市社会保障卡业务回执单");
                printDatas.Add("业务类型:自助领卡");
                printDatas.Add("交易流水号:" + tellHadGetCard["data"]["transNo"].ToString());
                printDatas.Add("终端名称:" + deviceInfo["data"]["deviceName"].ToString());
                printDatas.Add("终端编号:" + deviceInfo["data"]["deviceId"].ToString());
                printDatas.Add("所属区域:" + deviceInfo["data"]["areaName"].ToString());
                printDatas.Add("所属网点:" + deviceInfo["data"]["branch"].ToString());
                printDatas.Add("网点编号:" + deviceInfo["data"]["orgCode"].ToString());
                printDatas.Add("交易时间:" + System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss"));
                printDatas.Add("交易结果:领卡成功");
                printDatas.Add("卡号:" + CD.hidenBankNum(tellHadGetCard["data"]["yhkh"].ToString()));
                printDatas.Add("领卡人:" + CD.hidenName(tellHadGetCard["data"]["xm"].ToString()));
                Print.print(printDatas);
            })).Start();

            if (error != null)
            {
                ShowTip.show(false, null, error);
            }
            if (ds.Count > 0)
            {
                I_GetSSCar_old.getObject().Goin(goToLingKa);
            }
            else
            {
                CD.business1.showBackAndExitBtn();
                I_GetSSCar_old.getObject().Goin();
            }
            BackExit.LetNextClickToMain();
            CD.business1.showBackAndExitBtn();
        }
Exemplo n.º 5
0
        async private void WriteCar()
        {
            updateTitle();
            CD.business1.hidenBackAndExitBtn();
            Loading.show1("制卡中,请稍候...");
            string error   = null;
            string message = null;
            await TaskMore.Run(new Action(() =>
            {
                //==制卡
                string result = WeiWang.iWrite(out error);
                if (error != null)
                {
                    if (MS2.PutCardToReject() != null)
                    {
                        error += "-卡回收失败";
                    }
                    return;
                }
                else
                {
                    string result2 = WeiWang.backTOSKG(Config.dic("KeyId"), personid, name, "-1");
                    if (result2 != "OK")
                    {
                        message += "市卡管回盘失败,请取卡后联系工作人员,以免影响正常使用!";
                        ShowTip.show(false, BackExit.Exit, message);
                    }
                }


                //0,6217281914006994119,441800  ,441225198703040437,R47708862,441800D1560000053030737878EC1A84,杨建辉,0087CF20018649618B00930612,2.00    ,20200226,20300226
                //0,1                  ,2       ,3                 ,4        ,5                               ,6     ,7                         ,8       ,9       ,10
                //0,银行卡号           ,发卡地区,社会保障号码      ,卡号     ,卡识别码                        ,姓名  ,卡复位信息                ,规范版本,发卡日期,卡有效期
                string[] results = result.Split(',');
            })).ConfigureAwait(true);

            if (error != null)
            {
                ShowTip.show(false, BackExit.Exit, error);
                return;
            }
            putCardOut();
        }
Exemplo n.º 6
0
        string serialNumber = "";//流水号

        //出卡
        async private void putCardOut()
        {
            updateTitle();
            string error = null;

            Loading.show1("正在激活社保卡,请稍候...");

            await TaskMore.Run(new Action(() => {
                //激活
                error = WeiWang.setStart(ssid);
                //打印凭条
                //List<string> printDatas = new List<string>();
                //printDatas.Add("        肇庆市社会保障卡业务回执单");
                //printDatas.Add("业务类型:自助补卡");
                //printDatas.Add("交易流水号:" + serialNumber);
                //printDatas.Add("终端名称:" + deviceMsg["data"]["deviceName"].ToString());
                //printDatas.Add("终端编号:" + deviceMsg["data"]["deviceId"].ToString());
                //printDatas.Add("所属区域:" + deviceMsg["data"]["areaName"].ToString());
                //printDatas.Add("所属网点:" + deviceMsg["data"]["branch"].ToString());
                //printDatas.Add("网点编号:" + deviceMsg["data"]["orgCode"].ToString());
                //printDatas.Add("交易时间:" + System.DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss"));
                //printDatas.Add("交易结果:补卡成功");
                //printDatas.Add("卡号:" + CD.hidenBankNum(bankcarNum));
                //printDatas.Add("领卡人:" + CD.hidenName(ReadIDCar.name));
                //Print.print(printDatas);
                //出卡
                MS2.PutCardOut();
            })).ConfigureAwait(true);

            if (error != null)
            {
                ShowTip.show(false, null, "社保卡激活失败:" + error);
            }

            I_GetSSCar_old getSSCar = I_GetSSCar_old.getObject();

            getSSCar.Goin();
            BackExit.LetNextClickToMain();
            CD.business1.showBackAndExitBtn();
        }
Exemplo n.º 7
0
        async private void WriteCar()
        {
            updateTitle();
            CD.business1.hidenBackAndExitBtn();
            Loading.show1("制卡中,请稍候...");
            string error = null;
            await TaskMore.Run(new Action(() =>
            {
                //==制卡
                string result = WeiWang.iWrite(out error);
                if (error != null)
                {
                    if (MS2.PutCardToReject() != null)
                    {
                        error += "-卡回收失败";
                    }
                    return;
                }

                /*
                 * //==读卡信息
                 * string[] datas = null;
                 * string atr2 = MS2.GetATR(out error);
                 * if (error != null)
                 *  return;
                 * bankcarNum = MS2.ReadBankNum(out error);
                 * if (error != null)
                 *  return;
                 * //卡识别码、卡类别、规范版本、初始化机构编号、发卡日期、卡有效期、卡号、社会保障号码、姓名、性别、民族、出生地、出生日期
                 * //0         1       2         3               4         5         6     7             8     9     10    11      12
                 * datas = MS2.GetBaseMsg(out error);
                 * if (error != null)
                 *  return;
                 * ssid = datas[6];
                 */

                //0,6217281914006994119,441800  ,441225198703040437,R47708862,441800D1560000053030737878EC1A84,杨建辉,0087CF20018649618B00930612,2.00    ,20200226,20300226
                //0,1                  ,2       ,3                 ,4        ,5                               ,6     ,7                         ,8       ,9       ,10
                //0,银行卡号           ,发卡地区,社会保障号码      ,卡号     ,卡识别码                        ,姓名  ,卡复位信息                ,规范版本,发卡日期,卡有效期
                string[] results = result.Split(',');

                MakeJson mj = new MakeJson();
                tools.AnalyzeJson aj = Network3.getJson(mj, "deviceLogin", out error);
                mj3 = new MakeJson();
                mj3.add("yhkh", results[1], DataStyle.STR);
                mj3.add("orgCode", aj["data"]["orgCode"], DataStyle.STR);
                mj3.add("devSeq", aj["data"]["devSeq"], DataStyle.STR);
                mj3.add("orgId", aj["data"]["orgId"], DataStyle.STR);
                mj3.add("atr", results[7], DataStyle.STR);
                mj3.add("ksbm", results[5], DataStyle.STR);
                mj3.add("sfzh", results[3], DataStyle.STR);
                mj3.add("xm", results[6], DataStyle.STR);
                mj3.add("kh", results[4], DataStyle.STR);
                mj3.add("backStatus", "1", DataStyle.STR);
                mj3.add("status", "1", DataStyle.STR);
                mj3.add("description", "制卡成功", DataStyle.STR);
                ssid = results[4];
            })).ConfigureAwait(true);

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

            updateTitle();
            Autograph.GetObject().Goin(sign);
        }
        /*
         *               <TextBlock>姓  名:name</TextBlock>
         *      <TextBlock>性  别:sex</TextBlock>
         *      <TextBlock>民  族:nation</TextBlock>
         *      <TextBlock>出生日期:birthday</TextBlock>
         *      <TextBlock>身份证号:shbzh</TextBlock>
         *      <TextBlock>社保卡号:sbkh</TextBlock>
         *      <TextBlock>户口性质:registtype</TextBlock>
         *      <TextBlock>电  话:telno</TextBlock>
         *      <TextBlock>手  机:mobile</TextBlock>
         *      <TextBlock>通讯地址:mailaddr</TextBlock>
         *      <TextBlock>邮  编:zipcode</TextBlock>
         *      <TextBlock>电子邮箱:email</TextBlock>
         *      <TextBlock>单位名称:dwmc</TextBlock>
         */
        async private void LoadDataAsync()
        {
            string name      = "";
            string persionid = "";

            if (SelectCard.isSelectIDCard)
            {
                name      = ReadIDCar.name;
                persionid = ReadIDCar.persionid;
            }
            else
            {
                name      = B_ReadSSCard.name;
                persionid = B_ReadSSCard.persionid;
            }

            BackExit.setBack(LoadDataAsync);
            Business2.Init("卡信息查询");

            Loading.show2("正在查询,请稍候...");
            List <Dictionary <string, string> > zkData = null;
            string error = null;
            await TaskMore.Run(new Action(() =>
            {
                if (error == null)
                {
                    zkData = WeiWang.getZKData(persionid, name, out error);
                }
            })).ConfigureAwait(true);

            if (error != null)
            {
                ShowTip.show(false, BackExit.Exit, error);
                return;
            }
            if (zkData[0]["ERR"] != "OK")
            {
                ShowTip.show(false, BackExit.Exit, zkData[0]["ERR"]);
                return;
            }
            try
            {
                for (int i = 0; i < keys.Count; i++)
                {
                    // string value = retJson["data"][keys[i]].ToString();
                    switch (keys[i])
                    {
                    case "name":
                        keys[i] = zkData[0]["AAC003"];
                        break;

                    case "sex":
                    {
                        if (zkData[0]["AAC004"] == "1" || zkData[0]["AAC004"] == "5")
                        {
                            keys[i] = "男";
                        }
                        else if (zkData[0]["AAC004"] == "2" || zkData[0]["AAC004"] == "6")
                        {
                            keys[i] = "女";
                        }
                        else
                        {
                            keys[i] = "未知";
                        }
                        break;
                    }

                    case "nation":
                        keys[i] = ReadIDCar.GetNationName(zkData[0]["AAC005"]);
                        break;

                    case "birthday":
                        keys[i] = zkData[0]["AAC006"];
                        break;

                    case "shbzh":
                        keys[i] = zkData[0]["AAC002"].Substring(0, 5) + "***********" + zkData[0]["AAC002"].Substring(zkData[0]["AAC002"].Length - 2, 2);
                        break;

                    case "sbkh":
                        keys[i] = zkData[0]["AAZ500"].Substring(0, 2) + "*******" + zkData[0]["AAZ500"].Substring(zkData[0]["AAZ500"].Length - 2, 2);
                        break;

                    case "registtype":
                        keys[i] = zkData[0]["AAC009"];
                        break;

                    case "telno":
                        keys[i] = zkData[0]["AAE005"];
                        break;

                    case "mobile":
                        keys[i] = zkData[0]["MOBILE"];
                        break;

                    case "mailaddr":
                        keys[i] = zkData[0]["AAE006"];
                        break;

                    case "zipcode":
                        keys[i] = zkData[0]["AAE007"];
                        break;

                    case "email":
                        keys[i] = zkData[0]["EMAIL"];
                        break;

                    case "dwmc":
                        keys[i] = zkData[0]["AAB004"];
                        break;
                    }
                    ctls[i].Text = names[i] + keys[i];
                }
                pic.Source = TImage.Base64ToImageSource(zkData[0]["PHOTO"].ToString());
                CD.business2.setBusinessValue(this);
            }
            catch (Exception e)
            {
                Log.AddLog("Search", e.ToString());
                ShowTip.show(false, BackExit.Exit, "数据解析异常");
            }
        }