private DasteCheckBussines LoadData(SqlDataReader dr, CancellationToken token) { var item = new DasteCheckBussines(); try { item.Guid = (Guid)dr["Guid"]; item.Modified = (DateTime)dr["Modified"]; item.Status = (bool)dr["Status"]; item.SerialNumber = dr["SerialNumber"].ToString(); item.BankGuid = (Guid)dr["BankGuid"]; item.FromNumber = (long)dr["FromNumber"]; item.ToNumber = (long)dr["ToNumber"]; item.Description = dr["Description"].ToString(); item.BankName = dr["BankName"].ToString(); item.ServerDeliveryDate = (DateTime)dr["ServerDeliveryDate"]; item.ServerStatus = (ServerStatus)dr["ServerStatus"]; item.CheckPages = AsyncContext.Run(() => CheckPageBussines.GetAllAsync(item.Guid, token)); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } return(item); }
private async void cmbCheckBook_SelectedIndexChanged(object sender, EventArgs e) { try { if (CheckBookBindingSource.Count <= 0 || cmbCheckBook.SelectedValue == null) { return; } _token?.Cancel(); _token = new CancellationTokenSource(); var list = await CheckPageBussines.GetAllAsync((Guid)cmbCheckBook.SelectedValue, _token.Token); CheckPageBindingSource.DataSource = list?.OrderBy(q => q.Number).ToList(); if (cls.Guid != Guid.Empty) { cmbCheckPage.SelectedValue = cls.CheckPageGuid; } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }