private void ResetButton() { CustomerName.Clear(); CustomerAddress.Clear(); CustomerMobile.Clear(); CustomerName.Focus(); }
internal void textChanged(object changedString) { switch (changedString as string) { case "name": { if (!string.IsNullOrEmpty(CustomerName) && SelectedRecord == null) { CustomerList = null; var filtered = usersFromDB.AsEnumerable().Where(r => r.Field <string>("CustomerName").ToLower().Contains(CustomerName.ToLower())); CustomerList = filtered.Count() > 0 ? filtered.CopyToDataTable() : usersFromDB.Copy(); } } break; case "mobile": { if (!string.IsNullOrEmpty(CustomerMobile) && SelectedRecord == null) { CustomerList = null; var filtered = usersFromDB.AsEnumerable().Where(r => r.Field <string>("mobileNumber").ToLower().Contains(CustomerMobile.ToLower())); CustomerList = filtered.Count() > 0 ? filtered.CopyToDataTable() : usersFromDB.Copy(); } } break; case "address": { if (!string.IsNullOrEmpty(CustomerAddress) && SelectedRecord == null) { CustomerList = null; var filtered = usersFromDB.AsEnumerable().Where(r => r.Field <string>("Address").ToLower().Contains(CustomerAddress.ToLower())); CustomerList = filtered.Count() > 0 ? filtered.CopyToDataTable() : usersFromDB.Copy(); } } break; case "telegram": { if (!string.IsNullOrEmpty(CustomerTelegram) && SelectedRecord == null) { CustomerList = null; var filtered = usersFromDB.AsEnumerable().Where(r => r.Field <string>("whatsappNumber").ToLower().Contains(CustomerTelegram.ToLower())); CustomerList = filtered.Count() > 0 ? filtered.CopyToDataTable() : usersFromDB.Copy(); } } break; case "email": { if (!string.IsNullOrEmpty(CustomerEmail) && SelectedRecord == null) { CustomerList = null; var filtered = usersFromDB.AsEnumerable().Where(r => r.Field <string>("emailID").ToLower().Contains(CustomerEmail.ToLower())); CustomerList = filtered.Count() > 0 ? filtered.CopyToDataTable() : usersFromDB.Copy(); } } break; } }