简体   繁体   English

Epicor C#通过按钮打开文件夹

[英]Epicor C# Opening a Folder from a button

I want to open a folder from a record pulled up in a form in Epicor. 我想从Epicor中以表格形式提取的记录中打开一个文件夹。 I have created a button and so far it opens up the root folder but I want it to go to a sub-folder with the record's name as the sub folder that will be created from SQL stored procedure when a new record is created. 我已经创建了一个按钮,到目前为止,它已经打开了根文件夹,但是我希望它转到带有记录名称的子文件夹,该子文件夹是在创建新记录时将从SQL存储过程创建的子文件夹。

Here is what I have so far: 这是我到目前为止的内容:

    private void epiButtonC1_Click(object sender, System.EventArgs args)
{
    // ** Place Event Handling Code Here **
    string folder = "\\\\MasterServ\\Shared\\Customer Attachments\\";
    Process.Start("IExplore.exe", folder);
}

I know something needs to be added at the end of the location to call the folder using the record but im not sure what. 我知道需要在该位置的末尾添加一些内容以使用记录来调用该文件夹,但是我不确定是什么。

When trying to get data out of a control in Epicor, generally speaking you want to go to the EpiDataView to get the value and not the control itself. 尝试从Epicor的控件中获取数据时,通常来说,您想转到EpiDataView来获取值,而不是控件本身。 There are multiple layers of abstraction going on in the form that make control handling wonky. 形式上有多个抽象层,使控件处理变得很奇怪。

From your example for the comments I would do this. 从您的评论示例中,我将这样做。 Code untested so hopefully I didn't make a typo. 代码未经测试,所以希望我不会打错字。

EpiDataView edvUD104 = ((EpiDataView)(oTrans.EpiDataViews["UD104"]));
if (edvUD104.HasRow)
{
   string folder = "\\\\MasterServ\\Shared\\Customer Attachments\\" 
                  + edvUD104.dataView[edvUD104.Row]["Key1"].ToString();
   Process.Start("IExplore.exe", folder);
}

Edited for readability. 编辑以提高可读性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM