示例#1
0
        void Now_Registr(Person autor)
        {
            _Visibility_off();
            Login    = "";
            Password = "";

            if (is_ok)
            {
                Index MainWindows = new Index();

                Viwe_Model_Index viewModelIndex = new Viwe_Model_Index(autor);



                MainWindows.DataContext = viewModelIndex;

                MainWindows.ShowDialog();
                is_ok = false;

                // myDB = new CashDB();
                my_users = new Person();
            }
            else if (is_no)
            {
                Reset_password   window     = new Reset_password();
                View_Model_Reset view_model = new View_Model_Reset(myDB);
                view_model._OK     = window.Close;
                window.DataContext = view_model;
                window.ShowDialog();

                is_no = false;
            }
            else if (is_none_user)
            {
                Registration view_registration = new Registration();

                View_Model_Registration View_model_reg = new View_Model_Registration(myDB);

                if (View_model_reg._OK == null)
                {
                    View_model_reg._OK = new Action(view_registration.Ok);
                }

                view_registration.DataContext = View_model_reg;

                view_registration.ShowDialog();
                //  myDB = new CashDB();
                is_none_user = false;
            }


            _Visibility_on();
        }
示例#2
0
        private void Execute_add_profile(object o)
        {
            try
            {
                Registration view_registration = new Registration();

                View_Model_Registration View_model_reg = new View_Model_Registration(myDB);

                if (View_model_reg._OK == null)
                {
                    View_model_reg._OK = new Action(view_registration.Ok);
                }

                view_registration.DataContext = View_model_reg;

                view_registration.ShowDialog();
                // myDB = new CashDB();
                Set_new_items();
                Set_Filter();
                VMSelectedTabIndex = 0;
            }catch (Exception e) { OpenMessege(e.Message, "Error"); }
        }