Exemplo n.º 1
0
    public static string[] getUserIds(ResultCodeArgs re)
    {
        string[] lArrUserIds = new string[] {};
        if (re.ResultCode != SUCCESSED || re.ResultMessage == "")
        {
            return(lArrUserIds);
        }
        else
        {
            if (re.ResultMessage.Contains(";"))
            {
                lArrUserIds = re.ResultMessage.Split(';');
            }
            else
            {
                lArrUserIds    = new string[] { "" };
                lArrUserIds[0] = re.ResultMessage;
            }

            for (int i = 0; i < lArrUserIds.Length; i++)
            {
                string val = lArrUserIds[i].ToString();
                if (
                    val.EndsWith("_R1") || val.EndsWith("_R2") || val.EndsWith("_R3") || val.EndsWith("_R4") || val.EndsWith("_R5") ||
                    val.EndsWith("_L1") || val.EndsWith("_L2") || val.EndsWith("_L3") || val.EndsWith("_L4") || val.EndsWith("_L5")
                    )
                {
                    lArrUserIds[i] = val.Substring(0, val.LastIndexOf('_'));
                }
            }
        }
        return(lArrUserIds);
    }
Exemplo n.º 2
0
    private void FpVerifyHandler(object o, EventArgs e)
    {
        ResultCodeArgs re = (ResultCodeArgs)e;

        string[] lStrUserIds = FpBase.getUserIds(re);

        string idcard = lStrUserIds.Length > 0 ? lStrUserIds[0].ToString() : "";

        int rcode = FPSystemBiz.fnIdendityStudentTrain(idcard);

        if (rcode == FPSystemBiz.CHECHIN_NO_RECARD)
        {
            this.lbStudentAlertMsg.Text = "没有该学员的指纹信息";
            return;
        }
        FpStudentObject fso = SimpleOrmOperator.Query <FpStudentObject>(idcard);

        if (fso == null)
        {
            this.lbStudentAlertMsg.Text = "没有该学员的个人信息";
            return;
        }
        this.fnUILoadStudentRecord(fso, rcode);
        this.lbStudentAlertMsg.Text = "指纹确认成功";
    }
Exemplo n.º 3
0
    private void FpVerifyHandler(object sender, EventArgs e)
    {
        ResultCodeArgs re = (ResultCodeArgs)e;

        if (re.ResultCode == 215)
        {
            ViewState["verifyFail"] = null;
            txtIdcard.Value         = string.Empty;
            return;
        }
        //string[] lArrIdCards = FpBase.getUserIds(re);
        //string idcard = Request.Params["idcard"];
        string idcard = txtIdcard.Value.Trim();

        // idcard = Server.UrlEncode(idcard);
        string SCP_ALERT = "", lStrSearch = "";
        // Session[FPSystemBiz.PARAM_RESULT] = idcard;

        string gStrTargetFrame = Session[KEY_TRAGET_FRAME] as string;

        string gStrCheckinLogFrame = Session[KEY_CHECKINLOG_FRAME] as string;

        if (re.ResultCode == FpBase.SUCCESSED)
        {
            //WebTools.Alert("身份识别成功:" + idcard);
            lStrSearch = string.Format("?{0}={1}", FPSystemBiz.PARAM_RESULT, idcard);
            SCP_ALERT += string.Format("window.parent.document.frames('{0}').location.search='{1}';", gStrTargetFrame, lStrSearch);
            SCP_ALERT += string.Format("window.parent.document.frames('{0}').location.reload();", gStrCheckinLogFrame);
            ViewState["verifyFail"] = null;
            txtIdcard.Value         = string.Empty;
        }
        else
        {
            //WebTools.Alert("身份识别失败:" + idcard);
            lStrSearch = string.Format("?{0}={1}", FPSystemBiz.PARAM_RESULT, "");
            SCP_ALERT += string.Format("window.parent.document.frames('{0}').location.search='{1}';", gStrTargetFrame, lStrSearch);

            if (ViewState["verifyFail"] == null)
            {
                Thread.Sleep(500);
                doVerify(idcard);
                ViewState["verifyFail"] = true;
            }
            else
            {
                ViewState["verifyFail"] = null;
                txtIdcard.Value         = string.Empty;
            }
        }


        // WebTools.Alert(SCP_ALERT);
        // ClientScriptManager newCSM = Page.ClientScript;
        //newCSM.RegisterStartupScript(this.GetType(), this.GetHashCode().ToString(), SCP_SCRIPT_START + SCP_ALERT + SCP_SCRIPT_END);
        WebTools.WriteScript(SCP_ALERT);

        //if (cboAuto.Checked)
        //    _FP.FpIdentityUser();
    }
Exemplo n.º 4
0
    private void FpVerifyHandler(object sender, EventArgs e)
    {
        //string SCP_SCRIPT_START = "\n<script language=\"javascript\">\n";
        string SCP_ALERT = "";
        //string SCP_SCRIPT_END = "</script>\n";

        ResultCodeArgs re = (ResultCodeArgs)e;

        // TempLog.Info("验证结果为:"+re.ResultCode+"验证结果说明:"+re.ResultMessage);
        if (re.ResultCode == 215)
        {
            return;
        }
        //log.Error("re.ResultMessage:"+re.ResultMessage);
        string[] lArrIdCards = FpBase.getUserIds(re);
        // TempLog.Info("验证返回的身份证明号码字符串数组长度为->"+lArrIdCards.Length.ToString());
        string idcard = lArrIdCards.Length > 0 ? lArrIdCards[0].ToString().Split('_')[0] : "";
        // idcard = Server.UrlEncode(idcard);
        string lStrSearch = string.Format("?{0}={1}", FPSystemBiz.PARAM_RESULT, idcard);

        // Session[FPSystemBiz.PARAM_RESULT] = idcard;

        SCP_ALERT += string.Format("window.parent.document.frames['{0}'].location.search='{1}';", gStrTargetFrame, lStrSearch);
        SCP_ALERT += string.Format("window.parent.document.frames['{0}'].location.reload();", gStrCheckinLogFrame);
        ClientScriptManager newCSM = Page.ClientScript;

        //newCSM.RegisterStartupScript(this.GetType(), this.GetHashCode().ToString(), SCP_SCRIPT_START + SCP_ALERT + SCP_SCRIPT_END);
        WebTools.WriteScript(SCP_ALERT);
        //WebTools.ShowModalWindows
        //TempLog.Info("输出的script内容为->"+SCP_ALERT);
        //  this.ClientScript.RegisterStartupScript(typeof(int), "alertmsg", "<script language='javascript'>" + SCP_ALERT + "</script>");



        if (cboAuto.Checked)
        {
            //Thread.Sleep(200);
            int retryCount = 0;
            int result     = _FP.FpIdentityUser();
            if (result != FpBase.SUCCESSED)
            {
                Thread.Sleep(1500);
                //_FP = new FpBase(this, new EventHandler(FpVerifyHandler), true );
                result = _FP.FpIdentityUser();
                //btnIdentity_Click(null, null);
            }
            // while (result != FpBase.SUCCESSED && retryCount++ <5)
            //{
            //     Thread.Sleep(2000);
            //     result = _FP.FpIdentityUser();
            // }
        }
    }
Exemplo n.º 5
0
    /// <summary>
    /// Process user action after operation fingerprint
    /// Notice: if don't process user operation fingerprint then use the TrustLinkGereralControler achieve the Result
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void TrustLink_OperDlgPostEvent(object sender, EventArgs e)
    {
        ResultCodeArgs re = (ResultCodeArgs)e;

        string[]        lArrUserIds = FpBase.getUserIds(re);
        FpStudentObject lObjStudent = null;
        int             lIntAction  = ACTION_NONE;

        if (Session[ACTION_NAME] == null)
        {
            return;
        }
        try
        {
            lIntAction = int.Parse(Session[ACTION_NAME].ToString());
        }
        catch (Exception ex)
        {
            lIntAction = ACTION_NONE;
        }
        switch (lIntAction)
        {
        case ACTION_NONE: break;

        case ACTION_NEW_ENROLL_STUDENT:
            string qIDCard = this.txtIDCard.Text;
            lObjStudent = FT.DAL.Orm.SimpleOrmOperator.Query <FpStudentObject>(qIDCard);
            if (lObjStudent == null)
            {
                this.fnUINewEnrollStudentSucess(false);
                return;
            }
            else
            {
                lObjStudent.STATUE = FpStudentObject.STATUE_COLLECT;
                //FPSystemBiz.fnAddOrUpdateStudentRecord(lObjStudent);
                this.fnUINewEnrollStudentSucess(SimpleOrmOperator.Update(lObjStudent));
            }
            break;
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// Process user action after operation fingerprint
    /// Notice: if don't process user operation fingerprint then use the TrustLinkGereralControler achieve the Result
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    private void TrustLink_OperDlgPostEvent(object sender, EventArgs e)
    {
        string SCP_SCRIPT_START = "\n<script language=\"javascript\">\n";
        string SCP_ALERT        = "";
        string SCP_SCRIPT_END   = "</script>\n";

        ResultCodeArgs re         = (ResultCodeArgs)e;
        string         strMessage = re.ResultMessage;

        if (re.ResultCode == SUCCESSED)
        {
            SCP_ALERT = "alert(\"" + Resources.TrustLinkGeneralSampleFormRes.ResourceManager.GetString("IDS_SUCCESS", AP_culture)
                        + "\\n" + strMessage + "\");\n";
        }
        else
        {
            SCP_ALERT = "alert(\"" + Resources.TrustLinkGeneralSampleFormRes.ResourceManager.GetString("IDS_RESULT_CODE", AP_culture)
                        + re.ResultCode.ToString() + "\\n" + strMessage + "\");\n";
        }
        ClientScriptManager newCSM = Page.ClientScript;

        newCSM.RegisterStartupScript(this.GetType(), this.GetHashCode().ToString(), SCP_SCRIPT_START + SCP_ALERT + SCP_SCRIPT_END);
    }
Exemplo n.º 7
0
    public static string[] getUserIds(ResultCodeArgs re)
    {
        string[] lArrUserIds = new string[] {};
        if (re.ResultCode != SUCCESSED||re.ResultMessage=="")
            return lArrUserIds;
        else
        {
            if (re.ResultMessage.Contains(";"))
            {
                lArrUserIds = re.ResultMessage.Split(';');
            }
            else
            {
                lArrUserIds = new string[] { ""};
                lArrUserIds[0]=re.ResultMessage;
            }

            for (int i = 0; i < lArrUserIds.Length; i++)
            {
                string val = lArrUserIds[i].ToString();
                if (
                    val.EndsWith("_R1") || val.EndsWith("_R2") || val.EndsWith("_R3") || val.EndsWith("_R4") || val.EndsWith("_R5") ||
                    val.EndsWith("_L1") || val.EndsWith("_L2") || val.EndsWith("_L3") || val.EndsWith("_L4") || val.EndsWith("_L5")
                    )
                {
                    lArrUserIds[i] = val.Substring(0, val.LastIndexOf('_'));
                }
            }
        }
        return lArrUserIds;
    }