Пример #1
0
        // CONTROLS

        public bool  UpdateControl(_CONTROL control)
        {
            if (string.IsNullOrEmpty(mDBName))
            {
                return(false);
            }
            TableM4Controls.Update(control);
            return(true);
        }
Пример #2
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));
        }
Пример #3
0
        public static _CONTROL GetValue()
        {
            _CONTROL cl = new _CONTROL();

            cl._module          = SQLServerManagement.GetValue <string>("Module");
            cl._filename        = SQLServerManagement.GetValue <string>("Filename");
            cl._class           = SQLServerManagement.GetValue <string>("Class");
            cl._idc             = SQLServerManagement.GetValue <string>("IDC");
            cl._generatejson    = SQLServerManagement.GetValue <bool>("GenerateJson");
            cl._classidd        = SQLServerManagement.GetValue <string>("ClassIDD");
            cl._tiletext        = SQLServerManagement.GetValue <string>("TileText");
            cl._tilesize        = SQLServerManagement.GetValue <string>("TileSize");
            cl._tilestyle       = SQLServerManagement.GetValue <int>("TileStyle");
            cl._bodyeditidc     = SQLServerManagement.GetValue <string>("BodyEditIDC");
            cl._bodyedittext    = SQLServerManagement.GetValue <string>("BodyEditText");
            cl._namespace       = SQLServerManagement.GetValue <string>("Namespace");
            cl._dbtpointer      = SQLServerManagement.GetValue <string>("DBTPointer");
            cl._dbtnamespace    = SQLServerManagement.GetValue <string>("DBTNamespace");
            cl._recordpointer   = SQLServerManagement.GetValue <string>("RecordPointer");
            cl._recordclass     = SQLServerManagement.GetValue <string>("RecordClass");
            cl._field           = SQLServerManagement.GetValue <string>("Field");
            cl._fieldnamespace  = SQLServerManagement.GetValue <string>("FieldNamespace");
            cl._text            = SQLServerManagement.GetValue <string>("Text");
            cl._combotype       = SQLServerManagement.GetValue <string>("ComboType");
            cl._runtimeclass    = SQLServerManagement.GetValue <string>("RuntimeClass");
            cl._hkl             = SQLServerManagement.GetValue <string>("HotKeyLink");
            cl._button          = SQLServerManagement.GetValue <string>("Button");
            cl._isaddlink       = SQLServerManagement.GetValue <bool>("IsAddLink");
            cl._order           = SQLServerManagement.GetValue <string>("Order");
            cl._hidden          = SQLServerManagement.GetValue <bool>("Hidden");
            cl._noChange_Grayed = SQLServerManagement.GetValue <bool>("NoChange_Grayed");
            cl._grayed          = SQLServerManagement.GetValue <bool>("Grayed");
            cl._minValue        = SQLServerManagement.GetValue <string> ("MinValue");
            cl._maxValue        = SQLServerManagement.GetValue <string> ("MaxValue");
            cl._chars           = SQLServerManagement.GetValue <string>    ("Chars");
            cl._rows            = SQLServerManagement.GetValue <string>     ("Rows");

            return(cl);
        }
Пример #4
0
 public bool ControlsInsert(_CONTROL aControl)
 {
     return(string.IsNullOrEmpty(mDBName) ? false : TableM4Controls.Insert(aControl) >= 0);
 }