Пример #1
0
        string serialNumber = "";//流水号
        //合并签名信息回盘
        async private void sign(string pic)
        {
            Loading.show1("正在保存签名信息...");
            tools.AnalyzeJson aj3 = null;
            await TaskMore.Run(new Action(() =>
            {
                mj3.add("receipt", pic, DataStyle.STR);
                Log("send:" + mj3.ToString());
                aj3 = Network3.getJson(mj3, "getBackData");
                if (aj3.error != null)
                {
                    if (MS2.PutCardToReject() != null)
                    {
                        aj3.error += "-卡回收失败";
                    }
                }
                else
                {
                    serialNumber = aj3["data"].ToString();
                }
            })).ConfigureAwait(true);

            if (aj3.error != null)
            {
                ShowTip.show(false, BackExit.Exit, aj3.error);
            }
            else
            {
                manageCheck();
            }
        }
        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();
        }
Пример #3
0
        async private void Ok_Click(object sender, RoutedEventArgs e)
        {
            if (p1.Password.Length != 6)
            {
                ShowTip.show(false, null, "请输入6位数原密码");
            }
            else if (p2.Password.Length != 6 || p3.Password.Length != 6)
            {
                ShowTip.show(false, null, "请输入6位数新密码");
            }
            else if (p2.Password != p3.Password)
            {
                ShowTip.show(false, null, "两次输入的新密码不一致!");
            }
            else
            {
                string pOutInfo = null;
                int    ret      = -1;
                Loading.show2("正在修改密码,请稍候...");
                await TaskMore.Run(new Action(() => {
                    int ctl = int.Parse(Config.dic("Up"));
                    ret = B_ReadSSCard.ChangePINKExt(ctl, p1.Password, p2.Password, out pOutInfo);
                })).ConfigureAwait(true);

                if (ret == 0)
                {
                    ShowTip.show(true, BackExit.Exit, "密码修改成功");
                }
                else
                {
                    ShowTip.show(false, BackExit.Exit, "密码修改失败:" + pOutInfo);
                }
            }
        }
Пример #4
0
 private void End()
 {
     Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
     {
         status.Text = "加卡结束";
         ShowTip.show(true, null, "加卡完成!");
     }));
 }
        async private void search_Click(object sender, RoutedEventArgs e)
        {
            if (isLoading)
            {
                return;
            }
            isLoading     = true;
            sp.Visibility = Visibility.Visible;
            string name      = "";
            string persionid = "";

            if (SelectCard.isSelectIDCard)
            {
                name      = ReadIDCar.name;
                persionid = ReadIDCar.persionid;
            }
            else
            {
                name      = B_ReadSSCard.name;
                persionid = B_ReadSSCard.persionid;
            }
            string timeTag = CD.timeTag.updateTag();

            tools.AnalyzeJson retJson1 = null;
            tools.AnalyzeJson retJson2 = null;
            string[]          timeMsg  = time.getTime().Split('-');
            int year  = int.Parse(timeMsg[0]);
            int month = int.Parse(timeMsg[1]);
            await TaskMore.Run(new Action(() => {
                retJson1 = getBalance(persionid, name);
                if (retJson1.error == null)
                {
                    retJson2 = getList(persionid, name);
                }
            })).ConfigureAwait(true);

            isLoading = false;
            if (CD.timeTag.equal(timeTag) == false)
            {
                return;
            }
            sp.Visibility = Visibility.Hidden;
            if (retJson1.error != null)
            {
                ShowTip.show(false, null, retJson1.error);
            }
            else if (retJson2.error != null)
            {
                ShowTip.show(false, null, retJson2.error);
            }
            else
            {
                CD.business2.setBusinessValue(this);
                string balance = retJson1["data"]["balance"].ToString();
                this.balance.Text = balance;
                setList(retJson2);
            }
        }
Пример #6
0
 private void ShowError(string error)
 {
     Log(error);
     Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
     {
         ShowTip.show(false, null, error);
         status.Text = "加卡结束";
     }));
 }
Пример #7
0
        async public void Goin()
        {
            reset();
            carMsg = null;
            //BackExit.setBack(Goin);
            timeTag = CD.timeTag.updateTag();
            CD.setTopUI(this);
            time.start();

            string error     = null;
            bool   isSuccess = false;
            await TaskMore.Run(new Action(() => {
                lock (readcardlock)
                {
                    if (CD.timeTag.equal(timeTag) == false)
                    {
                        return;
                    }
                    //卡识别码、卡类别、规范版本、初始化机构编号、发卡日期、卡有效期、卡号、社会保障号码、姓名、性别、民族、出生地、出生日期
                    //0         1       2         3               4         5         6     7             8     9     10    11      12
                    isSuccess = putCardIn(out error);
                    if (isSuccess)
                    {
                        isSuccess = ReadCard(out carMsg, out error);
                    }
                    if (isSuccess == false)
                    {
                        putCardOut();
                    }
                    else
                    {
                        string[] data = carMsg.Split('|');
                        name = data[8];
                        persionid = data[7];
                    }
                }
            })).ConfigureAwait(true);

            if (CD.timeTag.equal(timeTag) == false)
            {
                return;
            }
            if (isSuccess == false)
            {
                ShowTip.show(false, BackExit.Exit, error);
            }
            else
            {
                hasCardIn = true;
                if (nextStep != null && CD.timeTag.equal(timeTag))
                {
                    nextStep();
                }
            }
            time.stop();
        }
 private void ok_Click(object sender, RoutedEventArgs e)
 {
     phone = tb.Text;
     if (tb.Text.Length == tb.MaxLength)
     {
         nextStep();
     }
     else
     {
         ShowTip.show(false, null, "请输入11位手机号");
     }
 }
        //挂失和获取数据
        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);
        }
Пример #10
0
 private void check(List <Dictionary <string, string> > zkData)
 {
     if (zkData[0]["ERR"] != "OK")
     {
         ShowTip.show(false, BackExit.Exit, zkData[0]["ERR"]);
         return;
     }
     if (cpd == null)
     {
         cpd = new CheckPersionData();
     }
     personid = zkData[0]["AAC002"];
     name     = zkData[0]["AAC003"];
     cpd.Goin(zkData[0]["AAC002"], zkData[0]["AAC003"], zkData[0]["PHOTO"], WriteCar);
 }
        //2.加载数据
        async private void LoadData()
        {
            string name      = "";
            string persionid = "";

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


            BackExit.setBack(LoadData);
            Business2.Init("医保账户查询");

            Loading.show2("正在查询,请稍候...");
            tools.AnalyzeJson retJson1 = null;
            tools.AnalyzeJson retJson2 = null;
            await TaskMore.Run(new Action(() => {
                retJson1 = getBalance(persionid, name);
                if (retJson1.error == null)
                {
                    retJson2 = getList(persionid, name);
                }
            })).ConfigureAwait(true);

            if (retJson1.error != null)
            {
                ShowTip.show(false, BackExit.Exit, retJson1.error);
            }
            else if (retJson2.error != null)
            {
                ShowTip.show(false, BackExit.Exit, retJson2.error);
            }
            else
            {
                CD.business2.setBusinessValue(this);
                time.reset(true, false);
                string balance = retJson1["data"]["balance"].ToString();
                this.balance.Text = balance;
                setList(retJson2);
            }
        }
Пример #12
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);
        }
Пример #13
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();
        }
Пример #14
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();
        }
Пример #15
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();
        }
Пример #16
0
        //2.加载数据
        async private void LoadData()
        {
            BackExit.setBack(LoadData);
            index = 0;

            timeTag = CD.timeTag.updateTag();
            if (CD.business2 == null)
            {
                CD.business2 = new Business2();
            }
            CD.setMainUI(CD.business2);
            CD.business2.start();

            Loading.show2("正在查询,请稍候...");
            tools.AnalyzeJson retJson = null;
            await TaskMore.Run(new Action(() => {
                MakeJson json = new MakeJson();
                json.add("fkcs", Config.dic("cityCode"));
                json.add("shbzh", ReadIDCar.persionid);
                json.add("xm", ReadIDCar.name);
                //ppid String  是 由肇庆市社保局提供
                //appkey String  是 由肇庆市社保局提供
                retJson = Post.Post_Json("getCardProgress", json.ToString());
            })).ConfigureAwait(true);

            if (retJson.error != null)
            {
                ShowTip.show(false, BackExit.Exit, retJson.error);
            }
            else
            {
                if (retJson["data"]["err"].ToString() != "OK")
                {
                    ShowTip.show(false, BackExit.Exit, retJson["data"]["err"].ToString());
                    return;
                }
                if (retJson["data"]["validtag"].ToString().Trim().IndexOf("-") == 0)
                {
                    error.Text = "制卡失败:" + retJson["data"]["remarks"].ToString();
                }
                else
                {
                    error.Text = "";
                }

                times[0].Text = handleTimeStr(retJson["data"]["applytime"].ToString());
                times[1].Text = handleTimeStr(retJson["data"]["banktime"].ToString());
                times[2].Text = handleTimeStr(retJson["data"]["kszkhpsj"].ToString());
                times[3].Text = handleTimeStr(retJson["data"]["provincetime"].ToString());
                times[4].Text = handleTimeStr(retJson["data"]["citytime"].ToString());
                times[5].Text = handleTimeStr(retJson["data"]["gettime"].ToString());
                times[6].Text = handleTimeStr(retJson["data"]["yhjhtime"].ToString());

                if (times[0].Text == "")
                {
                    CD.business2.setBusinessValue(MakeCardProcess2.GetObject());
                    return;
                }

                if (times[4].Text != "")
                {
                    T52.Text = "(" + retJson["data"]["lkjgmc"].ToString() + ")";
                }
                else
                {
                    T52.Text = "";
                }

                index = 0;
                for (int i = 0; i < times.Count; i++)
                {
                    if (times[i].Text == "")
                    {
                        break;
                    }
                    index++;
                }

                showResult();
            }
        }
Пример #17
0
        //业务流程

        public void addCar2()
        {
            try
            {
                MS2.Open();
                string error = MS2.checkMachine();
                if (error != null)
                {
                    Log(error);
                    ShowError("设备异常:" + error);
                    return;
                }

                string            addCarError = null;
                MakeJson          mj          = new MakeJson();
                tools.AnalyzeJson aj          = Network3.getJson(mj, "deviceLogin", out error);
                if (error != null)
                {
                    Log(error);
                    addCarError = "网络异常";
                }
                else if (aj != null && aj["statusCode"].ToString() != "200")
                {
                    Log(error);
                    addCarError = "设备登录失败。";
                }
                //处理
                if (addCarError != null)
                {
                    ShowError(addCarError);
                    return;
                }

                MS2.ResetWithOutPrint();
                string   boxs  = Config.dic("addCardBoxs");
                string[] boxs2 = boxs.Split('|');
                foreach (string box_ in boxs2)
                {
                    int box = int.Parse(box_);
                    while (true)
                    {
                        //1、料盒出卡
                        error = MS2.GetCarFromBox(box);
                        if (error != null && error == "-1")
                        {
                            break;
                        }
                        else if (error != null)
                        {
                            ShowError("出卡异常,请联系管理员处理");
                            return;
                        }
                        //2、移到读卡器
                        string atr = MS2.GetATR(out error);
                        if (error != null)
                        {
                            addFailed();
                            MS2.PutCardToReject();
                            if (error.IndexOf("-1") != -1)
                            {
                                ShowError("读卡异常,请联系管理员处理");
                                return;
                            }
                            continue;
                        }
                        //3、读银行卡号
                        string bankcarNum = MS2.ReadBankNum(out error);
                        if (error != null)
                        {
                            addFailed();
                            MS2.PutCardToReject();
                            continue;
                        }
                        //4、读社保基本信息
                        string[] carDatas = MS2.GetBaseMsg(out error);
                        if (error != null)
                        {
                            addFailed();
                            MS2.PutCardToReject();
                            continue;
                        }
                        //5、入库
                        int stlo = 0;
                        error = MS2.PutCardToStore(atr, ref stlo);
                        if (error != null)
                        {
                            addFailed();
                            ShowError(error);
                            return;
                        }
                        //6、接口入库

                        /*
                         * channelcode	String	是	渠道编码
                         * orgCode	String	是	网点编码(接口2.5返回orgCode)
                         * devSeq	String	是	设备序号(接口2.5返回devSeq)
                         * atr	String	是	ATR
                         * ksbm	String	是	卡识别码(社保卡时必填)
                         * yhkh	String	是	银行卡号
                         * shbzh	String	是	社会保障号(社保卡时必填)
                         * sfzh	String	是	身份证(社保卡时必填)
                         * xm	String	是	姓名(社保卡时必填)
                         * slotno	int	是	槽号
                         * orgId	long	是	网点id(2.5接口返回的orgId)
                         * klb	String	是	卡类别 01:社保卡 02:借记卡 03:信用卡
                         * gfbb	String	否	规范版本
                         * jgbm	String	否	机构编码
                         * fkrq	String	否	发卡日期yyyyMMdd
                         * kyxq	String	否	卡有效期
                         * kh	String	否	卡号
                         * sex	String	否	性别
                         * nation	String	否	民族
                         * csrq	String	否	出生日期
                         *
                         */

                        MakeJson mj2 = new MakeJson();
                        mj2.add("orgCode", aj["data"]["orgCode"], DataStyle.STR);
                        mj2.add("devSeq", aj["data"]["devSeq"], DataStyle.STR);
                        mj2.add("orgId", int.Parse(aj["data"]["orgId"].ToString()), DataStyle.INT);
                        mj2.add("atr", atr, DataStyle.STR);
                        mj2.add("yhkh", bankcarNum, DataStyle.STR);
                        mj2.add("slotno", stlo, DataStyle.INT);
                        mj2.add("boxno", 1, DataStyle.INT);
                        //卡识别码、卡类别、规范版本、初始化机构编号、发卡日期、卡有效期、卡号、社会保障号码、姓名、性别、民族、出生地、出生日期
                        //0         1       2         3               4         5         6     7             8     9     10    11      12
                        mj2.add("ksbm", carDatas[0], DataStyle.STR);
                        mj2.add("shbzh", carDatas[7], DataStyle.STR);
                        mj2.add("kh", carDatas[6], DataStyle.STR);
                        mj2.add("sfzh", carDatas[7], DataStyle.STR);
                        mj2.add("xm", carDatas[8], DataStyle.STR);
                        mj2.add("klb", "01", DataStyle.STR);
                        mj2.add("gfbb", carDatas[2], DataStyle.STR);
                        mj2.add("jgbm", carDatas[3], DataStyle.STR);
                        mj2.add("fkrq", carDatas[4], DataStyle.STR);
                        mj2.add("kyxq", carDatas[5], DataStyle.STR);
                        mj2.add("sex", carDatas[9], DataStyle.STR);
                        mj2.add("nation", carDatas[10], DataStyle.STR);
                        mj2.add("csrq", carDatas[12], DataStyle.STR);
                        tools.AnalyzeJson aj2 = Network3.getJson(mj2, "uploadCPCardInfo");
                        if (aj2.error != null)
                        {
                            addFailed();
                            addCarError = "后台入库接口调用失败";
                            error       = MS2.PutCardToIC(atr, stlo);
                            if (error == null)
                            {
                                error = MS2.PutCardToReject();
                            }
                            if (error != null)
                            {
                                ShowTip.show(false, null, "机器故障:" + error);
                                End();
                                return;
                            }
                            continue;
                        }
                        addSuccess();
                    }
                }
                End();
            }
            catch (Exception e)
            {
                Log("加卡异常:" + e.ToString());
                ShowError("加卡异常:" + e.ToString());
            }
        }
Пример #18
0
        //3.信息校验
        async private void goToLingKa()
        {
            bool carHasOut = false;

            tellHadGetCard = null;
            string error      = null;
            string bankcarnum = null;

            if (ds == null)
            {
                ds = sc.getSelectItems();
            }
            if (ds == null || ds.Count == 0)
            {
                return;
            }

            updateTitle();
            CD.business1.hidenBackAndExitBtn();
            CD.business1.stop();
            int getIndex = ds[0];

            ds.RemoveAt(0);

            Loading.show1("正在出卡,请稍候....");
            string carMsg = cpCardInfo["data"]["data"][getIndex]["klbName"].ToString() + "-" +
                            cpCardInfo["data"]["data"][getIndex]["yhkh"].ToString() + "-" +
                            cpCardInfo["data"]["data"][getIndex]["kh"].ToString();
            string   msg = cpCardInfo["data"]["data"][getIndex]["cardId"].ToString();
            MakeJson mj2 = new MakeJson();

            mj2.add("orgCode", deviceInfo["data"]["orgCode"], DataStyle.STR);
            mj2.add("devSeq", deviceInfo["data"]["devSeq"], DataStyle.STR);
            mj2.add("sfzh", cpCardInfo["data"]["data"][getIndex]["sfzh"], DataStyle.STR);
            mj2.add("xm", cpCardInfo["data"]["data"][getIndex]["xm"], DataStyle.STR);
            mj2.add("cardId", int.Parse(cpCardInfo["data"]["data"][getIndex]["cardId"].ToString()), DataStyle.INT);
            mj2.add("orgId", deviceInfo["data"]["orgId"], DataStyle.STR);
            mj2.add("applytype", "0", DataStyle.STR);
            string atr_json = cpCardInfo["data"]["data"][getIndex]["atr"].ToString();
            int    kc       = int.Parse(cpCardInfo["data"]["data"][getIndex]["slotno"].ToString());

            await TaskMore.Run(new Action(() =>
            {
                string atr_raed = null;
                string[] carDatas = null;
                error = MS2.PutCardToIC(atr_json, kc);
                if (error == null)
                {
                    atr_raed = MS2.GetATR(out error);
                }
                if (error == null)
                {
                    carDatas = MS2.GetBaseMsg(out error);
                }
                if (error == null)
                {
                    bankcarnum = MS2.ReadBankNum(out error);
                }
                if (error != null)
                {
                    ShowTip.show(false, BackExit.Exit, error);
                    return;
                }
                ssid = carDatas[6];
                //卡识别码、卡类别、规范版本、初始化机构编号、发卡日期、卡有效期、卡号、社会保障号码、姓名、性别、民族、出生地、出生日期
                //0         1       2         3               4         5         6     7             8     9     10    11      12
                if (atr_raed != cpCardInfo["data"]["data"][getIndex]["atr"].ToString() ||
                    carDatas[7] != cpCardInfo["data"]["data"][getIndex]["sfzh"].ToString() ||
                    carDatas[8] != cpCardInfo["data"]["data"][getIndex]["xm"].ToString() ||
                    carDatas[6] != cpCardInfo["data"]["data"][getIndex]["kh"].ToString() ||
                    bankcarnum != cpCardInfo["data"]["data"][getIndex]["yhkh"].ToString()
                    )
                {
                    error = "信息校验失败!";
                    MS2.PutCardToReject();
                }

                if (error != null)
                {
                    mj2.add("status", "2", DataStyle.STR);
                    mj2.add("description", "卡信息校验失败", DataStyle.STR);
                }
                else
                {
                    mj2.add("status", "1", DataStyle.STR);
                    mj2.add("description", "成功", DataStyle.STR);
                }
                tellHadGetCard = Network3.getJson(mj2, "uploadFKRecord");
            })).ConfigureAwait(true);

            if (error != null)
            {
                Log.AddLog("领卡", carMsg + "  error:" + error);
                if (carHasOut)
                {
                    MS2.PutCardToReject();
                }
                ShowTip.show(false, BackExit.Exit, error);
            }
            else if (tellHadGetCard.error != null)
            {
                MS2.PutCardToReject();

                ShowTip.show(false, BackExit.Exit, tellHadGetCard.error);
            }
            else
            {
                checkPsw();
            }
        }
Пример #19
0
        //2.选择卡片
        async private void selectCards()
        {
            index = 1;
            string error = null;

            if (CD.timeTag.equal(timeTag) == false)
            {
                return;
            }
            Loading.show1("正在查询个人数据...");
            await TaskMore.Run(new Action(() =>
            {
                MakeJson mj_normal = new MakeJson();
                deviceInfo = Network3.getJson(mj_normal, "deviceLogin");
                error = deviceInfo.error;
                if (error != null)
                {
                    return;
                }

                MakeJson mj = new MakeJson();
                mj.add("sfzh", ReadIDCar.persionid, DataStyle.STR);
                mj.add("xm", ReadIDCar.name, DataStyle.STR);
                cpCardInfo = Network3.getJson(mj, "getCPCardInfo");
                error = cpCardInfo.error;
            })).ConfigureAwait(true);

            if (error != null)
            {
                ShowTip.show(false, BackExit.Exit, error);
                return;
            }
            try
            {
                List <string[]> datas = new List <string[]>();
                int             count = cpCardInfo["data"]["data"].getArrayCount();
                //"序号,姓名,身份证号,待领卡类型,银行卡号,社保卡号"
                int k = 1;
                for (int i = 0; i < count; i++)
                {
                    if (cpCardInfo["data"]["data"][i]["status"].ToString() == "0")
                    {
                        string name = cpCardInfo["data"]["data"][i]["xm"].ToString();
                        string sfzh = cpCardInfo["data"]["data"][i]["sfzh"].ToString();
                        string yhkh = cpCardInfo["data"]["data"][i]["yhkh"].ToString();

                        name = "*" + name.Substring(1, name.Length - 1);
                        sfzh = sfzh.Substring(0, 6) + "**********" + sfzh.Substring(16, 2);
                        yhkh = "**********************".Substring(0, yhkh.Length - 4) + yhkh.Substring(yhkh.Length - 4, 4);

                        datas.Add(new string[] {
                            (k++).ToString(),
                            name,
                            sfzh,
                            cpCardInfo["data"]["data"][i]["klbName"].ToString(),
                            yhkh,
                            cpCardInfo["data"]["data"][i]["kh"].ToString()
                        });
                    }
                }

                if (sc == null)
                {
                    sc = new SelectCars();
                    sc.setSelectOK(goToLingKa);
                }
                updateTitle();
                sc.setTable(datas);
                CD.business1.setBusinessValue(sc);
            }
            catch (Exception e)
            {
                ShowTip.show(false, BackExit.Exit, "数据解析异常:" + e.ToString());
                return;
            }
        }
Пример #20
0
        async private void ok_Click(object sender, RoutedEventArgs e)
        {
            if (p1.Text == "" || p2.Password == "")
            {
                if (check != null && check.Status == TaskStatus.Running)
                {
                    return;
                }
            }
            enable_false();
            tip.Visibility = Visibility.Visible;
            string name    = p1.Text;
            string psw     = tools.CommonFunction.GetMD5String(p2.Password);
            string timeTag = CD.timeTag.updateTag();
            string error   = null;
            string src     = "正在验证,请稍候...";
            Task   task    = new Task(new Action(() =>
            {
                int num = 3;
                while (CD.timeTag.equal(timeTag))
                {
                    string tag = src.Substring(0, src.Length - num);
                    Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
                    {
                        tip.Text = tag;
                    }));
                    num--;
                    if (num < 0)
                    {
                        num = 3;
                    }
                    //if (check != null && check.Status == TaskStatus.RanToCompletion)
                    //{
                    //    if (error != null)
                    //    {
                    //        Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
                    //        {
                    //            ShowTip.show(false, null, error);
                    //        }));
                    //    }
                    //    return;
                    //}
                    Thread.Sleep(1000);
                }
            }));

            task.Start();

            check = new Task(new Action(() =>
            {
                tools.MakeJson inJson = new tools.MakeJson();
                inJson.add("username", name);
                inJson.add("password", psw.ToUpper());
                tools.AnalyzeJson retJson = YTH.Functions.Post.Post_Json("checkAdmin", inJson.ToString());
                error = retJson.error;
            }));
            check.Start();
            await check.ConfigureAwait(true);

            tip.Visibility = Visibility.Hidden;
            if (error == null)
            {
                if (CD.timeTag.equal(timeTag))
                {
                    nextStep();
                }
            }
            else
            {
                enable_true();
                CD.timeTag.updateTag();
                ShowTip.show(false, null, error);
            }
        }
Пример #21
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, "数据解析异常");
            }
        }