Esempio n. 1
0
        public async Task BindData()
        {
            try
            {
                var data = await _api.GetPublishingHouses();

                Gc_PublishingHouses.DataSource = data;
            }
            catch (Exception e)
            {
                PopupProvider.Error("获取出版社信息异常!", e);
            }
        }
        private async void FrmCreateBook_Load(object sender, EventArgs e)
        {
            try
            {
                var categories = await _api.GetBookCategories(false);

                Lue_BookCategories.Properties.DataSource = categories;
                Lue_BookCategories.EditValue             = categories[0].Id;

                var publishingHouses = await _api.GetPublishingHouses(false);

                Lue_PublishingHouse.Properties.DataSource = publishingHouses;
                if (!_addOrUpdate)
                {
                    BindData();
                }
            }
            catch (Exception exception)
            {
                XtraMessageBox.Show(exception.Message);
                LogHelper.Error(exception.ToString());
            }
        }