Ejemplo n.º 1
0
        public static int Insert(string aControlClass, string aJsonName)
        {
            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter("ControlClass", aControlClass.Trim()));
            param.Add(new SqlParameter("JsonName", aJsonName.Trim()));

            string query = string.Format("INSERT INTO [ControlsClasses] ([ControlClass], [JsonName]) VALUES ( @ControlClass, @JsonName)");

            return(SQLServerManagement.ExecuteNonQuery(query, param));
        }
        public static int Insert(string aParentTable, string aTable)
        {
            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter("ParentTable", aParentTable.Trim()));
            param.Add(new SqlParameter("Table", aTable.Trim()));

            string query = string.Format("INSERT INTO [Tables] ([ParentTableName], [TableName]) VALUES ( @ParentTable, @Table)");

            return(SQLServerManagement.ExecuteNonQuery(query, param));
        }
Ejemplo n.º 3
0
        public static int Insert(string IDC)
        {
            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter("IDC", IDC.Trim()));


            string query = string.Format("INSERT into [Label] ([IDC]) VALUES (@IDC)");

            return(SQLServerManagement.ExecuteNonQuery(query, param));
        }
        public static int Insert(string aTable, string aField, string aFieldNamespace)
        {
            List <SqlParameter> param = new List <SqlParameter>();

            param.Add(new SqlParameter("Table", aTable.Trim()));
            param.Add(new SqlParameter("Field", aField.Trim()));
            param.Add(new SqlParameter("FieldNamespace", aFieldNamespace.Trim()));

            string query = string.Format("INSERT INTO [Fields] ([TableName], [FieldName], [FieldNamespace]) VALUES ( @Table, @Field, @FieldNamespace)");

            return(SQLServerManagement.ExecuteNonQuery(query, param));
        }
Ejemplo n.º 5
0
        public static int Delete(string aModule, string aFilename = "")
        {
            List <SqlParameter> param = new List <SqlParameter>();

            if (string.IsNullOrEmpty(aFilename))
            {
                param.Add(new SqlParameter("module", aModule.Trim()));
                param.Add(new SqlParameter("filename", aFilename.Trim()));
                string query = "DELETE FROM [Controls] WHERE [Module] = @module";
                return(SQLServerManagement.ExecuteNonQuery(query, param));
            }
            else
            {
                param.Add(new SqlParameter("module", aModule.Trim()));
                param.Add(new SqlParameter("filename", aFilename.Trim()));
                string query = "DELETE FROM [Controls] WHERE [Module] = @module AND [Filename] = @filename";
                return(SQLServerManagement.ExecuteNonQuery(query, param));
            }
        }
Ejemplo n.º 6
0
        public static int Insert(_CONTROL cl)
        {
            List <SqlParameter> param = new List <SqlParameter>();

            #region Assignment
            param.Add(new SqlParameter("module", cl._module.Trim()));
            param.Add(new SqlParameter("idc", cl._idc.Trim()));
            param.Add(new SqlParameter("filename", cl._filename.Trim()));
            param.Add(new SqlParameter("class", cl._class.Trim()));
            param.Add(new SqlParameter("classidd", !string.IsNullOrWhiteSpace(cl._classidd) ? cl._classidd.Trim() : ""));
            param.Add(new SqlParameter("tiletext", !string.IsNullOrWhiteSpace(cl._tiletext) ? cl._tiletext.Trim() : ""));
            param.Add(new SqlParameter("tilesize", !string.IsNullOrWhiteSpace(cl._tilesize) ? cl._tilesize.Trim() : ""));
            param.Add(new SqlParameter("bodyeditidc", !string.IsNullOrWhiteSpace(cl._bodyeditidc) ? cl._bodyeditidc.Trim() : ""));
            param.Add(new SqlParameter("bodyedittext", !string.IsNullOrWhiteSpace(cl._bodyedittext) ? cl._bodyedittext.Trim() : ""));
            param.Add(new SqlParameter("namespace", !string.IsNullOrWhiteSpace(cl._namespace) ? cl._namespace.Trim() : ""));
            param.Add(new SqlParameter("dbtpointer", !string.IsNullOrWhiteSpace(cl._dbtpointer) ? cl._dbtpointer.Trim() : ""));
            param.Add(new SqlParameter("dbtnamespace", !string.IsNullOrWhiteSpace(cl._dbtnamespace) ? cl._dbtnamespace.Trim() : ""));
            param.Add(new SqlParameter("recordpointer", !string.IsNullOrWhiteSpace(cl._recordpointer) ? cl._recordpointer.Trim() : ""));
            param.Add(new SqlParameter("recordclass", !string.IsNullOrWhiteSpace(cl._recordclass) ? cl._recordclass.Trim() : ""));
            param.Add(new SqlParameter("field", !string.IsNullOrWhiteSpace(cl._field) ? cl._field.Trim() : ""));
            param.Add(new SqlParameter("fieldnamespace", !string.IsNullOrWhiteSpace(cl._fieldnamespace) ? cl._fieldnamespace.Trim() : ""));
            param.Add(new SqlParameter("text", !string.IsNullOrWhiteSpace(cl._text) ? cl._text.Trim() : ""));
            param.Add(new SqlParameter("combotype", !string.IsNullOrWhiteSpace(cl._combotype) ? cl._combotype.Trim() : ""));
            param.Add(new SqlParameter("runtimeclass", !string.IsNullOrWhiteSpace(cl._runtimeclass) ? cl._runtimeclass.Trim() : ""));
            param.Add(new SqlParameter("hkl", !string.IsNullOrWhiteSpace(cl._hkl) ? cl._hkl.Trim() : ""));
            param.Add(new SqlParameter("button", !string.IsNullOrWhiteSpace(cl._button) ? cl._button.Trim() : ""));
            param.Add(new SqlParameter("generatejson", cl._generatejson ? 1 : 0));
            param.Add(new SqlParameter("tilestyle", cl._tilestyle));
            param.Add(new SqlParameter("isaddlink", cl._isaddlink ? 1 : 0));
            param.Add(new SqlParameter("order", !string.IsNullOrWhiteSpace(cl._order) ? cl._order.Trim() : ""));
            param.Add(new SqlParameter("hidden", cl._hidden ? 1 : 0));
            param.Add(new SqlParameter("noChange_Grayed", cl._noChange_Grayed ? 1 : 0));
            param.Add(new SqlParameter("grayed", cl._grayed ? 1 : 0));
            param.Add(new SqlParameter("minValue", !string.IsNullOrWhiteSpace(cl._minValue) ? cl._minValue.Trim() : ""));
            param.Add(new SqlParameter("maxValue", !string.IsNullOrWhiteSpace(cl._maxValue) ? cl._maxValue.Trim() : ""));
            param.Add(new SqlParameter("chars", !string.IsNullOrWhiteSpace(cl._chars) ? cl._chars.Trim() : ""));
            param.Add(new SqlParameter("rows", !string.IsNullOrWhiteSpace(cl._rows) ? cl._rows.Trim() : ""));
            #endregion

            System.Diagnostics.Debug.WriteLine("CONTROLS TABLE: " + cl._module + " " + cl._idc + " " + cl._filename + " " + cl._class);
            string query = string.Format(insert);
            return(SQLServerManagement.ExecuteNonQuery(query, param));
        }
Ejemplo n.º 7
0
        public static int Delete()
        {
            string query = "DELETE FROM [ControlsClasses]";

            return(SQLServerManagement.ExecuteNonQuery(query));
        }
Ejemplo n.º 8
0
 public static bool Create()
 {
     return(SQLServerManagement.ExecuteNonQuery(create) >= 0);
 }
Ejemplo n.º 9
0
        public static int Delete()
        {
            string query = "DELETE FROM [Label]";

            return(SQLServerManagement.ExecuteNonQuery(query));
        }