Ejemplo n.º 1
0
        private void btnInsertcategory_Click(object sender, EventArgs e)
        {
            CategoryDetailsForm form = new CategoryDetailsForm(101);

            if (form.ShowDialog() == DialogResult.OK)
            {
                //DialogResult = DialogResult.OK;
            }
        }
Ejemplo n.º 2
0
        public IConsoleView GoTo(ConsoleKey keyPressed)
        {
            switch (keyPressed)
            {
            case ConsoleKey.V:
                var view = new CategoryDetailsForm();
                view.InitializeForm(view.CategoryList, view.EscapeAction);
                return(view);

            case ConsoleKey.D:
                view = new CategoryDetailsForm();
                view.InitializeForm(view.CategoryList, view.DeleteAction);

                if (Program.IsAnonymousUser)
                {
                    return(new SignInForm(view));
                }

                return(view);

            case ConsoleKey.E:
                view = new CategoryDetailsForm();
                view.InitializeForm(view.CategoryList, view.EditAction);

                if (Program.IsAnonymousUser)
                {
                    return(new SignInForm(view));
                }

                return(view);

            case ConsoleKey.Escape:
                return(View.EscapeView);

            default:
                return(View);
            }
        }