private void CopySelected_Button_Click(object sender, EventArgs e) { var selected = MainDataFilter.Where(o => o.IsSelected == true).ToList(); if (selected.Count <= 0) { selected = new List <AccountDetail>(MainDataFilter); } if (selected?.Count > 0) { foreach (var item in selected) { var find = AccountDetailData.Find(o => o.AccountID == item.AccountID && o.AccountDetailID == item.AccountDetailID); // TH chưa có trong danh sách if (find == null) { // Thêm vào danh sách AccountDetailData.Add(new AccountDetail { CompanyID = UserInfo.CompanyID, AccountID = item.AccountID, AccountDetailID = item.AccountDetailID, AccountDetailName = item.AccountDetailName, Status = ModifyMode.Insert }); } } AccountDetail_GridView.RefreshData(); } }
private void Delete_Button_Click(object sender, EventArgs e) { AccountDetailData.Remove(o => o.IsSelected == true); AccountDetail_GridView.RefreshData(); }