private void RefreshMemberListPassively() { var currentCheckInType = this.getCheckInType(); var checkInAddress = this.GetCheckInLocation(); Task.Run(async() => { try { await MemberCheckInSingletonService.getAllMemberCheckInOnToday(currentCheckInType, checkInAddress); this.m_SyncContext.Post(context => { List <MemberCheckIn> data = context as List <MemberCheckIn>; var total = data.Count(item => item.status == CheckInStatus.Waiting); this.toolStripProgressBar1.Step = 100 / total; this.toolStripProgressBar1.Value = 0; this.toolStripStatusLabel1.Text = $"[{total}条记录]准备中..."; }, MemberCheckInSingletonService.Instance.membercheckinlist); } catch (Exception ex) { MessageBox.Show(ex.Message); throw ex; } }); }
/// <summary> /// 打卡类型变化事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void checkin_type_combox_SelectedValueChanged(object sender, EventArgs e) { if (!this.Initialized) { return; } await MemberCheckInSingletonService.getAllMemberCheckInOnToday(this.getCheckInType(), this.GetCheckInLocation()); }
private async void Init() { this.checkin_type_combox.SelectedIndex = 0; user = new AddUserDAL(); await this.BindCheckInAddressDataMember(); await MemberCheckInSingletonService.getAllMemberCheckInOnToday(this.getCheckInType(), this.GetCheckInLocation()); await FaceSyncService.Instance.Run(); this.Initialized = true; }
// 重置打卡 private void button3_Click(object sender, EventArgs e) { if (!this.Initialized) { return; } List <string> resetCheckInItems = new List <string>(); for (int i = 0; i < this.error_checkin_datagrid.RowCount; i++) { if ((bool)this.error_checkin_datagrid.Rows[i].Cells[0].Value) { Member member = (Member)this.error_checkin_datagrid.Rows[i].DataBoundItem; resetCheckInItems.Add(member.ID); } } if (resetCheckInItems.Count > 0) { var currentCheckInType = this.getCheckInType(); var checkInAddress = this.GetCheckInLocation(); Task.Run(async() => { bool result = await MemberCheckInSingletonService.resetErrorCheckIn(resetCheckInItems); if (!result) { MessageBox.Show("重置打卡失败."); return; } try { await MemberCheckInSingletonService.getAllMemberCheckInOnToday(currentCheckInType, checkInAddress); } catch (Exception ex) { MessageBox.Show(ex.Message); throw ex; } }); } else { MessageBox.Show("请选择所需要重置打卡的人员"); } }
//左导航栏选择 private async void tabControl1_Selected(object sender, TabControlEventArgs e) { if (!this.Initialized) { return; } if (e.TabPage.Text == "会员列表") { await this.BindDataMemberList(); } /*else if (e.TabPage.Text == "会员注册") * { * this.checkin_address_combox.DataSource = await user.getCheckInAddressList(); * this.checkin_address_combox.DisplayMember = "text"; * this.checkin_address_combox.ValueMember = "value"; * this.checkin_address_combox.SelectedIndex = 0; * }*/ else if (e.TabPage.Text == "打卡管理") { await MemberCheckInSingletonService.getAllMemberCheckInOnToday(this.getCheckInType(), this.GetCheckInLocation()); } }