Exemplo n.º 1
0
        private void BtnUploadImage_Click(object sender, RoutedEventArgs e)
        {
            UCUnifiedImageUpload upWindow = new UCUnifiedImageUpload(ConstValue.DomainName_MKT);

            upWindow.AppName   = "mkt";
            upWindow.UploadUrl = CPApplication.Current.CurrentPage.Context.Window.Configuration.GetConfigValue(ConstValue.DomainName_MKT, "ImageBaseUrl");
            upWindow.Dialog    = Window.ShowDialog(ResUnifiedImageMaitain.TextBlock_PicUpload, upWindow, (obj, args) =>
            {
                if (args.Data != null)
                {
                    _currentVM.ImageName = ((dynamic)args.Data).ImageName;
                    _currentVM.ImageUrl  = ((dynamic)args.Data).ImageUrl;
                    //保存图片
                    if (string.IsNullOrEmpty(_currentVM.ImageName))
                    {
                        //Window.Alert("请选择要上传的图片!");
                        Window.Alert(ResUnifiedImageMaitain.Info_ImageNull);
                        return;
                    }
                    facade.CreateUnifiedImage(_currentVM, (s, arg) =>
                    {
                        if (arg.FaultsHandle())
                        {
                            return;
                        }
                        //this.Window.Alert("保存图片成功!");
                        this.Window.Alert(ResUnifiedImageMaitain.Info_SaveSuccess);
                        this.DataGrid.Bind();
                    });
                }
            }, new Size(600, 300));
        }
Exemplo n.º 2
0
        private void btnAddPic_Click(object sender, RoutedEventArgs e)
        {
            UCUnifiedImageUpload upWindow = new UCUnifiedImageUpload(ConstValue.DomainName_MKT);

            upWindow.AppName = "mkt";

            upWindow.UploadUrl = CPApplication.Current.CurrentPage.Context.Window.Configuration.GetConfigValue(ConstValue.DomainName_MKT, "ImageBaseUrl");

            upWindow.Dialog = Window.ShowDialog("上传广告图片", upWindow, (obj, args) =>
            {
                if (args.Data != null)
                {
                    txtBannerResourceUrl.Text = ((dynamic)args.Data).ImageUrl;
                }
            }, new Size(600, 300));
        }