// CONTROLS public bool UpdateControl(_CONTROL control) { if (string.IsNullOrEmpty(mDBName)) { return(false); } TableM4Controls.Update(control); return(true); }
public List <_CONTROL> GetControls(string aModule = "", string aFilename = "") { return(string.IsNullOrEmpty(mDBName) ? null : TableM4Controls.GetControls(aModule, aFilename)); }
public bool ControlsInsert(_CONTROL aControl) { return(string.IsNullOrEmpty(mDBName) ? false : TableM4Controls.Insert(aControl) >= 0); }
public bool ControlsDelete(string aModule, string aFilename = "") { TableM4Label.Delete(); return(string.IsNullOrEmpty(mDBName) || string.IsNullOrEmpty(aModule) ? false : TableM4Controls.Delete(aModule, aFilename) >= 0); }
public bool IsControlsEmpty(string aModule, string aFilename = "") { return(string.IsNullOrEmpty(mDBName) || string.IsNullOrEmpty(aModule) ? true : TableM4Controls.IsEmpty(aModule, aFilename)); }
public static bool CreateDB(string dbName) { bool result = true; SqlCommand myCommand; SqlConnection myConn = new SqlConnection(string.Format("Server={0};Integrated security=True;database=master", System.Environment.MachineName)); if (!ExistDB()) { string str; str = string.Format("CREATE DATABASE {0}", dbName); myCommand = new SqlCommand(str, myConn); try { myConn.Open(); myCommand.ExecuteNonQuery(); } catch (SqlException ex) { System.Diagnostics.Debug.WriteLine(ex.Message, "CREATE DATABASE"); } finally { if (myConn.State == ConnectionState.Open) { myConn.Close(); } } } conn = new SqlConnection(Connection); conn.Open(); if (!ExistDBTable("Fields")) { if (TableM4Fields.Create()) { result = false; } } if (!ExistDBTable("Tables")) { if (TableM4Tables.Create()) { result = false; } } if (!ExistDBTable("ControlsClasses")) { if (TableM4ControlsClasses.Create()) { result = false; } } if (!ExistDBTable("Controls")) { if (TableM4Controls.Create()) { result = false; } } if (!ExistDBTable("Label")) { if (TableM4Label.Create()) { result = false; } } if (conn.State == ConnectionState.Open) { conn.Close(); } return(result); }