Example #1
0
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case MESSAGE_CAPTURED_OK:
                MemoryStream ms = new MemoryStream();
                BitmapFormat.GetBitmap(FPBuffer, mfpWidth, mfpHeight, ref ms);
                Bitmap bmp = new Bitmap(ms);
                this.pic.Image = bmp;
                {
                    int ret = zkfp.ZKFP_ERR_OK;
                    int fid = 0, score = 0;
                    ret = zkfp2.DBIdentify(mDBHandle, CapTmp, ref fid, ref score);
                    if (zkfp.ZKFP_ERR_OK == ret)
                    {
                        lb_ZhiWen_Msg.Text = "指纹识别成功,匹配度=" + score + "%";
                        MyShowDialog();
                    }
                    else
                    {
                        lb_ZhiWen_Msg.Text = "指纹识别失败,状态码=" + ret;
                        return;
                    }
                }
                break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }
Example #2
0
        protected override void DefWndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case MESSAGE_CAPTURED_OK:
                MemoryStream ms = new MemoryStream();
                BitmapFormat.GetBitmap(FPBuffer, mfpWidth, mfpHeight, ref ms);
                Bitmap bmp = new Bitmap(ms);
                //    this.pic.Image = bmp;
                {
                    int ret = zkfp.ZKFP_ERR_OK;
                    int fid = 0, score = 0;
                    ret = zkfp2.DBIdentify(mDBHandle, CapTmp, ref fid, ref score);
                    if (zkfp.ZKFP_ERR_OK == ret)
                    {
                        List <Model.T_Staff> staffList = list.Where(i => i.ZhiWenID.Split(',').Contains(fid.ToString())).ToList();
                        //   List<Model.T_Staff> staffList = T_Staff_Bll.GetUser(fid.ToString());
                        if (Global.GlobalFieid.LoginType == "1")
                        {
                            if (staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("7"))
                            {
                                Global.GlobalFieid.LoginName    = staffList.Select(k => k.LoginName).FirstOrDefault();
                                Global.GlobalFieid.UserName     = staffList.Select(k => k.StaffName).FirstOrDefault();
                                Global.GlobalFieid.User_Pic_Url = staffList.Select(k => k.TitileImagePath).FirstOrDefault();
                                Global.GlobalFieid.StaffID      = staffList.Select(k => k.StaffID).FirstOrDefault();
                                MyShowDialog();
                            }
                            else
                            {
                                lb_ZhiWen_Msg_2.Text      = "只能员工登入...";
                                lb_ZhiWen_Msg_2.ForeColor = Color.Red;
                                return;
                            }
                        }
                        else if (Global.GlobalFieid.LoginType == "2")
                        {
                            if (staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("2"))
                            {
                                Global.GlobalFieid.SquadLeaderID = staffList.Select(k => k.StaffID).FirstOrDefault();
                                MyShowDialog();
                                // DefWndProc_Click(null,null);
                                //  lb_ZhiWen_Msg_2.Text = "班长审核成功..";
                                //    this.button1.PerformClick();
                            }
                            else
                            {
                                lb_ZhiWen_Msg_2.Text      = "只能班长审核...";
                                lb_ZhiWen_Msg_2.ForeColor = Color.Red;
                                return;
                            }
                        }
                        else if (Global.GlobalFieid.LoginType == "3" || Global.GlobalFieid.LoginType == "4" || Global.GlobalFieid.LoginType == "5")
                        {
                            if (staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("5") || staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("6") || staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("8"))
                            {
                                if (staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("5"))
                                {
                                    if (!IsProduction)
                                    {
                                        IsProduction = true;
                                        Global.GlobalFieid.ProductionID = staffList.Select(k => k.StaffID).FirstOrDefault();
                                        lb_ZhiWen_Msg_1.Text            = "生产验证成功..";
                                        lb_ZhiWen_Msg_1.ForeColor       = Color.Green;
                                        if (IsProduction && IsQuailty && IsCraft)
                                        {
                                            MyShowDialog();
                                        }
                                    }
                                }
                                else if (staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("6"))
                                {
                                    if (!IsQuailty)
                                    {
                                        IsQuailty = true;
                                        Global.GlobalFieid.QuailtyID = staffList.Select(k => k.StaffID).FirstOrDefault();
                                        lb_ZhiWen_Msg_2.Text         = "质量验证成功..";
                                        lb_ZhiWen_Msg_2.ForeColor    = Color.Green;
                                        if (IsProduction && IsQuailty && IsCraft)
                                        {
                                            MyShowDialog();
                                        }
                                    }
                                }
                                else if (staffList.Select(k => k.RoleID).FirstOrDefault().ToString().Split(',').Contains("8"))
                                {
                                    if (!IsCraft)
                                    {
                                        IsCraft = true;
                                        Global.GlobalFieid.CraftID = staffList.Select(k => k.StaffID).FirstOrDefault();
                                        lb_ZhiWen_Msg_3.Text       = "工艺验证成功..";
                                        lb_ZhiWen_Msg_3.ForeColor  = Color.Green;
                                        if (IsProduction && IsQuailty && IsCraft)
                                        {
                                            MyShowDialog();
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (!IsProduction)
                                {
                                    lb_ZhiWen_Msg_1.Text      = "只能生产,质量,工艺审核";
                                    lb_ZhiWen_Msg_1.ForeColor = Color.Red;
                                }
                                else if (!IsQuailty)
                                {
                                    lb_ZhiWen_Msg_2.Text      = "只能生产,质量,工艺审核";
                                    lb_ZhiWen_Msg_2.ForeColor = Color.Red;
                                }
                                else if (!IsCraft)
                                {
                                    lb_ZhiWen_Msg_3.Text      = "只能生产,质量,工艺审核";
                                    lb_ZhiWen_Msg_3.ForeColor = Color.Red;
                                }
                                return;
                            }
                        }
                        //else if (Global.GlobalFieid.LoginType == "4")
                        //{

                        //}
                        //else if (Global.GlobalFieid.LoginType == "5")
                        //{

                        //}
                    }
                    else
                    {
                        if (Global.GlobalFieid.LoginType == "1")
                        {
                            lb_ZhiWen_Msg_2.Text      = "指纹识别失败";
                            lb_ZhiWen_Msg_2.ForeColor = Color.Red;
                        }
                        else if (Global.GlobalFieid.LoginType == "2")
                        {
                            lb_ZhiWen_Msg_2.Text      = "指纹识别失败";
                            lb_ZhiWen_Msg_2.ForeColor = Color.Red;
                        }
                        else if (Global.GlobalFieid.LoginType == "3")
                        {
                            if (!IsProduction)
                            {
                                lb_ZhiWen_Msg_1.Text      = "指纹识别失败";
                                lb_ZhiWen_Msg_1.ForeColor = Color.Red;
                            }
                            else if (!IsQuailty)
                            {
                                lb_ZhiWen_Msg_2.Text      = "指纹识别失败";
                                lb_ZhiWen_Msg_2.ForeColor = Color.Red;
                            }
                            else if (!IsCraft)
                            {
                                lb_ZhiWen_Msg_3.Text      = "指纹识别失败";
                                lb_ZhiWen_Msg_3.ForeColor = Color.Red;
                            }
                        }
                    }
                }
                break;

            default:
                base.DefWndProc(ref m);
                break;
            }
        }