public string Add(T_Staff entity) { try { return(dalStaff.Insert(entity)); } catch (Exception exc) { LogHelper.log.Fatal("类:" + this.GetType().ToString() + ",方法:Add发生异常,异常信息为:" + exc.Message); return(Common.SystemVar.SystemVar.Exception); } }
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_msg.Text = "指纹识别成功,匹配度=" + score + "%"; Bll.T_Staff t_Staff = new T_Staff(); DataTable user = t_Staff.GetUserID(fid.ToString()); string userId = user.Rows[0]["StaffID"].ToString(); Bll.User.UserID = userId; zkfp2.Terminate(); cbRegTmp = 0; if (captureThread != null) { captureThread.Abort(); } //close device bIsTimeToDie = true; RegisterCount = 0; Thread.Sleep(1000); zkfp2.CloseDevice(mDevHandle); MangJianFrm f = new MangJianFrm(); f.Owner = this; this.Hide(); f.ShowDialog(); Application.ExitThread(); } else { lb_msg.Text = "指纹识别失败,状态码=" + ret; return; } } break; default: base.DefWndProc(ref m); break; } }
public string[] getStaffInfo(string T_StaffID) { string[] info = new string[10]; T_Staff staff = new T_Staff(); staff.F_staffID = T_StaffID; staff = dalStaff.Select(staff); info[0] = staff.F_staffName; info[1] = staff.F_sex; info[2] = staff.F_age.ToString(); info[3] = staff.F_phone; return(info); }
public T_Staff Get(T_Staff entity, out string message) { try { message = Common.SystemVar.SystemVar.Success; return(dalStaff.Select(entity)); } catch (Exception exc) { message = Common.SystemVar.SystemVar.Exception; return(null); } }
public void addStaff(string[] info) { T_Staff staff = new T_Staff(); staff.F_staffID = info[0]; staff.F_staffName = info[1]; staff.F_sex = info[2]; staff.F_age = 0; staff.F_phone = info[4]; staff.F_startWorkTime = DateTime.Now; staff.F_address = info[5]; string message = dalStaff.Insert(staff); }
private void InitDevices() { reader = new SrrReader("COM4"); reader.ConnDevice(); LedPalyer = new LEDPlayer("COM28"); reader.Read(new Action <string>((string data) => { string message = ""; T_Staff staff = bllStaff.Get(new T_Staff { F_staffID = data }, out message); if (staff == null) { dispatcher.Invoke(() => { ClearViewValue(); txtID.Text = data; }); } else { // bllStaffSign.Add(new T_StaffSign { F_ClassRoomID = "cdb3876d-d6da-4c2d-bbea-d8150d7c3e9a", F_ClassRoomName = "501-学生工作室", F_SignTime = DateTime.Now, F_StaffID = data, F_StaffName = staff.F_staffName }); //显示到LED屏上 LedPalyer.DisplayText(staff.F_staffName + "签到成功!"); dispatcher.Invoke(() => { ClearViewValue(); txtID.Text = staff.F_staffID; txtName.Text = staff.F_staffName; txtIntime.Text = staff.F_startWorkTime.ToString(); txtSex.Text = staff.F_sex; txtPhone.Text = staff.F_phone; txtAge.Text = staff.F_age + ""; txtAddress.Text = staff.F_address; dataSignHistory.ItemsSource = bllStaffSign.GetList(out message); }); } })); }
public TellerEdit(T_Staff ts) { InitializeComponent(); this.SetViewModelValue("Staff_Info", ts); }
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; { bool verify = false; 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) { label1.Text = "指纹识别成功,匹配度=" + score + "%"; BLL.T_Staff t_Staff = new T_Staff(); DataTable user = t_Staff.GetUserID(fid.ToString()); for (int i = 0; i < user.Rows.Count; i++) { string zIDs = user.Rows[i]["ZhiWenID"].ToString(); List <string> list = zIDs.ToString().Split(',').ToList(); if (list.Contains(fid.ToString())) { string userId = user.Rows[i]["StaffID"].ToString(); verify = t_Staff.GetRoleID(userId); } } if (verify) { DialogResult = DialogResult.OK; CloseDevice(); this.Close(); } else { label1.Text = "无班长权限,请重新输入!"; } //Bll.User.UserID = userId; //zkfp2.Terminate(); //cbRegTmp = 0; //if (captureThread != null) //{ // captureThread.Abort(); //} //MangJianFrm f = new MangJianFrm(); //f.Owner = this; //this.Hide(); //f.ShowDialog(); //Application.ExitThread(); } else { label1.Text = "指纹识别失败,状态码=" + ret; return; } } break; default: base.DefWndProc(ref m); break; } }
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) { try { lb_msg.Text = "指纹识别成功,匹配度=" + score + "%"; Bll.T_Staff t_Staff = new T_Staff(); DataTable user = t_Staff.GetUserID(fid.ToString()); string userId = user.Rows[0]["StaffID"].ToString(); Bll.User.UserID = userId; bool result = t_Staff.GetRoleID(userId); //MessageBox.Show(result.ToString()); if (result) { this.DialogResult = DialogResult.OK; zkfp2.Terminate(); cbRegTmp = 0; if (captureThread != null) { captureThread.Abort(); } this.Close(); } else { //MessageBox.Show("请班长输入指纹!"); lb_msg.BackColor = Color.Red; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } } else { lb_msg.Text = "指纹识别失败,状态码=" + ret; return; } } break; default: base.DefWndProc(ref m); break; } }
//删除柜员 private bool DeleteTeller(T_Staff item) { return(ExamHandle.TryExecute(SQL.DELETESTAFF, item.Key)); }
public ThExamReportCard(T_Staff staffInfo, float totalScore) { InitializeComponent(); this.SetViewModelValue("StaffInfo", staffInfo); this.SetViewModelValue("TotalScore", totalScore); }