private async Task FinePayment() { try { var borrowId = Guid.Parse(Gv_Borrows.GetFocusedRowCellValue("Id").ToString()); var penalty = Convert.ToDouble(Gv_Borrows.GetFocusedRowCellValue("Fine")); var result = await _finePaymentApi.CreateFinePayment(new FinePayment { BorrowId = borrowId, Fine = penalty, IsPay = true, PayType = "移动支付", AdminId = GlobalCache.Admin.Id }); if (result.ResultCode != 1) { PopupProvider.Warning(result.ResultMessage); return; } PopupProvider.Success(result.ResultMessage); } catch (Exception e) { PopupProvider.Error("新增罚款登记单异常!!", e); } }
private async void Gv_Borrows_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { try { if (Gv_Borrows.FocusedRowHandle < 0) { return; } var isExpired = Convert.ToBoolean(Gv_Borrows.GetFocusedRowCellValue("IsExpired")); Sb_PayFine.Enabled = isExpired; var id = Guid.Parse(Gv_Borrows.GetFocusedRowCellValue("BookId").ToString()); var book = await _bookApi.GetBook(id); book.Photo = Image.FromFile(book.BookPhoto); Pe_Photo.Image = book.Photo; Te_BookId.EditValue = book.Id; Te_BookName.Text = book.BookName; Te_Author.Text = book.Author; Te_PublishingHouse.Text = book.PublishingName; Te_Category.Text = book.CategoryName; Te_Price.EditValue = book.Price; Te_ISBN.Text = book.ISBN; Te_ReleaseTime.EditValue = book.ReleaseDate; } catch (Exception exception) { PopupProvider.Error("获取借阅书籍信息异常!", exception); } }