SAP Business One浏览器扩展组件-新 SDK 功能

时间:2018-09-14
分享到 :

SAP Business One浏览器扩展组件-代码样本

上传和下载文件

if (SBO_Application.ClientType == BoClientType.ct_Browser)

{

    string path = null;

    try

    {

        path = SBO_Application.GetFileFromBrowser();

        using (FileStream fs = File.Open(path, FileMode.Open))

        {

            //read the file

        }

    }

    catch (Exception ex)

    {

        //exception handling

    }

 

    try

    {

        bool isSucceed = SBO_Application.SendFileToBrowser(path);

    }

    catch (Exception ex)

    {

        //exception handling

    }

}

else if(SBO_Application.ClientType == BoClientType.ct_Desktop)

{

    System.IO.Stream readStream = null;

    OpenFileDialog openFileDialog1 = new OpenFileDialog();

    if (openFileDialog1.ShowDialog() == DialogResult.OK)

    {

        try

        {

            if ((readStream = openFileDialog1.OpenFile()) != null)

            {

                using (readStream)

                {

                    //read the file

                }

            }

        }

        catch (Exception ex)

        {

            //exception handling

        }

    }

 

    SaveFileDialog saveFileDialog1 = new SaveFileDialog();

    System.IO.Stream writeStream = null;

    if (saveFileDialog1.ShowDialog() == DialogResult.OK)

    {

        try

        {

            if ((writeStream = saveFileDialog1.OpenFile()) != null)

            {

                using (writeStream)

                {

                    //write the file

                }

            }

        }

        catch (Exception ex)

        {

            //exception handling

        }

    }

}


TransInfo斯凯普斯是SAP制造业解决方案核心合作伙伴,SAP金牌实施商专注上海/无锡/苏州/广州/深圳/东莞/成都等地SAP ERP软件SAP制造业ERP软件、 电子制造ERP医药行业ERP精细化工ERP机械制造设备行业ERP实施服务

13
,jeason,
15
免费服务热线
400-016-7107

工作时间:
周一至周五 9:00-18:00
(法定节假日除外)

16
进一步了解SAP的产品与方案?
您可以通过以下方式联系我们,我们将推荐适合您需求的产品,或安排专业的顾问为您定制解决方案。
留言获取免费调研礼包及数字化转型白皮书
×
大小:0MB
时间:
个人信息