Example #1
0
        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;
                }
            }
        }
Example #2
0
 private void ClearScreen()
 {
     txtCode.Text = string.Empty;
     txtDescription.Text = string.Empty;
     _itemCategory = new ItemCategory();
     txtCode.Focus();
 }
Example #3
0
 partial void UpdateItemCategory(ItemCategory instance);
Example #4
0
 partial void DeleteItemCategory(ItemCategory instance);
Example #5
0
 partial void InsertItemCategory(ItemCategory instance);