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