public double NumRequest(dyk.Script.Code.Variable.String str) { double res = 0; double.TryParse(gParent[str.Value], out res); return(res); }
public void SqlExecute(dyk.Script.Code.Variable.String str) { try { using (Ly.Data.SQLClient Conn = new Ly.Data.SQLClient(gszConnString)) { Conn.ExecuteNonQuery(str.Value); } } catch (Exception ex) { throw new Exception("数据库执行发生异常:" + ex.Message + ";执行语句:" + str.Value); } }
public int AutoNum(dyk.Script.Code.Variable.String str) { int res = 0; using (Ly.DB.Dream.SystemAutomatic.ExecutionExp st = new Ly.DB.Dream.SystemAutomatic.ExecutionExp(gszConnString)) { res = st.GetNewAutomatic(str.Value); } return(res); }
public string Column(dyk.Script.Code.Variable.Number strTab, dyk.Script.Code.Variable.String strCol) { if (gTab.SystemColumns.GetDataByParentIDAndText(strTab.Value, strCol.Value)) { return(gTab.SystemColumns.Structure.Name); } else { throw new Exception("未在表中找到\"" + strCol.Value + "\"字段。"); } }
public string SqlRead(dyk.Script.Code.Variable.String str) { string res = ""; using (Ly.Data.SQLClient Conn = new Ly.Data.SQLClient(gszConnString)) { Conn.ExecuteReader(str.Value); if (Conn.DataReader.Read()) { res = Conn.DataReader[0].ToString(); } } return(res); }
public string User(dyk.Script.Code.Variable.String str) { switch (str.Value.ToLower()) { case "id": return(gParent.UserInfo.ID.ToString()); case "department": return(gParent.UserInfo.Department.ToString()); case "auth": return(gParent.AuthorizeID.ToString()); default: throw new Exception("未找到登录用户的\"" + str.Value + "\"属性。"); } }
public string Column(dyk.Script.Code.Variable.String str) { if (gnTable > 0) { if (gTab.SystemColumns.GetDataByParentIDAndText(gnTable, str.Value)) { return(gTab.SystemColumns.Structure.Name); } else { throw new Exception("未在表中找到\"" + str.Value + "\"字段。"); } } else { throw new Exception("多表情况下,查询字段必须加上表名称参数。"); } }
public string Table(dyk.Script.Code.Variable.String str) { if (gTab.SystemTables.GetDataByText(str.Value)) { //如只有一个表,则附带默认表功能 if (gbTable) { gnTable = 0; } else { gnTable = (int)gTab.SystemTables.Structure.ID; gbTable = true; } return("[" + gTab.SystemTables.Structure.Name + "]"); } else { throw new Exception("未找到表\"" + str.Value + "\"。"); } }
public void SetForm(dyk.Script.Code.Variable.String strVar, dyk.Script.Code.Variable.String strVal) { gJson[strVar.Value].Value = strVal.Value; }
public string GetForm(dyk.Script.Code.Variable.String str) { return(gJson[str.Value].Value); }
public string Request(dyk.Script.Code.Variable.String str) { return(gParent[str.Value]); }