private void dgvList_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { try { int id = 0; if (dgvList.SelectedRows.Count > 0) { id = int.Parse(dgvList.SelectedRows[0].Cells[2].Value.ToString()); _itemCategory = (from c in dc.GetTable<ItemCategory>() where c.ItemCategoryID == id select c).SingleOrDefault<ItemCategory>(); if (_itemCategory != null) { txtCode.Text = _itemCategory.ItemCategoryCode; txtDescription.Text = _itemCategory.ItemCategoryDescription; tabControl1.SelectedTab = tabControl1.TabPages[0]; txtCode.Focus(); txtCode.SelectAll(); } } } catch (Exception) { return; } } }
private void ClearScreen() { txtCode.Text = string.Empty; txtDescription.Text = string.Empty; _itemCategory = new ItemCategory(); txtCode.Focus(); }
partial void UpdateItemCategory(ItemCategory instance);
partial void DeleteItemCategory(ItemCategory instance);
partial void InsertItemCategory(ItemCategory instance);