예제 #1
0
        private void OpenCategory()
        {
            try
            {
                if (grdCategories.SelectedRows.Count == 0)
                {
                    throw new Exception("No Category Selected");
                }
                else
                {
                    DataGridViewRow row        = this.grdCategories.SelectedRows[0];
                    clsCategory     lcCategory = row.DataBoundItem as clsCategory;

                    if (lcCategory != null)
                    {
                        frmCategory.Run(lcCategory.ID);
                        updateDisplayFromDB();    //Update the screen to reflect the changes
                    }
                    else
                    {
                        throw new Exception("Error! Null Category");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #2
0
 public void SetDetails(clsCategory prCategory)
 {
     _Category = prCategory;
     updateDisplay();
 }