private List <CustomerInventoryGroup> AddSelectedCustomers() { List <CustomerInventoryGroup> selectedCustomers = CUSTOMERS; foreach (GridViewRow row_customer in gvCustomers.Rows) { CheckBox ck = ((CheckBox)row_customer.FindControl("chkItems")); Image imgCustomer = (Image)row_customer.FindControl("imgCustomer"); if (ck.Checked) { CustomerReferenceLink CRL = CustInvGroupManager.GetCustomerLinkByCustCode(imgCustomer.ToolTip); BranchClass branch = BranchManager.GetBranchByCode(CRL.BranchCode); AccountClass account = AccountManager.GetAccountByCode(branch.AccountCode); string BrandName; if (string.IsNullOrEmpty(HttpUtility.HtmlDecode(row_customer.Cells[3].Text)) || string.IsNullOrWhiteSpace(HttpUtility.HtmlDecode(row_customer.Cells[3].Text))) { BrandName = brandManager.GetBrandByCode(CRL.BrandCode).BrandDescription; } else { BrandName = row_customer.Cells[3].Text; } CustomerInventoryGroup customer = new CustomerInventoryGroup { CustomerNumber = int.Parse(imgCustomer.AlternateText), CustomerName = row_customer.Cells[2].Text, BrandName = BrandName, AccountName = account.AccountName, BranchName = branch.BranchName }; if (!IsAlreadySelected(CUSTOMERS, customer.CustomerNumber)) { if (string.IsNullOrEmpty(customer.AccountName) || string.IsNullOrWhiteSpace(customer.AccountName)) { hfWarningHandler_ModalPopupExtender.Show(); } else { selectedCustomers.Add(customer); } } } } return(selectedCustomers); }