Example #1
0
 public string GetJsonName(string aControlClass)
 {
     return(string.IsNullOrEmpty(mDBName) || string.IsNullOrEmpty(aControlClass) ? string.Empty : TableM4ControlsClasses.GetControlJsonName(aControlClass));
 }
Example #2
0
 public bool ControlsClassesInsert(string aJsonName, string aControlClass)
 {
     return(string.IsNullOrEmpty(mDBName) || string.IsNullOrEmpty(aJsonName) || string.IsNullOrEmpty(aControlClass) ? false : TableM4ControlsClasses.Insert(aJsonName, aControlClass) >= 0);
 }
Example #3
0
        // CONTROLS CLASSES

        public bool IsControlsClassesEmpty()
        {
            return(string.IsNullOrEmpty(mDBName) ? true : TableM4ControlsClasses.IsEmpty());
        }
Example #4
0
 public bool ControlsClassesDelete()
 {
     return(string.IsNullOrEmpty(mDBName) ? false : TableM4ControlsClasses.Delete() >= 0);
 }
Example #5
0
        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);
        }