Ejemplo n.º 1
0
        public SQLCommandsReturnInfoClass ExecSql(string cmd, DBRegistrationClass DBReg, NotifiesClass localNotify)
        {
            var SQLcommand = new SQLCommandsClass(DBReg);

            SQLcommand.SetEncoding("NONE");
            var ri = SQLcommand.ExecuteCommand(cmd, true);

            if (!ri.commandDone)
            {
                string errorStr = AppStaticFunctionsClass.GetErrorCodeString(ri.lastError, DBReg);
                localNotify?.AddToERROR(AppStaticFunctionsClass.GetFormattedError($@"FieldForm->ExecuteCommand", $@"{cmd}->{errorStr}"));
            }
            else
            {
                localNotify?.AddToINFO(AppStaticFunctionsClass.GetFormattedInfo($@"Command done", cmd));
            }
            return(ri);
        }
Ejemplo n.º 2
0
        private void DoCreateAlter(IList <string> cmd, DBRegistrationClass DBReg)
        {
            var SQLcommand = new SQLCommandsClass(DBReg);

            SQLcommand.Notify.Register4Info(MeldungRaised);
            SQLcommand.Notify.Register4Error(ErrorRaised);
            IList <string> cmd2 = new List <string>();

            foreach (string s in cmd)
            {
                if (s.Trim().StartsWith("/*"))
                {
                    continue;
                }
                if (string.IsNullOrEmpty(s))
                {
                    continue;
                }
                cmd2.Add(s);
            }

            var ri = SQLcommand.ExecuteCommand(cmd2, true);
        }
Ejemplo n.º 3
0
        private SQLCommandsReturnInfoClass ExecSql(string command)
        {
            var _sqLcommand = new SQLCommandsClass(DBReg);

            _sqLcommand.SetEncoding(cbEncoding.Text);

            var ri = _sqLcommand.ExecuteCommandWithGlobalConnection(command, true);

            if (ri.commandDone)
            {
                done++;
                txtSQLdone.Text    += $@"{command}{Environment.NewLine}";
                tabPageSQLdone.Text = $@"SQL done {done}";
            }
            else
            {
                notdone++;
                txtSQLfail.Text    += $@"{command}{Environment.NewLine}";
                tabPageSQLfail.Text = $@"SQL fail {notdone}";
            }

            return(ri);
        }
Ejemplo n.º 4
0
        public SQLViewForm1(DBRegistrationClass ca, List <TableClass> actTables, Form mdiParent = null, eColorDesigns appDesign = eColorDesigns.Gray, eColorDesigns developDesign = eColorDesigns.Gray, bool testMode = false)
        {
            MdiParent      = mdiParent;
            _dbReg         = ca;
            _actTables     = actTables;
            _appDesign     = appDesign;
            _developDesign = developDesign;
            InitializeComponent();

            var nf = new NotifiesClass();

            nf.gaugeNotify.OnRaiseGaugeHandler += new NotifyGauge.RaiseGaugeHandler(GaugeRaised);
            _localNotifies.AddNotify(nf, "SQLViewForm");
            _localNotifies.AddNotify(NotifiesClass.Instance(), "GLOBAL");
            _sqLcommand           = new SQLCommandsClass(_dbReg, _localNotifies.Find("SQLViewForm"));
            tabPageSucceeded.Text = "commands succeded DESC";
            Meldungen();
            Errors();
            History();
            ClearDevelopDesign(_developDesign);
            SetDesign(_appDesign);
            cbTestlauf.Checked = testMode;
            cbTestlauf.Visible = testMode;
        }
Ejemplo n.º 5
0
 private void DoCreateAlter(IList <string> cmd, DBRegistrationClass DBReg, NotifiesClass _localNofity, string Name)
 {
     var SQLcommand = new SQLCommandsClass(DBReg, _localNofity);
     var ri         = SQLcommand.ExecuteCommand(cmd, true);
 }