private void BindList(Guid guid) { try { list = CustomerLogBussines.GetAll(); list = list.Where(q => q.CustomerGuid == guid).ToList(); lstCustomers.Adapter = new CustomerLogAdapter(this, list.OrderByDescending(q => q.Date).ToList()); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private async Task LoadDataAsync() { try { list = await CustomerLogBussines.GetAllAsync(); Invoke(new MethodInvoker(() => logBindingSource.DataSource = list.Where(q => q.CustomerGuid == CusGuid).ToList().ToSortableBindingList())); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private async void btnFinish_Click(object sender, EventArgs e) { try { if (string.IsNullOrWhiteSpace(txtDesc.Text)) { frmNotification.PublicInfo.ShowMessage("توضیحات را وارد نمایید"); txtDesc.Focus(); return; } var log = new CustomerLogBussines { Guid = Guid.NewGuid(), CustomerGuid = cls.Guid, Description = txtDesc.Text, Side = EnCustomerLogType.Tell, Status = true }; var res_ = await CustomerLogBussines.SaveAsync(log); if (res_.HasError) { frmNotification.PublicInfo.ShowMessage(res_.ErrorMessage); return; } DialogResult = DialogResult.OK; Close(); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }