private void TransforTool(Tool tool) { var t = ObjectCopier.DeepCopyByReflect(tool); if (t.ToolState.Name != "正常") { MessageAlert.Alert("当前工具状态不可借出!"); return; } //判断重复 if (ExistBarcode(tool.Barcode)) { return; } ToolRecord rcd = new ToolRecord() { ToolId = t.Id, BorrowerId = Borrower.Id, BorrowOperatorId = BorrowOperator.Id, BorrowTime = DateTime.Now, ExceptReturnTime = this.ExceptReturnTime, Tool = tool }; ToolRecords.Add(rcd); }
private void SearchUser() { //查询用户 UserDao userDao = new UserDao(); var rlt = userDao.GetUser(Borrower.CardNo); if (rlt.HasError) { MessageAlert.Alert(rlt.Msg); return; } if (rlt.Entities == null || rlt.Entities.Id == 0) { MessageAlert.Alert("卡号不存在!"); return; } Borrower = ObjectCopier.DeepCopyByReflect(rlt.Entities); }
private void TransforUser(User user) { Borrower = ObjectCopier.DeepCopyByReflect(user); MessengerInstance.Send <string>(Borrower.ImagePath, MsgToken.ShowImage); ToolRecordDao dao = new ToolRecordDao(); var rlt = dao.GetNotReturnToolRecords(Borrower.Id); if (rlt.HasError) { MessageAlert.Alert(rlt.Msg); return; } ToolRecords.Clear(); if (rlt.Entities != null && rlt.Entities.Count > 0) { foreach (var r in rlt.Entities) { ToolRecords.Add(r); } } }
private void TransforUser(User user) { Borrower = ObjectCopier.DeepCopyByReflect(user); MessengerInstance.Send <string>(Borrower.ImagePath, MsgToken.ShowImage); }