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 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 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 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);
            }
        }
Example #5
0
        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 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 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 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);
            }
        }
        /// <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 _reservationApi.GetReservations(true);

                Gc_Reservations.DataSource = data;
            }
            catch (Exception exception)
            {
                PopupProvider.Error("获取预约信息异常!", exception);
            }
        }
        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.GetEmployees(true);

                Gc_Employees.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);
            }
        }
Example #14
0
        public async Task BindData()
        {
            try
            {
                var data = await _api.GetPublishingHouses();

                Gc_PublishingHouses.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);
            }
        }
        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);
            }
        }
Example #17
0
        /// <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());
            }
        }
Example #18
0
        private async void Sb_Empower_Click(object sender, EventArgs e)
        {
            _nodes = new List <TreeListNode>();
            RecursiveNode(Tl_Data.Nodes);
            var permissions = _nodes.Aggregate(string.Empty, (current, node) => current + $"{node["AuthorityNum"]},");
            var id          = Guid.Parse(Gv_Admins.GetFocusedRowCellValue("Id").ToString());
            var result      = await _adminApi.UpdateAdminPower(id, permissions);

            if (!result)
            {
                PopupProvider.Warning("赋权失败!");
                return;
            }

            PopupProvider.Success("赋权成功!");
        }
        private async void Sb_Shelves_Click(object sender, EventArgs e)
        {
            if (Gv_BooksInfo.FocusedRowHandle < 0 || Gv_BooksInfo.RowCount == 0)
            {
                return;
            }
            var id     = Guid.Parse(Gv_BooksInfo.GetFocusedRowCellValue("Id").ToString());
            var result = await _bookApi.CreateBook(id);

            if (result.ResultCode != 1)
            {
                PopupProvider.Warning(result.ResultMessage);
                return;
            }

            PopupProvider.Success(result.ResultMessage);
        }
        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 Gv_Books_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter)
            {
                return;
            }
            var state       = Gv_Books.GetFocusedRowCellDisplayText("BookStateName");
            var id          = Gv_Books.GetFocusedRowCellValue("Id").ToString();
            var reservation = await _reservationApi.GetReservations(new Dictionary <string, object>()
            {
                { "BookId", id },
                { "IsRemove", false },
                { "StudentId", Te_StudentId.Text }
            });

            if (reservation.Count <= 0 && state.Equals("已预约"))
            {
                PopupProvider.Warning($"{state}书籍不可借阅!");
                return;
            }
            if (state.Equals("已借阅"))
            {
                PopupProvider.Warning($"{state}书籍不可借阅!");
                return;
            }

            Te_BookId.Text           = Gv_Books.GetFocusedRowCellDisplayText("Id");
            Te_BookName.Text         = Gv_Books.GetFocusedRowCellDisplayText("BookName");
            Te_Author.Text           = Gv_Books.GetFocusedRowCellDisplayText("Author");
            Te_ReleaseTime.EditValue = Gv_Books.GetFocusedRowCellDisplayText("ReleaseDate");
            Te_PublishingHouse.Text  = Gv_Books.GetFocusedRowCellDisplayText("PublishingName");
            Te_Category.Text         = Gv_Books.GetFocusedRowCellDisplayText("CategoryName");
            Te_ISBN.Text             = Gv_Books.GetFocusedRowCellDisplayText("ISBN");
            Te_ReleaseTime.Text      = Gv_Books.GetFocusedRowCellDisplayText("ReleaseDate");
            Pe_BookPhoto.Image       = Image.FromFile(Gv_Books.GetFocusedRowCellValue("BookPhoto").ToString());
            Te_Price.Text            = Gv_Books.GetFocusedRowCellValue("Price").ToString();
            Gc_Books.Visible         = false;
        }
        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);
            }
        }
Example #30
0
        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);
            }
        }