示例#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;
            }
        }
示例#2
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_WHOLESALER = F_Image.BitmapImage2Bytes(bitmapImage);
                }
                catch (Exception e)
                {
                    F_File.LogError(e);
                }
            }
            break;

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

            case "Save":
            {
                T_Helper.wholesaler.EditFromObject(getInput());
                TableWholesalerViewModel.Send(null);
            }
            break;

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

            default: break;
            }
        }
示例#3
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(F_Image.BitmapImage2Bytes((BitmapImage)value));
 }