Exemplo n.º 1
0
 private void Delete_Click(object sender, RoutedEventArgs e)
 {
     autoRead_Timer.Stop();//暂时停止读卡
     CancelTips("确定要删除吗?", new Action <bool>(isTrue =>
     {
         if (isTrue)
         {
             Console.WriteLine("删除ing......................");
             #region 本地删除
             DataModel obj = (DataModel)datagrid.SelectedItem;
             List <InfoListModel> lists  = SettingJsonConfig.readData() ?? new List <InfoListModel>();
             InfoListModel infoListModel = lists.Where(u => u.acidNo == obj.acidNo.ToString()).SingleOrDefault();
             lists.Remove(infoListModel);       //移除
             SettingJsonConfig.saveData(lists); //保存
             #endregion
             #region  务器删除
             Acid.http.Library.ResponseModel.ResultJson <string> resultJson = InfoListService.deleteNucleic(new InfoListModel()
             {
                 acidNo = obj.acidNo.ToString()
             });
             datagrid.ItemsSource = null;
             clearData            = true;
             Items2 = new List <DataModel>();
             datagrid.ItemsSource = Items2;
             #endregion
             //删除
             Console.WriteLine("删除:" + obj.acidNo);
         }
         else
         {
             Console.WriteLine("取消删除....................");
         }
         autoRead_Timer.Start();//重新读卡
     }));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 上传数据到线上
        /// </summary>
        /// <param name="dataModel"></param>
        /// <param name="snowID"></param>
        /// <returns></returns>
        private ResultJson <string> Saveonline(InfoListModel dataModel)
        {
            List <InfoListModel> infoListModels = new List <InfoListModel>();
            InfoListModel        infoListModel  = new InfoListModel()
            {
                address       = dataModel.address,
                cardNo        = dataModel.cardNo,
                createTime    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                sex           = dataModel.sex == "男" ? "1" : "0",
                userName      = dataModel.userName,
                serialNumber  = deviceSerialNumber,
                updateText    = "编辑",
                acidNo        = dataModel.acidNo.ToString(),
                detectionName = detectionName,
                updateName    = detectionName,
                homeAddress   = dataModel.homeAddress,
                company       = dataModel.company,
                jcdName       = CommonHelper.jcdName,
                xzjdName      = CommonHelper.xzjdName,
                cydName       = CommonHelper.cydName,
                districtName  = CommonHelper.districtName
            };

            infoListModels.Add(infoListModel);
            Acid.http.Library.ResponseModel.ResultJson <string> resultJson = InfoListService.addNucleic(infoListModels);
            return(resultJson);
        }
Exemplo n.º 3
0
 private void saveAndPrint(DataModel selectedItem)
 {
     Console.WriteLine("打印ing......................");
     selectedItem.acidNo = long.Parse(UniqueData.Gener(""));
     //同步线上
     Acid.http.Library.ResponseModel.ResultJson <string> resultJson = saveonline(selectedItem);
     if (resultJson.code == "20000")
     {
         //保存本地
         savedata(selectedItem, 1);
     }
     else
     {
         //保存本地
         savedata(selectedItem, 0);
     }
     PrintHelper.Print(selectedItem.temp.Trim());
 }
Exemplo n.º 4
0
 private void SaveAndPrint(InfoListModel selectedItem)
 {
     Console.WriteLine("打印ing......................");
     selectedItem.acidNo = UniqueData.Gener("");
     //同步线上
     Acid.http.Library.ResponseModel.ResultJson <string> resultJson = Saveonline(selectedItem);
     if (resultJson.code == "20000")
     {
         //保存本地
         Savedata(selectedItem, 1);
     }
     else
     {
         //保存本地
         Savedata(selectedItem, 0);
     }
     Console.WriteLine("打印:" + selectedItem.cardNo);
     PrintHelper.Print(selectedItem.cardNo.Trim());
 }
Exemplo n.º 5
0
        /// <summary>
        /// 上传数据到线上
        /// </summary>
        /// <param name="dataModel"></param>
        /// <param name="snowID"></param>
        /// <returns></returns>
        private ResultJson <string> saveonline(DataModel dataModel)
        {
            List <InfoListModel> infoListModels = new List <InfoListModel>();
            InfoListModel        infoListModel  = new InfoListModel()
            {
                address       = dataModel.home,
                cardNo        = dataModel.temp,
                createTime    = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                sex           = dataModel.Sex == "男" ? "1" : "0",
                userName      = dataModel.SName,
                serialNumber  = deviceSerialNumber,
                updateText    = "编辑",
                acidNo        = dataModel.acidNo.ToString(),
                detectionName = detectionName,
                updateName    = detectionName,
                homeAddress   = dataModel.homeAddress
            };

            infoListModels.Add(infoListModel);
            Acid.http.Library.ResponseModel.ResultJson <string> resultJson = InfoListService.addNucleic(infoListModels);
            return(resultJson);
        }