public static bool IsEmpty(string aModule, string aFilename = "") { bool e = true; List <SqlParameter> paramiters = new List <SqlParameter>(); if (string.IsNullOrEmpty(aFilename)) { paramiters.Add(new SqlParameter("Module", aModule)); string query = "SELECT [IDC] FROM [Controls] WHERE [Module] = @Module"; if (SQLServerManagement.ExecuteReader(query, paramiters) != null) { e = !SQLServerManagement.Read(); } SQLServerManagement.ReaderClose(); } else { paramiters.Add(new SqlParameter("Module", aModule)); paramiters.Add(new SqlParameter("Filename", aFilename)); string query = "SELECT [IDC] FROM [Controls] WHERE [Module] = @Module AND [Filename] = @Filename"; if (SQLServerManagement.ExecuteReader(query, paramiters) != null) { e = !SQLServerManagement.Read(); } SQLServerManagement.ReaderClose(); } return(e); }
public static List <_CONTROL> GetControls(string aModule = "", string aFilename = "") { List <_CONTROL> lc = new List <_CONTROL>(); List <SqlParameter> param = new List <SqlParameter>(); if (string.IsNullOrEmpty(aModule)) { //string query = "SELECT * FROM [Controls] order by [order]"; string query = "SELECT * FROM [Controls] order by [Filename], [order]"; if (SQLServerManagement.ExecuteReader(query, null) != null) { while (SQLServerManagement.Read()) { lc.Add(GetValue()); } } SQLServerManagement.ReaderClose(); } else if (string.IsNullOrEmpty(aFilename)) { param.Add(new SqlParameter("ControlClass", aModule)); param.Add(new SqlParameter("Filename", aFilename)); string query = "SELECT * FROM [Controls] WHERE [TableName] = @module"; if (SQLServerManagement.ExecuteReader(query, param) != null) { while (SQLServerManagement.Read()) { lc.Add(GetValue()); } } SQLServerManagement.ReaderClose(); } else { param.Add(new SqlParameter("ControlClass", aModule)); param.Add(new SqlParameter("Filename", aFilename)); string query = "SELECT * FROM [Controls] WHERE [TableName] = @ControlClass AND [FieldName] = @Filename"; if (SQLServerManagement.ExecuteReader(query, param) != null) { while (SQLServerManagement.Read()) { lc.Add(GetValue()); } } SQLServerManagement.ReaderClose(); } return(lc); }
public static bool IsEmpty() { bool e = true; string query = "SELECT [ControlClass] FROM [ControlsClasses]"; if (SQLServerManagement.ExecuteReader(query, null) != null) { e = !SQLServerManagement.Read(); } SQLServerManagement.ReaderClose(); return(e); }
public static bool IsEmpty() { bool e = true; string query = "SELECT [FieldNamespace] FROM [Fields]"; if (SQLServerManagement.ExecuteReader(query, null) != null) { e = !SQLServerManagement.Read(); } SQLServerManagement.ReaderClose(); return(e); }
public static string GetControlJsonName(string aControlClass) { string v = string.Empty; List <SqlParameter> param = new List <SqlParameter>(); param.Add(new SqlParameter("@ControlClass", aControlClass)); string query = "SELECT [JsonName] FROM [ControlsClasses] WHERE [ControlClass] = @ControlClass"; if (SQLServerManagement.ExecuteReader(query, param) != null) { while (SQLServerManagement.Read()) { v = SQLServerManagement.GetValue <string>("JsonName"); } } SQLServerManagement.ReaderClose(); return(v); }
public static string GetParentTableName(string aTable) { string v = string.Empty; List <SqlParameter> param = new List <SqlParameter>(); param.Add(new SqlParameter("@Table", aTable)); string query = "SELECT [ParentTableName] FROM [Tables] WHERE [TableName] = @Table"; if (SQLServerManagement.ExecuteReader(query, param) != null) { while (SQLServerManagement.Read()) { v = SQLServerManagement.GetValue <string>("ParentTableName"); } } SQLServerManagement.ReaderClose(); return(v); }
public static bool exist(string IDC) { string v = string.Empty; List <SqlParameter> param = new List <SqlParameter>(); param.Add(new SqlParameter("@IDC", IDC)); string query = "SELECT [IDC] FROM [Label] WHERE [IDC] = @IDC"; if (SQLServerManagement.ExecuteReader(query, param) != null) { while (SQLServerManagement.Read()) { v = SQLServerManagement.GetValue <string>("IDC"); } } SQLServerManagement.ReaderClose(); return(v == IDC); }