public static void SetColumns(H3.IEngine Engine, Schema s, string currentRowID, string tableName) { Schema t = new Schema(Engine, tableName); var cs = t.Columns; foreach (var key in cs.Keys) { var existRow = s.ClearFilter().And(Schema.PID, "=", currentRowID).And("编码", "=", cs[key]).GetFirst(true); if (existRow == null) { s.GetNew(); } s["编码"] = cs[key]; if (string.IsNullOrEmpty(s["名称"] + string.Empty)) { s["名称"] = key; } s["显示名称"] = key; s["是子表"] = t.SubTables == null ? false : t.SubTables.ContainsKey(key); s[Schema.PID] = currentRowID; if (existRow == null) { s.Create(); } else { s.Update(); } } }
public ProcessTask(H3.SmartForm.SmartFormRequest request) { this.sr = request; this.Engine = request.Engine; this.sb = request.BizObject; //this.tool = new SmartFormTools(request); me = new Schema(Engine, "加工任务记录"); }
public Salary(H3.IEngine Engine, string OrderNum, string SpecNum, string PID, string ID) { this.Engine = Engine; this.OrderNum = OrderNum; this.SpecNum = SpecNum; this.PID = PID; this.ID = ID; me = new Schema(Engine, "任务绩效表"); }
public static string GetDepartmentName(H3.IEngine engine, string userId) { H3.Organization.User employee = engine.Organization.GetUnit(userId) as H3.Organization.User; if (employee == null) { return(null); } return(employee.DepartmentName); }
public static string[] GetUsers(string RoleName, H3.IEngine Engine) { string Dianzhang = ""; //角色ID H3.Organization.OrgRole[] allRoles = Engine.Organization.GetAllRoles(); //获取所有角色 foreach (H3.Organization.OrgRole role in allRoles) { if (role.Name == RoleName) { Dianzhang = role.ObjectId; } } string[] Renyuans = Engine.Organization.GetChildren(Dianzhang, H3.Organization.UnitType.User, true, H3.Organization.State.Active); //获取RoleName(角色)的所有成员ID return(Renyuans); }
public static void SetColumns(H3.IEngine Engine) { Schema r = new Schema(Engine, RegisterTable, true); //r.And("类名", "!=", ""); Schema s = r.GetSubSchema("列结构"); var list = r.GetList(); if (list == null) { return; } foreach (var l in list) { r.CurrentRow = l; Register.SetColumns(Engine, s, r.Cell(Schema.RID), r.Cell("表名")); r.Update(true); } }
public ProductTime(H3.IEngine Engine) { if (pScm == null) { pScm = new Schema(Engine, "产品参数表"); } if (idScm == null) { idScm = new Schema(Engine, "工序计划表"); } //产品ID表--工序计划表:Szlywopbivyrv1d64301ta5xv4;锯切表:ba65c69eb46c4156b0eb25930bf50b93 if (dScm == null) { dScm = new Schema(Engine, "设备工时系数表"); } if (dScm_1 == null) { dScm_1 = dScm.GetSubSchema("子表"); } //设备工时系数表子表 }
public static string CreateCode(H3.IEngine Engine, string interfaceName) { Schema usage = new Schema(Engine, usageTable); var fields = usage.ClearFilter().GetList();//And("次数", "=", sum) StringBuilder model = new StringBuilder(""); model.Append("\tpublic interface " + interfaceName + "\r\n"); model.Append("\t{\r\n"); foreach (var field in fields) { usage.CurrentRow = field; string PropName = usage.Cell("名称"); string DotNetType = "Object"; model.Append("\t\t" + DotNetType + " " + PropName + " { get; set; }\r\n"); } model.Append("\t}\r\n"); return(model.ToString()); }
public static string CreateMap(H3.IEngine Engine) { Schema reg = new Schema(Engine, RegisterTable, true); var fields = reg.ClearFilter().And("表名", "!=", "").And("类名", "!=", "").GetList(); StringBuilder model = new StringBuilder(""); model.Append("\tpublic static Dictionary < string, string > GetColumns(string tableName)\r\n"); model.Append("\t{\r\n"); //if (tableName == "") { return Finishing.Columns; } foreach (var field in fields) { reg.CurrentRow = field; string tableName = reg.Cell("表名"); string className = reg.Cell("类名"); model.Append("\t\tif (tableName == \"" + tableName + "\") { return " + className + ".Columns; }\r\n"); } model.Append("\t\treturn null;\r\n"); model.Append("\t}\r\n"); return(model.ToString()); }
public static int SumUsage(H3.IEngine Engine, string[] idList) { Schema reg = new Schema(Engine, RegisterTable, true); Schema s = reg.GetSubSchema("列结构"); Schema usage = new Schema(Engine, usageTable); int sum = 0; foreach (string id in idList) { var row = reg.GetRow(id); var slist = s.ClearFilter().And(Schema.PID, "=", reg[Schema.RID]).GetList(); foreach (var l in slist) { s.CurrentRow = l; if (Schema.IsSysColumn(s.Cell("名称"))) { continue; } var uRow = usage.ClearFilter().And("名称", "=", s.Cell("名称")).GetFirst(true); if (uRow == null) { usage.GetNew(); usage["名称"] = s.Cell("名称"); usage["次数"] = 1; usage.Create(); } else { usage["次数"] = Convert.ToInt32(usage["次数"]) + 1; usage.Update(); } } } return(sum); }
public Salary(H3.IEngine Engine, string ID) { this.Engine = Engine; this.ID = ID; me = new Schema(Engine, "任务绩效表"); }
public Salary(H3.IEngine Engine) { me = new Schema(Engine, "任务绩效表"); }