public async void DistinguishUser(ushort fid, DateTime attendanceTime)
        {
            string pid = StorageControl.GetPerIDByFID(fid);

            if (pid == string.Empty)
            {
                ShowNoFound( );
                return;
            }

            PerInfo pi = await StorageControl.ReadPerInfo(pid);

            if (pi == null)
            {
                ShowNoFound( );
                return;
            }


            CommonRes.StorageControl.WriteAttendanceRecord(attendanceTime, fid);
            ShowAttendUser(pi.Name, pi.Department, attendanceTime);


            //var task = Dispatcher.RunAsync( CoreDispatcherPriority.High, ( ) =>
            //	{
            //		tblAttendanceMsg.Text = "用户:" + fid.ToString( ) + " 签到\r\n";
            //		tblAttendanceMsg.Text = tblAttendanceMsg.Text + attendanceTime.ToString( "HH:mm:ss" );
            //	}
            //);
        }
Example #2
0
    /// <summary>
    /// 初期化
    /// </summary>
    void Start()
    {
        this.control = this.GetComponent <StorageControl>();

        this.ioHandler      = new FinishHandler(this.IOHandler);
        this.storageManager = new StorageManager();
        this.usedSettings   = this.procSettings = new UserSettings();
        this.saveAllyStatus = this.procSaveAllyStatus = new SaveAllyStatus();

        // 例外
        this.UpdateDataInfo((IO_RESULT)999);
    }
        private async void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            if (lsvUser.SelectedItem == null)
            {
                await InfoDialog.ShowOK("请选择需要删除指纹信息的人员。");

                return;
            }

            if ((lsvUser.SelectedItem as custPerDisplayItem).FID != "")
            {
                if (await InfoDialog.ShowYesNo("确定删除指定人员的指纹信息吗?") == ContentDialogResult.Secondary)
                {
                    return;
                }

                await GPIOControl.PowerOnFingerprintPower( );

                try
                {
                    // Delete from fingerprint device
                    fgRemoveFingerprint cmd = new fgRemoveFingerprint(Convert.ToUInt16((lsvUser.SelectedItem as custPerDisplayItem).FID.Trim( )));
                    CommonResult        ret = await FingerprintDevice.Execute(cmd);

                    // Update compare file
                    await StorageControl.UpdateFIDByPID((lsvUser.SelectedItem as custPerDisplayItem).PID, string.Empty);
                    await LoadFingprinterInfo( );
                }
                catch (Exception ex)
                {
                    throw new CommonResult(ResultCode.GN_SYS_ERROR, ex.Message);
                }
                finally
                {
                    GPIOControl.PowerOffFingerprintPower( );
                }
            }
            else
            {
                await InfoDialog.ShowOK("指定的人员没有记录指纹信息。");
            }
        }
        /// <summary>
        /// 读取人员指纹信息到列表
        /// </summary>
        /// <returns></returns>
        private async Task LoadFingprinterInfo( )
        {
            // 判断当前列表的数据源是否已经指定
            if (lsvUser.ItemsSource == null)
            {
                // 建立数据源
                lsvUser.ItemsSource = new custPerDisplayItems( );
            }
            // 获取数据源连接
            custPerDisplayItems dit = lsvUser.ItemsSource as custPerDisplayItems;

            // 清理数据源
            dit.Clear( );
            PerInfoList user = await StorageControl.GetPerList( );

            // 添加数据源
            for (int i = 0; i < user.Count; i++)
            {
                dit.Add(new custPerDisplayItem((user[i].FID == "" ? "" : "ms-appx:Assets/FingerprintIcon.png"), user[i].Name, user[i].PID, user[i].FID));
            }
        }
        private async void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            if (lsvUser.SelectedItem == null)
            {
                await InfoDialog.ShowOK("请选择需要录入指纹信息的人员。");

                return;
            }

            string f = (lsvUser.SelectedItem as custPerDisplayItem).FID;

            if (f == "")
            {
                f = (lsvUser.SelectedItem as custPerDisplayItem).PID;
            }
            else
            {
                if (await InfoDialog.ShowYesNo("指定人员已经具有指纹信息,重新采集指纹将删除之前的指纹信息,确定需要更新指纹信息吗?") == ContentDialogResult.Secondary)
                {
                    return;
                }

                fgRemoveFingerprint cmd = new fgRemoveFingerprint(Convert.ToUInt16(f));
                CommonResult        ret = await FingerprintDevice.Execute(cmd);
            }

            FingerprintCollectDialog dialog = new FingerprintCollectDialog(Convert.ToUInt16(f));

            await dialog.ShowAsync( );

            if (dialog.DialogResult.Code == ResultCode.GN_SUCCESS)
            {
                await StorageControl.UpdateFIDByPID((lsvUser.SelectedItem as custPerDisplayItem).PID, f);
                await LoadFingprinterInfo( );
            }
        }
Example #6
0
        public async void Selecter(object sender)
        {
            //var SourceBool = (string)sender.CommandParameter;//FirstLastName (Prev_day or Percent)
            SelectPages = new ObservableCollection <PageViewModel>();//初期化
            //PageViewModel[] PageViewModels;

            var disp = Convert.ToBoolean(sender);

            if (disp == true)
            {
                //PageViewModels = new PageViewModel[]{new Page1ViewModel()};
                //this.SelectPages = new ObservableCollection<PageViewModel>{
                this.SelectPages = new ObservableCollection <PageViewModel> {
                    new Page1ViewModel {
                        Title1 = "Item1"
                    },
                    new Page1ViewModel {
                        Title1 = "Item2"
                    },
                    new Page1ViewModel {
                        Title1 = "Item3"
                    },
                    new Page1ViewModel {
                        Title1 = "Item4"
                    },
                    new Page1ViewModel {
                        Title1 = "Item5"
                    },
                    new Page1ViewModel {
                        Title1 = "Item6"
                    },
                    new Page1ViewModel {
                        Title1 = "Item7"
                    },
                    new Page1ViewModel {
                        Title1 = "Item8"
                    },
                    new Page1ViewModel {
                        Title1 = "Item9"
                    },
                    new Page1ViewModel {
                        Title1 = "Item10"
                    },
                    new Page1ViewModel {
                        Title1 = "Item11"
                    },
                    new Page1ViewModel {
                        Title1 = "Item12"
                    },
                    new Page1ViewModel {
                        Title1 = "Item13"
                    },
                    new Page1ViewModel {
                        Title1 = "Item14"
                    },
                    new Page1ViewModel {
                        Title1 = "Item15"
                    },
                    new Page1ViewModel {
                        Title1 = "Item16"
                    }
                };
            }
            else
            {
                // UTF8のファイルの書き込み Edit.
                string write = await StorageControl.PCLSaveCommand("6758,200,1665\n9837,200,712\n6976,200,1846\n6502,0,0"); //登録データ書き込み

                List <Price> pricesanser = await Models.PasonalGetserchi();                                                 //登録データの現在値を取得する

                int i = 0;

                foreach (Price item in pricesanser)
                {
                    SelectPages.Add(new Page2ViewModel
                    {
                        Name      = item.Name,      // "Sony",
                        Stocks    = item.Stocks,    //保有数*
                        Itemprice = item.Itemprice, //
                        Prev_day  = item.Prev_day,  //前日比±**
                        Realprice = item.Realprice, //現在値*// 1000,
                        RealValue = item.RealValue, // 100,
                        Percent   = item.Percent,   //前日比%**// "5"
                        Gain      = item.Gain,      //損益
                        Idindex   = i,
                        //    // ButtonColor = item.Polar,
                        Polar = item.Polar
                                //    //FirstLastName = item.FirstLastName
                    });
                }

                //ListView ItemsSource
                //this.SelectPages = new ObservableCollection<PageViewModel>(PageViewModels);
            }
        }