Esempio n. 1
0
        private void lstCategory_DoubleClick(object sender, EventArgs e)
        {
            string lcKey;

            lcKey = Convert.ToString(lstCategory.SelectedItem);
            if (lcKey != null)
            {
                try
                {
                    FrmCategory.Run(lstCategory.SelectedItem as string);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "This should never occur");
                }
            }
        }
Esempio n. 2
0
        public static void Run(string prCategory)
        {
            FrmCategory lcCategoryForm;

            if (string.IsNullOrEmpty(prCategory) ||
                !_CategoryFormList.TryGetValue(prCategory, out lcCategoryForm))
            {
                lcCategoryForm = new FrmCategory();
                if (string.IsNullOrEmpty(prCategory))
                {
                    lcCategoryForm.SetDetails(new clsCategory());
                }
                else
                {
                    _CategoryFormList.Add(prCategory, lcCategoryForm);
                    lcCategoryForm.refreshFormFromDBAsync(prCategory);
                }
            }
            else
            {
                lcCategoryForm.Show();
                lcCategoryForm.Activate();
            }
        }