关于Epicor函数中Db


Epicor Function中Db查询默认是不会带上公司过滤的。

实例:

不加公司条件

C# 全选
var data = Db.Company.ToList();

DataTable dt = new DataTable();
dt.Columns.Add("company",typeof(string));
dt.Columns.Add("name",typeof(string));

foreach(var item in data) {
  dt.Rows.Add(item.Company1,item.Name);
}

DataSet ds = new DataSet();
ds.Tables.Add(dt);
this.output = ds;
Markup 全选
{
  "output": {
    "Table1": [
      {
        "company": "EPIC01",
        "name": "Epic Corporation"
      },
      {
        "company": "EPIC02",
        "name": "Epicor Distribution"
      },
      {
        "company": "EPIC03",
        "name": "Epicor USA"
      },
      {
        "company": "EPIC04",
        "name": "Epicor Financial Co."
      },
      {
        "company": "EPIC05",
        "name": "Epicor Europe"
      },
      {
        "company": "EPIC06",
        "name": "Epicor Education"
      },
      {
        "company": "EPIC07",
        "name": "Epicor Mexico"
      },
      {
        "company": "EPICPF",
        "name": "Epicor Perform"
      },
      {
        "company": "GPC",
        "name": "Graphic Printing Co."
      }
    ]
  }
}

 

手动添加公司条件

C# 全选
var data = Db.Company.Where(w=>w.Company1== this.callContextClient.CurrentCompany).ToList();

DataTable dt = new DataTable();
dt.Columns.Add("company",typeof(string));
dt.Columns.Add("name",typeof(string));

foreach(var item in data) {
  dt.Rows.Add(item.Company1,item.Name);
}

DataSet ds = new DataSet();
ds.Tables.Add(dt);
this.output = ds;

返回内容:

Markup 全选
{
  "output": {
    "Table1": [
      {
        "company": "EPIC01",
        "name": "Epic Corporation"
      }
    ]
  }
}
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
上一篇:Epicor用户自定义表格配置所在的表
下一篇:没有了
评论列表

发表评论

评论内容
昵称:
关联文章

关于Epicor函数Db
关于Epicor函数Db
Epicor在BPM调用自定义函数
Epicor Function保存表数据
epicor自定义函数调用API接口
关于事务
关于授权
Epicor BPM自定义代码弹出错误提醒
vue异步函数async和await的用法
Epicor BPM调用BO
关于RazorEngine研究过程的记录
Epicor页面根据不同权限显示不同的表格列
Epicor客户端安装
CSS RGB函数 LESS问题
Epicor解决方案 项目类型说明
Epicor BPM 解析字符串得到List对象并转换为json字符串
JS魔法堂:函数节流(throttle)与函数去抖(debounce)
关于模型生成
关于二元插值问题的探讨
Task 使用详细[基础操作,异步原则,异步函数,异步模式]

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码