public string GetUserNameById(string id) { ComplexQuery cmquery = new ComplexQuery(); cmquery.AddNeedField("users", "USER_NAME"); cmquery.AddCriterion("USER_ID", id, CriteriaOperator.Equal); DataTable table = dataFactory.Query(cmquery); return table.Rows[0][0].ToString().Trim(); }
/// <summary> /// 获得视图中所有变量的Id值 /// </summary> /// <param name="viewName"></param> /// <returns></returns> public System.Collections.ArrayList GetVariableId(int productLineId, string viewName) { string connectionString = ConnectionStringFactory.GetConnectionStringByProductLineID(productLineId, DatabaseType.DCSSystemDatabase); ISqlServerDataFactory dataFactory = new SqlServerDataFactory(connectionString); ArrayList result = new ArrayList(); ComplexQuery cmpquery = new ComplexQuery(); cmpquery.AddNeedField("ContrastTable", "VariableName"); cmpquery.AddCriterion("ViewName", viewName, CriteriaOperator.Equal); DataTable data = dataFactory.Query(cmpquery); foreach (DataRow row in data.Rows) { result.Add(row["VariableName"].ToString().Trim()); } return result; }
/// <summary> /// 获得视图中所有变量的Id值 /// </summary> /// <param name="viewName"></param> /// <returns></returns> private ArrayList GetParametorsId(string viewName) { ArrayList result = new ArrayList(); ComplexQuery cmpquery = new ComplexQuery(); cmpquery.AddNeedField("ContrastTable", "VariableName"); cmpquery.AddCriterion("ViewName", viewName, CriteriaOperator.Equal); DataTable data = dataFactory.Query(cmpquery); foreach (DataRow row in data.Rows) { result.Add(row["VariableName"].ToString().Trim()); } return result; }
public string GetProductLineNameBy(int id) { ComplexQuery cmquery = new ComplexQuery(); cmquery.AddNeedField("ProductLine", "Name"); cmquery.AddCriterion("ID", id, CriteriaOperator.Equal); DataTable table = dataFactory.Query(cmquery); return table.Rows[0][0].ToString().Trim(); }