Ejemplo n.º 1
0
        private void execute <Object>(Object obj)
        {
            string st = obj as string;

            switch (st)
            {
            case "EditImage":
            {
                try
                {
                    var path        = F_File.browserFile("image | *.png;*.jpg;");
                    var bitmapImage = new BitmapImage(new Uri(path));
                    PICTURE_USER = F_Image.BitmapImage2Bytes(bitmapImage);
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                }
            }
            break;

            case "DeleteImage":
            {
                PICTURE_USER = new byte[] { };
            }
            break;

            case "Save":
            {
                if (PASSWORD == PASSWORD_CONFIRMATION)
                {
                    T_Helper.user.EditFromObject(getInput());
                    TableUsersViewModel.Send(null);
                    HeaderViewModel.Send(null);
                }
                else
                {
                    DialogError.Error();
                }
            }
            break;

            case "OverlayGridCancel":
            {
                TableUsersViewModel.Send(null);
            }
            break;

            default: break;
            }
        }
Ejemplo n.º 2
0
        private void executeLogin()
        {
            if (T_Helper.IsNull())
            {
                UserControlsModule.NavigateContent("Settings");
            }

            if (T_Helper.user.login(NAME, PASSWORD))
            {
                UserControlsModule.NavigateContent("MainMenu");
            }
            else
            {
                DialogError.Error();
            }
            HeaderViewModel.Send("login");
        }