Beispiel #1
0
        public static void tableRefresh(In2SqlSvcTool.CurrentTableRecords vCTR, int vIsUndoList = 1)
        {
            var vActivCell = SqlEngine.currExcelApp.ActiveCell;

            if (vCTR.TypeConnection.Contains("ODBC"))
            {
                vActivCell.ListObject.QueryTable.CommandText = vCTR.Sql;
                objRefreshHistory(vActivCell.ListObject, vIsUndoList);

                if (vIsUndoList == 1)
                {
                    In2SqlSvcUndoManagment.addToUndoList(vActivCell.ListObject.Name, vCTR.Sql);
                }
            }

            if (vCTR.TypeConnection.Contains("CLOUD"))
            {
                In2SqlVBAEngineCloud.createExTable(
                    vCTR.CurrCloudName
                    , vCTR.TableName
                    , vCTR.Sql
                    , 1
                    , vCTR.CurrCloudExTName);

                In2SqlSvcTool.addSqlLog(vCTR.Sql);
                if (vIsUndoList == 1)
                {
                    In2SqlSvcUndoManagment.addToUndoList(vCTR.CurrCloudExTName, vCTR.Sql);
                }
            }
        }
Beispiel #2
0
        public static void Redo()
        {
            try
            {
                var vActivCell = SqlEngine.currExcelApp.ActiveCell;
                if ((vActivCell.ListObject == null) == false)
                {
                    In2SqlSvcTool.CurrentTableRecords vCTR = In2SqlSvcTool.getCurrentSql();

                    string vSql = In2SqlSvcUndoManagment.getLastSqlActionRedo(vActivCell.ListObject.Name);
                    if ((vSql == null) == false)
                    {
                        vCTR.Sql = vSql;

                        tableRefresh(vCTR, 0);
                    }
                    GetSelectedTab();

                    return;
                }
                MessageBox.Show(" Please,  select cell from the table", " Refresh error");
            }
            catch
            {
                MessageBox.Show(" Please, select cell from the table", " Refresh error");
            }
            GetSelectedTab();
        }
Beispiel #3
0
        public static void objRefreshHistory(Microsoft.Office.Interop.Excel.ListObject vCurrObject, int vIsUndoList = 1)
        {
            // SqlEngine.currExcelApp.EnableEvents = false;
            vCurrObject.QueryTable.CommandText = setSqlLimit(getOdbcNameFromObject(vCurrObject.QueryTable.Connection), vCurrObject.QueryTable.CommandText);

            In2SqlSvcTool.addSqlLog(vCurrObject.QueryTable.CommandText);

            objRefresh(vCurrObject);
            if (vIsUndoList == 1)
            {
                In2SqlSvcUndoManagment.addToUndoList(vCurrObject.Name, vCurrObject.QueryTable.CommandText);
            }
        }