コード例 #1
0
 public bool LabelExist(string idc)
 {
     return(TableM4Label.exist(idc));
 }
コード例 #2
0
 public bool ControlsDelete(string aModule, string aFilename = "")
 {
     TableM4Label.Delete();
     return(string.IsNullOrEmpty(mDBName) || string.IsNullOrEmpty(aModule) ? false : TableM4Controls.Delete(aModule, aFilename) >= 0);
 }
コード例 #3
0
 public void LabelInsert(string cl)
 {
     TableM4Label.Insert(cl);
 }
コード例 #4
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);
        }