private async void Sb_Query_Click(object sender, EventArgs e) { try { _handle = OverlayScreenForm.ShowProgressPanel(this); var dic = new Dictionary <string, object>() { { "CreateTime", $"{De_Begin.DateTime}" }, { "BookName", Te_BookName.Text } }; var data = await _api.GetBooks(dic); foreach (var book in data) { book.Photo = Image.FromFile(book.BookPhoto); } Gc_Data.DataSource = data; } catch (Exception ex) { PopupProvider.Error("获取数据异常!", ex); } finally { OverlayScreenForm.CloseProgressPanel(_handle); } }
private async Task BindChartData() { try { _handle = OverlayScreenForm.ShowProgressPanel(this); #region 饼状图 var data = await _api.GetBookChartByCategory(); Ct_BookCategorySum.DataSource = data; var series = Ct_BookCategorySum.Series[0]; series.ValueDataMembers[0] = "Number"; series.ArgumentDataMember = "CategoryName"; var label = (PieSeriesLabel)series.Label; label.TextPattern = "{A}: {VP:P0}"; var title = new ChartTitle { Text = @"馆藏图书分类汇总", Alignment = StringAlignment.Center }; Ct_BookCategorySum.Titles.Add(title); #endregion #region 柱状图 var borrowCharts = await _api.GetBorrowByDayChart(); Ct_Bar.DataSource = borrowCharts; var barSeries = Ct_Bar.Series[0]; barSeries.ValueDataMembers[0] = "Number"; barSeries.ArgumentDataMember = "CreateDate"; var barLabel = (BarSeriesLabel)barSeries.Label; barLabel.TextPattern = "{A}: {V}"; var barTitle = new ChartTitle { Text = @"近一周借阅统计", Alignment = StringAlignment.Center }; Ct_Bar.Titles.Add(barTitle); #endregion #region 数据合计展示 var booksTotal = await new BookApi().GetBookTotal(); var borrowsTotal = await new BorrowApi().GetBorrowTotal(); var studentsTotal = await new StudentApi().GetStudentTotal(); var employeesTotal = await new EmployeeApi().GetEmployeeTotal(); var reservationTotal = await new ReservationApi().GetReservationTotal(); Tbi_Books.Elements[1].Text = booksTotal.ToString(); Tbi_Borrows.Elements[1].Text = borrowsTotal.ToString(); Tbi_Employees.Elements[1].Text = employeesTotal.ToString(); Tbi_Students.Elements[1].Text = studentsTotal.ToString(); Tbi_Reservations.Elements[1].Text = reservationTotal.ToString(); #endregion OverlayScreenForm.CloseProgressPanel(_handle); } catch (Exception e) { OverlayScreenForm.CloseProgressPanel(_handle); PopupProvider.Error("获取图表数据或合计数据异常!", e); } }
private async void Gv_Reservations_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e) { if (Gv_Reservations.FocusedRowHandle < 0) { return; } var id = Guid.Parse(Gv_Reservations.GetFocusedRowCellValue("BookId").ToString()); try { 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); } }
private async void Sb_Update_Click(object sender, EventArgs e) { try { if (Gv_PublishingHouses.FocusedRowHandle < 0) { return; } var name = Gv_PublishingHouses.GetFocusedRowCellDisplayText("PublishingName"); var id = Gv_PublishingHouses.GetFocusedRowCellDisplayText("Id"); var result = XtraInputBox.Show("请输入", "修改出版社信息", name); if (string.IsNullOrEmpty(result)) { return; } var resultMessage = await _propertiesApi.UpdatePublishingHouse(id, result); if (resultMessage.ResultCode != 1) { PopupProvider.Warning(resultMessage.ResultMessage); return; } PopupProvider.Success(resultMessage.ResultMessage); } catch (Exception exception) { PopupProvider.Error("添加异常!", exception); } }
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); } }
private async void Ribe_Return_ButtonClick(object sender, ButtonPressedEventArgs e) { try { if (!Gv_Borrows.GetFocusedRowCellDisplayText("ReturnState").Equals("未归还")) { PopupProvider.Warning("该书已归还!"); return; } var dialogResult = XtraMessageBox.Show("确认归还?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResult != DialogResult.Yes) { return; } _handle = OverlayScreenForm.ShowProgressPanel(this); var id = Gv_Borrows.GetFocusedRowCellDisplayText("Id"); var result = await _borrowApi.ReturnBook(id); OverlayScreenForm.CloseProgressPanel(_handle); if (result.ResultCode != 1) { PopupProvider.Warning(result.ResultMessage); } PopupProvider.Success(result.ResultMessage); await BindData(); } catch (Exception exception) { OverlayScreenForm.CloseProgressPanel(_handle); PopupProvider.Error(exception.Message, exception); } }
private async void Sb_Update_Click(object sender, EventArgs e) { try { if (Gv_Categories.FocusedRowHandle < 0) { return; } var id = Gv_Categories.GetFocusedRowCellValue("Id").ToString(); var categoryName = Gv_Categories.GetFocusedRowCellDisplayText("CategoryName"); var result = XtraInputBox.Show(this, "请输入", "修改书籍类别信息", categoryName, MessageBoxButtons.YesNo); if (string.IsNullOrEmpty(result)) { return; } var resultMessage = await _propertiesApi.UpdateCategory(id, result); if (resultMessage.ResultCode != 1) { PopupProvider.Warning(resultMessage.ResultMessage); return; } PopupProvider.Success(resultMessage.ResultMessage); } catch (Exception exception) { PopupProvider.Error("修改异常!", exception); } }
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); } }
/// <summary> /// 绑定学生信息数据 /// </summary> /// <returns></returns> private async Task BindStudentInfo() { var studentNo = Te_StudentNo.Text; try { _handle = OverlayScreenForm.ShowProgressPanel(this); var students = await _api.GetStudents(new Dictionary <string, object> { { "StudentNo", studentNo } }); var student = students.FirstOrDefault(); if (student == null) { PopupProvider.Warning("未检索到信息!"); return; } Te_Age.EditValue = student.Age; Te_Name.Text = student.StudentName; Te_Class.Text = student.Class; Te_Sex.Text = student.Sex ? "女" : "男"; Te_Department.Text = student.DepartmentName; Te_Phone.EditValue = student.Contact; Te_Email.Text = student.Email; Te_StudentNo.EditValue = student.StudentNo; Te_StudentId.Text = student.Id.ToString(); #region 获取当前学生剩余可借阅数量 var num = await _borrowApi.GetBorrowInfoTotal(Te_StudentId.Text); if (num != -1) { Te_BooksNum.EditValue = 3 - num; } else { Te_BooksNum.EditValue = 3; } #endregion OverlayScreenForm.CloseProgressPanel(_handle); } catch (Exception e) { OverlayScreenForm.CloseProgressPanel(_handle); PopupProvider.Error("获取学生信息异常!", e); LogHelper.Error(e.ToString()); } }
public async Task BindData() { try { var data = await _api.GetStudents(true); Gc_Students.DataSource = data; } catch (Exception exception) { PopupProvider.Error("获取学生信息数据异常!", exception); } }
public async Task BindData() { try { var data = await _api.GetBookCategories(); Gc_Categories.DataSource = data; } catch (Exception e) { PopupProvider.Error("获取数据异常!", e); } }
// ReSharper disable once MemberCanBePrivate.Global public async Task BindData() { try { var data = await _api.GetBooksInfo(); Gc_BooksInfo.DataSource = data; } catch (Exception e) { PopupProvider.Error("获取书籍信息异常!", e); } }
public async Task BindData() { try { var data = await _reservationApi.GetReservations(true); Gc_Reservations.DataSource = data; } catch (Exception exception) { PopupProvider.Error("获取预约信息异常!", exception); } }
public async Task BindData() { try { var data = await _api.GetPublishingHouses(); Gc_PublishingHouses.DataSource = data; } catch (Exception e) { PopupProvider.Error("获取出版社信息异常!", e); } }
public async Task BindData() { try { var data = await _api.GetEmployees(true); Gc_Employees.DataSource = data; } catch (Exception exception) { PopupProvider.Error("获取员工数据异常!", exception); } }
private async void Sb_Save_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(Te_StudentId.Text)) { PopupProvider.Warning("请填写借阅人信息!"); return; } _handle = OverlayScreenForm.ShowProgressPanel(this); var infosTotal = Convert.ToInt32(Te_BooksNum.Text); if (infosTotal <= 0) { OverlayScreenForm.CloseProgressPanel(_handle); PopupProvider.Warning("已达最大可借阅数!"); return; } var books = (List <Borrow>)Gv_BookInfos.DataSource; var borrows = books.Select(m => new Borrow { StudentId = Guid.Parse(Te_StudentId.Text), AdminId = GlobalCache.Admin.Id, EndTime = DateTime.Now.AddDays(21), BackTime = DateTime.MaxValue, BookId = m.BookId }).ToList(); var res = await _borrowApi.CreateBorrows(borrows); if (res.ResultCode != 1) { OverlayScreenForm.CloseProgressPanel(_handle); PopupProvider.Warning(res.ResultMessage); return; } OverlayScreenForm.CloseProgressPanel(_handle); Gc_BookInfos.DataSource = new List <Borrow>(); Clear(3); Te_BooksNum.Text = string.Empty; Te_StudentId.Text = string.Empty; PopupProvider.Success(res.ResultMessage); } catch (Exception exception) { OverlayScreenForm.CloseProgressPanel(_handle); PopupProvider.Error("操作异常!", exception); } }
/// <summary> /// 绑定学生信息数据 /// </summary> /// <returns></returns> private async Task BindStudentInfo() { var studentNo = Te_StudentNo.Text; try { var students = await _api.GetStudents(new Dictionary <string, object> { { "StudentNo", studentNo } }); var student = students.FirstOrDefault(); if (student == null) { PopupProvider.Warning("未检索到信息!"); return; } Te_Age.EditValue = student.Age; Te_Name.Text = student.StudentName; Te_Class.Text = student.Class; Te_Sex.Text = student.Sex ? "女" : "男"; Te_Department.Text = student.DepartmentName; Te_Phone.EditValue = student.Contact; Te_Email.Text = student.Email; Te_StudentNo.EditValue = student.StudentNo; Te_StudentId.Text = student.Id.ToString(); #region 获取当前学生剩余可预约数量 var num = await _reservationApi.GetReservationInfoTotal(Te_StudentId.Text); if (num != -1) { Te_BooksNum.EditValue = 2 - num; } else { Te_BooksNum.EditValue = 2; } #endregion } catch (Exception e) { PopupProvider.Error("获取学生信息异常!", e); LogHelper.Error(e.ToString()); } }
private async void Sb_AddOrUpdate_Click(object sender, EventArgs e) { try { if (!Dvp_Validate.Validate()) { return; } JsonMessageResult messageResult; var bookInfo = new BookInfo { BookName = Te_BookName.Text, Author = Te_Author.Text, ISBN = Te_Isbn.Text, BookPhoto = _imageUrl, PublishingId = Guid.Parse(Lue_PublishingHouse.EditValue.ToString()), BookCategoryId = Guid.Parse(Lue_BookCategories.EditValue.ToString()), Price = Convert.ToDecimal(Te_Price.EditValue), ReleaseDate = De_ReleaseDate.DateTime }; if (!_addOrUpdate) { bookInfo.Id = Id; messageResult = await _api.UpdateBookInfo(bookInfo); } else { messageResult = await _api.CreateBooksInfo(bookInfo); } if (messageResult.ResultCode != 1) { XtraMessageBox.Show(messageResult.ResultMessage); return; } XtraMessageBox.Show("操作成功!"); CloseForm(); } catch (Exception exception) { PopupProvider.Error("操作异常!", exception); } }
private async void Sb_Query_Click(object sender, EventArgs e) { try { var dic = new Dictionary <string, object> { { "BeginDate", De_Begin.DateTime }, { "EndDate", De_End.DateTime }, { "SearchPara", Te_SearchPara.Text } }; var data = await _reservationApi.GetReservations(dic); Gc_Reservations.DataSource = data; } catch (Exception exception) { PopupProvider.Error("查询异常!", exception); } }
private async void Ribe_Delete_ButtonClick(object sender, ButtonPressedEventArgs e) { if (Gv_Reservations.FocusedRowHandle < 0) { return; } try { var isRemove = Convert.ToBoolean(Gv_Reservations.GetFocusedRowCellValue("IsRemove")); if (isRemove) { PopupProvider.Warning("该预约记录已删除!"); return; } if (Convert.ToInt32(e.Button.Tag) == 1) { return; } if (XtraMessageBox.Show("确认删除!", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) { return; } var id = Gv_Reservations.GetFocusedRowCellDisplayText("Id"); var result = await _reservationApi.DeleteReservation(id); if (result.ResultCode != 1) { PopupProvider.Warning(result.ResultMessage); return; } PopupProvider.Success(result.ResultMessage); } catch (Exception exception) { PopupProvider.Error("操作异常!", exception); } }
private async void Rits_Toggle_Toggled(object sender, EventArgs e) { try { var id = Guid.Parse(Gv_Categories.GetFocusedRowCellValue("Id").ToString()); var toggle = (ToggleSwitch)sender; var result = await _propertiesApi.UpdateBookCategory(id, Convert.ToBoolean(toggle.EditValue)); if (result.ResultCode != 1) { PopupProvider.Warning(result.ResultMessage); return; } PopupProvider.Success(result.ResultMessage); } catch (Exception exception) { PopupProvider.Error("修改状态异常!", exception); } }
public async Task BindData() { try { var data = await _borrowApi.GetBorrows(true); foreach (var borrow in data) { borrow.ReturnState = borrow.BackTime.ToString("yyyy-MM-dd HH:mm:ss") .Equals(DateTime.MaxValue.ToString("yyyy-MM-dd HH:mm:ss")) ? "未归还" : borrow.BackTime.ToString("yyyy-MM-dd HH:mm:ss"); } Gc_Borrows.DataSource = data; } catch (Exception exception) { PopupProvider.Error("获取借阅信息异常!", exception); } }
private async void Sb_Query_Click(object sender, EventArgs e) { try { var dic = new Dictionary <string, object> { { "CreateTime", $"{De_Begin.DateTime}~{De_End.DateTime}" }, { "EmployeeName%", Te_Name.Text } }; if (string.IsNullOrEmpty(Te_Name.Text)) { dic.Remove("EmployeeName%"); } var data = await _api.GetEmployees(dic); Gc_Employees.DataSource = data; } catch (Exception exception) { PopupProvider.Error("查询员工数据异常!", exception); } }
private async void Bbi_UpdatePassword_ItemClick(object sender, ItemClickEventArgs e) { try { var result = XtraInputBox.Show("请输入", "修改密码", "请输入新密码!"); if (string.IsNullOrEmpty(result)) { return; } var res = await new AdminApi().UpdateAdminPassword(GlobalCache.Admin.Id, result); if (res.ResultCode != 1) { PopupProvider.Warning(res.ResultMessage); return; } PopupProvider.Success(res.ResultMessage); } catch (Exception exception) { PopupProvider.Error("修改异常!", exception); } }
private async void Sb_Add_Click(object sender, EventArgs e) { try { var result = XtraInputBox.Show(this, "请输入", "新增书籍类别信息", "", MessageBoxButtons.OK); if (string.IsNullOrEmpty(result)) { return; } var resultMessage = await _api.CreateBookCategory(new BookCategory { CategoryName = result }); if (resultMessage.ResultCode != 1) { PopupProvider.Warning(resultMessage.ResultMessage); return; } PopupProvider.Success(resultMessage.ResultMessage); } catch (Exception exception) { PopupProvider.Error("新增异常!", exception); } }
public async Task BindData() { try { _handle = OverlayScreenForm.ShowProgressPanel(this); var data = await _api.GetBooks(false); foreach (var book in data) { book.Photo = Image.FromFile(book.BookPhoto); } Gc_Data.DataSource = data; } catch (Exception ex) { PopupProvider.Error("获取数据异常!", ex); } finally { OverlayScreenForm.CloseProgressPanel(_handle); } }
private async void Sb_Add_Click(object sender, EventArgs e) { try { var result = XtraInputBox.Show("请输入", "新增出版社信息", string.Empty); if (string.IsNullOrEmpty(result)) { return; } var resultMessage = await _api.CreatePublishingHouse(new PublishingHouse { PublishingName = result }); if (resultMessage.ResultCode != 1) { PopupProvider.Warning(resultMessage.ResultMessage); return; } PopupProvider.Success(resultMessage.ResultMessage); } catch (Exception exception) { PopupProvider.Error("添加异常!", exception); } }
private async Task BindBookInfo() { try { var searchPara = Te_SearchPara.Text.Trim(); //获取模糊查询书籍信息 _handle = OverlayScreenForm.ShowProgressPanel(this); var bookInfos = await _bookInfoApi.GetBooksInfo(false); bookInfos = bookInfos .Where(m => m.Id.ToString().Contains(searchPara) || m.BookName.Contains(searchPara)).ToList(); OverlayScreenForm.CloseProgressPanel(_handle); if (bookInfos.Count == 0) { PopupProvider.Warning("未检索到信息!"); return; } //找到对应的书籍信息的已上架书籍 var books = new List <Book>(); foreach (var info in bookInfos) { books.AddRange(await _bookApi.GetBooks(new Dictionary <string, object> { { "BookInfoId", info.Id } })); } foreach (var item in books) { switch (item.BookState) { case 0: item.BookStateName = "正常"; break; case 1: item.BookStateName = "已借阅"; break; case 2: item.BookStateName = "已预约"; break; } } //如果存在多个数据,采用列表显示,操作员自行选择. if (books.Count > 1) { Gc_Books.DataSource = books; Gc_Books.Visible = true; Gv_Books.Focus(); return; } if (books.Count == 0) { PopupProvider.Warning("未找到可借阅的相应书籍!"); return; } //如果只有一条数据则进行数据赋值展示 var book = books.First(); var reservation = await _reservationApi.GetReservations(new Dictionary <string, object> { { "BookId", book.Id }, { "IsRemove", false }, { "StudentId", Te_StudentId.Text } }); if (reservation.Count <= 0 && book.BookStateName.Equals("已预约")) { PopupProvider.Warning($"{book.BookStateName}书籍不可借阅!"); return; } if (book.BookStateName.Equals("已借阅")) { PopupProvider.Warning($"{book.BookStateName}书籍不可借阅!"); return; } Te_BookName.Text = book.BookName; Te_Author.Text = book.Author; Te_ReleaseTime.EditValue = book.ReleaseDate; Te_PublishingHouse.Text = book.PublishingName; Te_Category.Text = book.CategoryName; Pe_BookPhoto.Image = Image.FromFile(book.BookPhoto); Te_BookId.Text = book.Id.ToString(); Te_ISBN.Text = book.ISBN; Te_ReleaseTime.Text = book.ReleaseDate.ToString("yyyy-MM-dd"); Te_Price.Text = book.Price.ToString("F"); } catch (Exception e) { PopupProvider.Error("获取数据信息异常!", e); } }
private async Task BindBookInfo() { try { var searchPara = Te_SearchPara.Text.Trim(); //获取模糊查询书籍信息 var bookInfos = await _bookInfoApi.GetBooksInfo(new Dictionary <string, object>() { { "%BookName", $"%{searchPara}%" }, { "IsRemove", false } }); if (bookInfos.Count == 0) { PopupProvider.Warning("未检索到信息!"); return; } if (bookInfos.Count > 1) { Gc_Books.DataSource = bookInfos; Gc_Books.Visible = true; Gv_Books.Focus(); return; } //找到对应的书籍信息的已上架书籍 var books = await _bookApi.GetBooks(new Dictionary <string, object> { { "BookInfoId", bookInfos[0].Id }, { "IsRemove", false } }); if (books.Count == 0) { PopupProvider.Warning("该书籍还未登记上架!"); return; } var reservationBooks = books.Where(m => m.BookState == 1).ToList(); var normalBooks = books.Where(m => m.BookState == 0).ToList(); if (normalBooks.Count > 0) { PopupProvider.Warning("该书籍还可借阅!"); return; } if (reservationBooks.Count == 0) { PopupProvider.Warning("该书籍没有可预约项!"); return; } var book = books.First(); var isReservationBook = await _reservationApi.GetReservationBooks(); if (isReservationBook.Any(item => item.Equals(book.Id))) { PopupProvider.Warning("该书籍没有可预约项!"); return; } //如果只有一条数据则进行数据赋值展示 Te_BookName.Text = book.BookName; Te_Author.Text = book.Author; Te_ReleaseTime.EditValue = book.ReleaseDate; Te_PublishingHouse.Text = book.PublishingName; Te_Category.Text = book.CategoryName; Te_Id.Text = book.Id.ToString(); Pe_BookPhoto.Image = Image.FromFile(book.BookPhoto); Sb_Input.Enabled = true; Te_ISBN.Text = book.ISBN; Te_Price.Text = book.Price.ToString("F"); } catch (Exception e) { PopupProvider.Error("获取数据信息异常!", e); } }
private async void Gv_Books_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter) { return; } var infoId = Guid.Parse(Gv_Books.GetFocusedRowCellValue("Id").ToString()); try { var books = await _bookApi.GetBooks(new Dictionary <string, object> { { "BookInfoId", infoId }, { "IsRemove", false } }); if (books.Count == 0) { PopupProvider.Warning("该书籍还未登记上架!"); return; } var reservationBooks = books.Where(m => m.BookState == 1).ToList(); var normalBooks = books.Where(m => m.BookState == 0).ToList(); if (normalBooks.Count > 0) { PopupProvider.Warning("该书籍还可借阅!"); return; } if (reservationBooks.Count == 0) { PopupProvider.Warning("该书籍没有可预约项!"); return; } var isReservationBook = await _reservationApi.GetReservationBooks(); var canReservationBooks = reservationBooks.Where(bookItem => !isReservationBook.Contains(bookItem.Id)).ToList(); if (canReservationBooks.Count == 0) { PopupProvider.Warning("该书籍没有可预约项!"); return; } var book = canReservationBooks.First(); Te_BookName.Text = book.BookName; Te_Author.Text = book.Author; Te_ReleaseTime.EditValue = book.ReleaseDate; Te_PublishingHouse.Text = book.PublishingName; Te_Category.Text = book.CategoryName; Pe_BookPhoto.Image = Image.FromFile(book.BookPhoto); Te_Id.Text = book.Id.ToString(); Te_ISBN.Text = book.ISBN; Te_Price.Text = book.Price.ToString("F"); Gc_Books.Visible = false; Sb_Input.Enabled = true; } catch (Exception exception) { PopupProvider.Error("获取预约书籍信息异常!", exception); } }