Esempio n. 1
0
        //TODO cuando se crea un record en la tabla de cuentas contables hay que terminar de rellenar datos (importante: nombres de las cuentas)
        public override void CreateTable(string tableName, string cod, CuentaMayor acc)
        {
            //Create account table
            string command = this.CreateCmd;

            command = command.Remove(this._TypeNameIndex, this._TypeNameLength);
            command = command.Insert(this._TypeNameIndex, tableName);

            this.ExecuteNonQuery(command);

            //Update cdad's list(table) of accounts with the new table, create it if no exist
            TableCreateCmds Tcc           = new TableCreateCmds();
            string          accountsTable = "C" + cod + Tcc.TableTypeNames[(int)TableType.CuentasC];

            if (!base.ExistsTableInDB(accountsTable))
            {
                command = Tcc[TableType.CuentasC];
                command = command.Remove(this._TypeNameIndex, this._TypeNameLength);
                command = command.Insert(this._TypeNameIndex, accountsTable);

                this.ExecuteNonQuery(command);
            }

            //TODO faltan nombres de las cuentas
            this.ExecuteNonQuery(string.Format("INSERT INTO {0} (CodigoCuenta, Grupo, Subgrupo, Sufijo, Nombre) VALUES ({1},{2},{3},{4},'{5}')",
                                               accountsTable,
                                               acc.Id,
                                               acc.Grupo,
                                               acc.Subgrupo,
                                               acc.Sufijo,
                                               acc.Nombre));
        }
Esempio n. 2
0
        public TabMayorDBConnection()
        {
            TableCreateCmds commands = new TableCreateCmds();

            this._CreateCmd      = commands[TableType.Mayor];
            this._TypeNameIndex  = commands.TypeNameIndex;
            this._TypeNameLength = commands.TypeNameLength;
        }