private void btn_editSave_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txt_searchSaveName.Text)) { MessageBox.Show("Search Name Required"); return; } PlayerSearchCriteria criteria = GetSearchCritieriaFromForm(); if (grd_searchList.SelectedRows.Count > 0) { object pkId = grd_searchList.SelectedRows[0].Cells["PkId"].Value; criteria.PkId = Convert.ToInt32(pkId); SearchDAL.UpdateSearch(criteria); } else { SearchDAL.SaveSearch(criteria); } SearchList_Load(sender, e); HideSearchForm(); }