Example #1
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [ZATVARANJAIZNOS], [GK1IDGKSTAVKA] AS GK1IDGKSTAVKA, [GK2IDGKSTAVKA] AS GK2IDGKSTAVKA FROM [ZATVARANJA] WITH (NOLOCK) WHERE [GK1IDGKSTAVKA] = @GK1IDGKSTAVKA AND [GK2IDGKSTAVKA] = @GK2IDGKSTAVKA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@GK1IDGKSTAVKA", DbType.Int32));
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@GK2IDGKSTAVKA", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowZATVARANJA["GK1IDGKSTAVKA"]));
            command.SetParameter(1, RuntimeHelpers.GetObjectValue(this.rowZATVARANJA["GK2IDGKSTAVKA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound201 = 1;
                this.rowZATVARANJA["ZATVARANJAIZNOS"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 0));
                this.rowZATVARANJA["GK1IDGKSTAVKA"]   = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 1));
                this.rowZATVARANJA["GK2IDGKSTAVKA"]   = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 2));
                this.sMode201 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode201;
            }
            else
            {
                this.RcdFound201 = 0;
            }
            reader.Close();
        }
Example #2
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [KOLONA], [ELEMENTBOLOVANJEIDELEMENT] AS ELEMENTBOLOVANJEIDELEMENT FROM [BOLOVANJEFOND] WITH (NOLOCK) WHERE [ELEMENTBOLOVANJEIDELEMENT] = @ELEMENTBOLOVANJEIDELEMENT ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@ELEMENTBOLOVANJEIDELEMENT", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowBOLOVANJEFOND["ELEMENTBOLOVANJEIDELEMENT"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound135 = 1;
                this.rowBOLOVANJEFOND["KOLONA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt16(reader, 0));
                this.rowBOLOVANJEFOND["ELEMENTBOLOVANJEIDELEMENT"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 1));
                this.sMode135 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.LoadBolovanjefond();
                this.Gx_mode = this.sMode135;
            }
            else
            {
                this.RcdFound135 = 0;
            }
            reader.Close();
        }
Example #3
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDTIPOLAKSICE], [NAZIVTIPOLAKSICE] FROM [TIPOLAKSICE] WITH (NOLOCK) WHERE [IDTIPOLAKSICE] = @IDTIPOLAKSICE ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDTIPOLAKSICE", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowTIPOLAKSICE["IDTIPOLAKSICE"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound37 = 1;
                this.rowTIPOLAKSICE["IDTIPOLAKSICE"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowTIPOLAKSICE["NAZIVTIPOLAKSICE"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.sMode37 = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.Gx_mode = this.sMode37;
            }
            else
            {
                this.RcdFound37 = 0;
            }
            reader.Close();
        }
Example #4
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDGOOBRACUN], [OLAKSICEISKORISTIVO], [ODBICIISKORISTIVO], [IDRADNIK] FROM [GOOBRACUN] WITH (NOLOCK) WHERE [IDGOOBRACUN] = @IDGOOBRACUN ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDGOOBRACUN", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowGOOBRACUN["IDGOOBRACUN"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound257 = 1;
                this.rowGOOBRACUN["IDGOOBRACUN"]         = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowGOOBRACUN["OLAKSICEISKORISTIVO"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 1));
                this.rowGOOBRACUN["ODBICIISKORISTIVO"]   = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.rowGOOBRACUN["IDRADNIK"]            = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 3));
                this.sMode257 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.LoadGoobracun();
                this.Gx_mode = this.sMode257;
            }
            else
            {
                this.RcdFound257 = 0;
            }
            reader.Close();
        }
Example #5
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [DDIDIZDATAK], [DDNAZIVIZDATKA], [DDPOSTOTAKIZDATKA] FROM [DDIZDATAK] WITH (NOLOCK) WHERE [DDIDIZDATAK] = @DDIDIZDATAK ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@DDIDIZDATAK", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowDDIZDATAK["DDIDIZDATAK"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound163 = 1;
                this.rowDDIZDATAK["DDIDIZDATAK"]       = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowDDIZDATAK["DDNAZIVIZDATKA"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.rowDDIZDATAK["DDPOSTOTAKIZDATKA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.sMode163 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode163;
            }
            else
            {
                this.RcdFound163 = 0;
            }
            reader.Close();
        }
Example #6
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [FINPOREZIDPOREZ], [FINPOREZNAZIVPOREZ], [FINPOREZSTOPA], [OSNOVICAUKNIZIIRA] FROM [FINPOREZ] WITH (NOLOCK) WHERE [FINPOREZIDPOREZ] = @FINPOREZIDPOREZ ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@FINPOREZIDPOREZ", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowFINPOREZ["FINPOREZIDPOREZ"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound206 = 1;
                this.rowFINPOREZ["FINPOREZIDPOREZ"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowFINPOREZ["FINPOREZNAZIVPOREZ"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.rowFINPOREZ["FINPOREZSTOPA"]      = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.rowFINPOREZ["OSNOVICAUKNIZIIRA"]  = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 3));
                this.sMode206 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode206;
            }
            else
            {
                this.RcdFound206 = 0;
            }
            reader.Close();
        }
Example #7
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDOSOBNIODBITAK], [NAZIVOSOBNIODBITAK], [FAKTOROSOBNOGODBITKA] FROM [OSOBNIODBITAK] WITH (NOLOCK) WHERE [IDOSOBNIODBITAK] = @IDOSOBNIODBITAK ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDOSOBNIODBITAK", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOSOBNIODBITAK["IDOSOBNIODBITAK"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound19 = 1;
                this.rowOSOBNIODBITAK["IDOSOBNIODBITAK"]      = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowOSOBNIODBITAK["NAZIVOSOBNIODBITAK"]   = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetStringNE(reader, 1));
                this.rowOSOBNIODBITAK["FAKTOROSOBNOGODBITKA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.sMode19 = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.Gx_mode = this.sMode19;
            }
            else
            {
                this.RcdFound19 = 0;
            }
            reader.Close();
        }
Example #8
0
 private void CheckExtendedTableOsnovaosiguranja()
 {
     if (!this.rowOSNOVAOSIGURANJA.IsZAMOOIDOSNOVAOSIGURANJANull())
     {
         ReadWriteCommand command = this.connDefault.GetCommand("SELECT [NAZIVOSNOVAOSIGURANJA] AS ZAMOONAZIVOSNOVAOSIGURANJA FROM [OSNOVAOSIGURANJA] WITH (NOLOCK) WHERE [IDOSNOVAOSIGURANJA] = @ZAMOOIDOSNOVAOSIGURANJA ", false);
         if (command.IDbCommand.Parameters.Count == 0)
         {
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@ZAMOOIDOSNOVAOSIGURANJA", DbType.String, 2));
         }
         command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOSNOVAOSIGURANJA["ZAMOOIDOSNOVAOSIGURANJA"]));
         IDataReader reader = command.FetchData();
         if (!command.HasMoreRows && (string.Compare("".TrimEnd(new char[] { ' ' }), StringUtil.RTrim(this.rowOSNOVAOSIGURANJA.ZAMOOIDOSNOVAOSIGURANJA).TrimEnd(new char[] { ' ' }), false, CultureInfo.CurrentCulture) != 0))
         {
             reader.Close();
             throw new OSNOVAOSIGURANJAForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("OSNOVAOSIGURANJA") }));
         }
         this.rowOSNOVAOSIGURANJA["ZAMOONAZIVOSNOVAOSIGURANJA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 0));
         reader.Close();
     }
     else
     {
         this.rowOSNOVAOSIGURANJA["ZAMOONAZIVOSNOVAOSIGURANJA"] = RuntimeHelpers.GetObjectValue(Convert.DBNull);
     }
     if (this.rowOSNOVAOSIGURANJA.IDOSNOVAOSIGURANJA.Length == 0)
     {
         throw new EmptyNotAllowedException(string.Format(this.resourceManager.GetString("notnullempty"), new object[] { "Å ifra osnove osiguranja" }));
     }
 }
Example #9
0
 private void CheckOptimisticConcurrencyPorez()
 {
     if (this.Gx_mode != StatementType.Insert)
     {
         ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDPOREZ], [NAZIVPOREZ], [POREZMJESECNO], [STOPAPOREZA], [MOPOREZ], [POPOREZ], [MZPOREZ], [PZPOREZ], [PRIMATELJPOREZ1], [PRIMATELJPOREZ2], [SIFRAOPISAPLACANJAPOREZ], [OPISPLACANJAPOREZ] FROM [POREZ] WITH (UPDLOCK) WHERE [IDPOREZ] = @IDPOREZ ", false);
         if (command.IDbCommand.Parameters.Count == 0)
         {
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDPOREZ", DbType.Int32));
         }
         command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowPOREZ["IDPOREZ"]));
         IDataReader reader = command.FetchData();
         if (command.Locked)
         {
             reader.Close();
             throw new POREZDataLockedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("lock"), new object[] { this.resourceManagerTables.GetString("POREZ") }));
         }
         this._Condition = false;
         if ((!command.HasMoreRows || !StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__NAZIVPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1)))) || ((!this.m__POREZMJESECNOOriginal.Equals(RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2))) || !this.m__STOPAPOREZAOriginal.Equals(RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 3)))) || (!StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__MOPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 4))) || !StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__POPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 5))))))
         {
             this._Condition = true;
         }
         if ((this._Condition || !StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__MZPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 6)))) || (!StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__PZPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 7))) || ((!StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__PRIMATELJPOREZ1Original), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 8))) || !StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__PRIMATELJPOREZ2Original), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 9)))) || !StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__SIFRAOPISAPLACANJAPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 10))))))
         {
             this._Condition = true;
         }
         if (this._Condition || !StringUtil.ObjectStringEquals(RuntimeHelpers.GetObjectValue(this.m__OPISPLACANJAPOREZOriginal), RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 11))))
         {
             reader.Close();
             throw new POREZDataChangedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("waschg"), new object[] { this.resourceManagerTables.GetString("POREZ") }));
         }
         reader.Close();
     }
 }
Example #10
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDOSNOVAOSIGURANJA], [RAZDOBLJESESMIJEPREKLAPATI], [NAZIVOSNOVAOSIGURANJA], [ZAMOOIDOSNOVAOSIGURANJA] AS ZAMOOIDOSNOVAOSIGURANJA FROM [OSNOVAOSIGURANJA] WITH (NOLOCK) WHERE [IDOSNOVAOSIGURANJA] = @IDOSNOVAOSIGURANJA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDOSNOVAOSIGURANJA", DbType.String, 2));
            }
            command.SetParameterString(0, RuntimeHelpers.GetObjectValue(this.rowOSNOVAOSIGURANJA["IDOSNOVAOSIGURANJA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound18 = 1;
                this.rowOSNOVAOSIGURANJA["IDOSNOVAOSIGURANJA"]         = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetStringNE(reader, 0));
                this.rowOSNOVAOSIGURANJA["RAZDOBLJESESMIJEPREKLAPATI"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetBoolean(reader, 1));
                this.rowOSNOVAOSIGURANJA["NAZIVOSNOVAOSIGURANJA"]      = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 2));
                this.rowOSNOVAOSIGURANJA["ZAMOOIDOSNOVAOSIGURANJA"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 3));
                this.sMode18 = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.LoadOsnovaosiguranja();
                this.Gx_mode = this.sMode18;
            }
            else
            {
                this.RcdFound18 = 0;
            }
            reader.Close();
        }
Example #11
0
        private void CheckDeleteErrorsOsnovaosiguranja()
        {
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT TOP 1 [IDOSNOVAOSIGURANJA] AS ZAMOOIDOSNOVAOSIGURANJA FROM [OSNOVAOSIGURANJA] WITH (NOLOCK) WHERE [ZAMOOIDOSNOVAOSIGURANJA] = @IDOSNOVAOSIGURANJA ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDOSNOVAOSIGURANJA", DbType.String, 2));
            }
            command2.SetParameterString(0, RuntimeHelpers.GetObjectValue(this.rowOSNOVAOSIGURANJA["IDOSNOVAOSIGURANJA"]));
            IDataReader reader2 = command2.FetchData();

            if (command2.HasMoreRows)
            {
                reader2.Close();
                throw new OSNOVAOSIGURANJAInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "OSNOVAOSIGURANJA" }));
            }
            reader2.Close();
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT TOP 1 [IDELEMENT] FROM [ELEMENT] WITH (NOLOCK) WHERE [IDOSNOVAOSIGURANJA] = @IDOSNOVAOSIGURANJA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDOSNOVAOSIGURANJA", DbType.String, 2));
            }
            command.SetParameterString(0, RuntimeHelpers.GetObjectValue(this.rowOSNOVAOSIGURANJA["IDOSNOVAOSIGURANJA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                reader.Close();
                throw new ELEMENTInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "ELEMENT" }));
            }
            reader.Close();
        }
Example #12
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDBENEFICIRANI], [NAZIVBENEFICIRANI], [BROJPRIZNATIHMJESECI] FROM [BENEFICIRANI] WITH (NOLOCK) WHERE [IDBENEFICIRANI] = @IDBENEFICIRANI ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDBENEFICIRANI", DbType.String, 1));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowBENEFICIRANI["IDBENEFICIRANI"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound3 = 1;
                this.rowBENEFICIRANI["IDBENEFICIRANI"]       = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 0));
                this.rowBENEFICIRANI["NAZIVBENEFICIRANI"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.rowBENEFICIRANI["BROJPRIZNATIHMJESECI"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt16(reader, 2));
                this.sMode3  = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.Gx_mode = this.sMode3;
            }
            else
            {
                this.RcdFound3 = 0;
            }
            reader.Close();
        }
Example #13
0
 private void CheckOptimisticConcurrencyZatvaranja()
 {
     if (this.Gx_mode != StatementType.Insert)
     {
         ReadWriteCommand command = this.connDefault.GetCommand("SELECT [ZATVARANJAIZNOS], [GK1IDGKSTAVKA] AS GK1IDGKSTAVKA, [GK2IDGKSTAVKA] AS GK2IDGKSTAVKA FROM [ZATVARANJA] WITH (UPDLOCK) WHERE [GK1IDGKSTAVKA] = @GK1IDGKSTAVKA AND [GK2IDGKSTAVKA] = @GK2IDGKSTAVKA ", false);
         if (command.IDbCommand.Parameters.Count == 0)
         {
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@GK1IDGKSTAVKA", DbType.Int32));
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@GK2IDGKSTAVKA", DbType.Int32));
         }
         command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowZATVARANJA["GK1IDGKSTAVKA"]));
         command.SetParameter(1, RuntimeHelpers.GetObjectValue(this.rowZATVARANJA["GK2IDGKSTAVKA"]));
         IDataReader reader = command.FetchData();
         if (command.Locked)
         {
             reader.Close();
             throw new ZATVARANJADataLockedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("lock"), new object[] { this.resourceManagerTables.GetString("ZATVARANJA") }));
         }
         if (!command.HasMoreRows || !this.m__ZATVARANJAIZNOSOriginal.Equals(RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 0))))
         {
             reader.Close();
             throw new ZATVARANJADataChangedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("waschg"), new object[] { this.resourceManagerTables.GetString("ZATVARANJA") }));
         }
         reader.Close();
     }
 }
Example #14
0
        private void CheckIntegrityErrorsZatvaranja()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDGKSTAVKA] AS GK1IDGKSTAVKA FROM [GKSTAVKA] WITH (NOLOCK) WHERE [IDGKSTAVKA] = @GK1IDGKSTAVKA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@GK1IDGKSTAVKA", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowZATVARANJA["GK1IDGKSTAVKA"]));
            IDataReader reader = command.FetchData();

            if (!command.HasMoreRows)
            {
                reader.Close();
                throw new GKSTAVKAForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("GKSTAVKA") }));
            }
            reader.Close();
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT [IDGKSTAVKA] AS GK2IDGKSTAVKA FROM [GKSTAVKA] WITH (NOLOCK) WHERE [IDGKSTAVKA] = @GK2IDGKSTAVKA ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@GK2IDGKSTAVKA", DbType.Int32));
            }
            command2.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowZATVARANJA["GK2IDGKSTAVKA"]));
            IDataReader reader2 = command2.FetchData();

            if (!command2.HasMoreRows)
            {
                reader2.Close();
                throw new GKSTAVKAForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("GKSTAVKA") }));
            }
            reader2.Close();
            throw new ForeignKeyNotFoundException(this.resourceManager.GetString("refinterror"));
        }
Example #15
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDOSRAZMJESTAJ], [KOLICINAULAZA], [KOLICINARASHODA], [IDLOKACIJE], [INVBROJ] FROM [OSRAZMJESTAJ] WITH (NOLOCK) WHERE [IDOSRAZMJESTAJ] = @IDOSRAZMJESTAJ ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDOSRAZMJESTAJ", DbType.Guid));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOSRAZMJESTAJ["IDOSRAZMJESTAJ"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound279 = 1;
                this.rowOSRAZMJESTAJ["IDOSRAZMJESTAJ"]  = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetGuid(reader, 0));
                this.rowOSRAZMJESTAJ["KOLICINAULAZA"]   = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 1));
                this.rowOSRAZMJESTAJ["KOLICINARASHODA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.rowOSRAZMJESTAJ["IDLOKACIJE"]      = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 3));
                this.rowOSRAZMJESTAJ["INVBROJ"]         = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt64(reader, 4));
                this.sMode279 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode279;
            }
            else
            {
                this.RcdFound279 = 0;
            }
            reader.Close();
        }
Example #16
0
        private void CheckDeleteErrorsLokacije()
        {
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT TOP 1 [INVBROJ], [IDOSDOKUMENT], [OSBROJDOKUMENTA] FROM [OSTEMELJNICA] WITH (NOLOCK) WHERE [RASHODLOKACIJEIDLOKACIJE] = @IDLOKACIJE ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDLOKACIJE", DbType.Int32));
            }
            command2.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowLOKACIJE["IDLOKACIJE"]));
            IDataReader reader2 = command2.FetchData();

            if (command2.HasMoreRows)
            {
                reader2.Close();
                throw new OSTEMELJNICAInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "TEMELJNICA" }));
            }
            reader2.Close();
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT TOP 1 [IDOSRAZMJESTAJ] FROM [OSRAZMJESTAJ] WITH (NOLOCK) WHERE [IDLOKACIJE] = @IDLOKACIJE ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDLOKACIJE", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowLOKACIJE["IDLOKACIJE"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                reader.Close();
                throw new OSRAZMJESTAJInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "OSRAZMJESTAJ" }));
            }
            reader.Close();
        }
Example #17
0
        private void CheckIntegrityErrorsOsrazmjestaj()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDLOKACIJE] FROM [LOKACIJE] WITH (NOLOCK) WHERE [IDLOKACIJE] = @IDLOKACIJE ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDLOKACIJE", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOSRAZMJESTAJ["IDLOKACIJE"]));
            IDataReader reader = command.FetchData();

            if (!command.HasMoreRows)
            {
                reader.Close();
                throw new LOKACIJEForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("LOKACIJE") }));
            }
            reader.Close();
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT [INVBROJ] FROM [OS] WITH (NOLOCK) WHERE [INVBROJ] = @INVBROJ ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@INVBROJ", DbType.Int64));
            }
            command2.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOSRAZMJESTAJ["INVBROJ"]));
            IDataReader reader2 = command2.FetchData();

            if (!command2.HasMoreRows)
            {
                reader2.Close();
                throw new OSForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("OS") }));
            }
            reader2.Close();
            throw new ForeignKeyNotFoundException(this.resourceManager.GetString("refinterror"));
        }
Example #18
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [RAD1IDSPREME], [IDSTRUCNASPREMA] FROM [RAD1SPREMEVEZA] WITH (NOLOCK) WHERE [RAD1IDSPREME] = @RAD1IDSPREME AND [IDSTRUCNASPREMA] = @IDSTRUCNASPREMA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@RAD1IDSPREME", DbType.Int32));
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDSTRUCNASPREMA", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowRAD1SPREMEVEZA["RAD1IDSPREME"]));
            command.SetParameter(1, RuntimeHelpers.GetObjectValue(this.rowRAD1SPREMEVEZA["IDSTRUCNASPREMA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound288 = 1;
                this.rowRAD1SPREMEVEZA["RAD1IDSPREME"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowRAD1SPREMEVEZA["IDSTRUCNASPREMA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 1));
                this.sMode288 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode288;
            }
            else
            {
                this.RcdFound288 = 0;
            }
            reader.Close();
        }
Example #19
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDGODINE], [GODINEAKTIVNA] FROM [GODINE] WITH (NOLOCK) WHERE [IDGODINE] = @IDGODINE ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDGODINE", DbType.Int16));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowGODINE["IDGODINE"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound186                = 1;
                this.rowGODINE["IDGODINE"]      = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt16(reader, 0));
                this.rowGODINE["GODINEAKTIVNA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetBoolean(reader, 1));
                this.sMode186 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode186;
            }
            else
            {
                this.RcdFound186 = 0;
            }
            reader.Close();
        }
Example #20
0
        private void CheckIntegrityErrorsRad1spremeveza()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [RAD1IDSPREME] FROM [RAD1SPREME] WITH (NOLOCK) WHERE [RAD1IDSPREME] = @RAD1IDSPREME ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@RAD1IDSPREME", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowRAD1SPREMEVEZA["RAD1IDSPREME"]));
            IDataReader reader = command.FetchData();

            if (!command.HasMoreRows)
            {
                reader.Close();
                throw new RAD1SPREMEForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("RAD1SPREME") }));
            }
            reader.Close();
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT [IDSTRUCNASPREMA] FROM [STRUCNASPREMA] WITH (NOLOCK) WHERE [IDSTRUCNASPREMA] = @IDSTRUCNASPREMA ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDSTRUCNASPREMA", DbType.Int32));
            }
            command2.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowRAD1SPREMEVEZA["IDSTRUCNASPREMA"]));
            IDataReader reader2 = command2.FetchData();

            if (!command2.HasMoreRows)
            {
                reader2.Close();
                throw new STRUCNASPREMAForeignKeyNotFoundException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("inex"), new object[] { this.resourceManagerTables.GetString("STRUCNASPREMA") }));
            }
            reader2.Close();
            throw new ForeignKeyNotFoundException(this.resourceManager.GetString("refinterror"));
        }
Example #21
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDRSVRSTEOBRACUNA], [NAZIVRSVRSTEOBRACUNA] FROM [RSVRSTEOBRACUNA] WITH (NOLOCK) WHERE [IDRSVRSTEOBRACUNA] = @IDRSVRSTEOBRACUNA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDRSVRSTEOBRACUNA", DbType.String, 2));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowRSVRSTEOBRACUNA["IDRSVRSTEOBRACUNA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound29 = 1;
                this.rowRSVRSTEOBRACUNA["IDRSVRSTEOBRACUNA"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 0));
                this.rowRSVRSTEOBRACUNA["NAZIVRSVRSTEOBRACUNA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.sMode29 = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.Gx_mode = this.sMode29;
            }
            else
            {
                this.RcdFound29 = 0;
            }
            reader.Close();
        }
Example #22
0
 private void CheckOptimisticConcurrencyRad1spremeveza()
 {
     if (this.Gx_mode != StatementType.Insert)
     {
         ReadWriteCommand command = this.connDefault.GetCommand("SELECT [RAD1IDSPREME], [IDSTRUCNASPREMA] FROM [RAD1SPREMEVEZA] WITH (UPDLOCK) WHERE [RAD1IDSPREME] = @RAD1IDSPREME AND [IDSTRUCNASPREMA] = @IDSTRUCNASPREMA ", false);
         if (command.IDbCommand.Parameters.Count == 0)
         {
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@RAD1IDSPREME", DbType.Int32));
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDSTRUCNASPREMA", DbType.Int32));
         }
         command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowRAD1SPREMEVEZA["RAD1IDSPREME"]));
         command.SetParameter(1, RuntimeHelpers.GetObjectValue(this.rowRAD1SPREMEVEZA["IDSTRUCNASPREMA"]));
         IDataReader reader = command.FetchData();
         if (command.Locked)
         {
             reader.Close();
             throw new RAD1SPREMEVEZADataLockedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("lock"), new object[] { this.resourceManagerTables.GetString("RAD1SPREMEVEZA") }));
         }
         if (!command.HasMoreRows)
         {
             reader.Close();
             throw new RAD1SPREMEVEZADataChangedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("waschg"), new object[] { this.resourceManagerTables.GetString("RAD1SPREMEVEZA") }));
         }
         reader.Close();
     }
 }
Example #23
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDGRUPEOLAKSICA], [NAZIVGRUPEOLAKSICA], [MAXIMALNIIZNOSGRUPE] FROM [GRUPEOLAKSICA] WITH (NOLOCK) WHERE [IDGRUPEOLAKSICA] = @IDGRUPEOLAKSICA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDGRUPEOLAKSICA", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowGRUPEOLAKSICA["IDGRUPEOLAKSICA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound6 = 1;
                this.rowGRUPEOLAKSICA["IDGRUPEOLAKSICA"]     = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowGRUPEOLAKSICA["NAZIVGRUPEOLAKSICA"]  = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.rowGRUPEOLAKSICA["MAXIMALNIIZNOSGRUPE"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.sMode6  = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.Gx_mode = this.sMode6;
            }
            else
            {
                this.RcdFound6 = 0;
            }
            reader.Close();
        }
Example #24
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [DATUMODLASKA], [IDRADNIK] FROM [OTISLI] WITH (NOLOCK) WHERE [IDRADNIK] = @IDRADNIK AND [DATUMODLASKA] = @DATUMODLASKA ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDRADNIK", DbType.Int32));
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@DATUMODLASKA", DbType.Date));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOTISLI["IDRADNIK"]));
            command.SetParameterDateObject(1, RuntimeHelpers.GetObjectValue(this.rowOTISLI["DATUMODLASKA"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound294 = 1;
                this.rowOTISLI["DATUMODLASKA"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDateTime(reader, 0));
                this.rowOTISLI["IDRADNIK"]     = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 1));
                this.sMode294 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode294;
            }
            else
            {
                this.RcdFound294 = 0;
            }
            reader.Close();
        }
Example #25
0
        private void CheckDeleteErrorsDdizdatak()
        {
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT TOP 1 [DDOBRACUNIDOBRACUN], [DDIDRADNIK], [DDIDIZDATAK] FROM [DDOBRACUNRadniciIzdaci] WITH (NOLOCK) WHERE [DDIDIZDATAK] = @DDIDIZDATAK ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@DDIDIZDATAK", DbType.Int32));
            }
            command2.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowDDIZDATAK["DDIDIZDATAK"]));
            IDataReader reader2 = command2.FetchData();

            if (command2.HasMoreRows)
            {
                reader2.Close();
                throw new DDOBRACUNRadniciIzdaciInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "Izdaci" }));
            }
            reader2.Close();
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT TOP 1 [IDKATEGORIJA], [DDIDIZDATAK] FROM [DDKATEGORIJAIzdaci] WITH (NOLOCK) WHERE [DDIDIZDATAK] = @DDIDIZDATAK ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@DDIDIZDATAK", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowDDIZDATAK["DDIDIZDATAK"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                reader.Close();
                throw new DDKATEGORIJAIzdaciInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "Izdaci" }));
            }
            reader.Close();
        }
Example #26
0
 private void CheckOptimisticConcurrencyOtisli()
 {
     if (this.Gx_mode != StatementType.Insert)
     {
         ReadWriteCommand command = this.connDefault.GetCommand("SELECT [DATUMODLASKA], [IDRADNIK] FROM [OTISLI] WITH (UPDLOCK) WHERE [IDRADNIK] = @IDRADNIK AND [DATUMODLASKA] = @DATUMODLASKA ", false);
         if (command.IDbCommand.Parameters.Count == 0)
         {
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDRADNIK", DbType.Int32));
             command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@DATUMODLASKA", DbType.Date));
         }
         command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOTISLI["IDRADNIK"]));
         command.SetParameterDateObject(1, RuntimeHelpers.GetObjectValue(this.rowOTISLI["DATUMODLASKA"]));
         IDataReader reader = command.FetchData();
         if (command.Locked)
         {
             reader.Close();
             throw new OTISLIDataLockedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("lock"), new object[] { this.resourceManagerTables.GetString("OTISLI") }));
         }
         if (!command.HasMoreRows)
         {
             reader.Close();
             throw new OTISLIDataChangedException(string.Format(CultureInfo.InvariantCulture, this.resourceManager.GetString("waschg"), new object[] { this.resourceManagerTables.GetString("OTISLI") }));
         }
         reader.Close();
     }
 }
Example #27
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDOPCINE], [NAZIVOPCINE], [PRIREZ], [VBDIOPCINA], [ZRNOPCINA] FROM [OPCINA] WITH (NOLOCK) WHERE [IDOPCINE] = @IDOPCINE ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDOPCINE", DbType.String, 4));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowOPCINA["IDOPCINE"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound16               = 1;
                this.rowOPCINA["IDOPCINE"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 0));
                this.rowOPCINA["NAZIVOPCINE"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1));
                this.rowOPCINA["PRIREZ"]      = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetDecimal(reader, 2));
                this.rowOPCINA["VBDIOPCINA"]  = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 3));
                this.rowOPCINA["ZRNOPCINA"]   = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 4));
                this.sMode16 = this.Gx_mode;
                this.Gx_mode = StatementType.Select;
                this.Gx_mode = this.sMode16;
            }
            else
            {
                this.RcdFound16 = 0;
            }
            reader.Close();
        }
Example #28
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [UCENIKRSMIDENT] FROM [UCENIKRSMIDENT] WITH (NOLOCK) WHERE [UCENIKRSMIDENT] = @UCENIKRSMIDENT ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@UCENIKRSMIDENT", DbType.String, 4));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowUCENIKRSMIDENT["UCENIKRSMIDENT"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound296 = 1;
                this.rowUCENIKRSMIDENT["UCENIKRSMIDENT"] = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 0));
                this.sMode296 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.Gx_mode  = this.sMode296;
            }
            else
            {
                this.RcdFound296 = 0;
            }
            reader.Close();
        }
Example #29
0
        private void GetByPrimaryKey()
        {
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT [IDORGJED], [NAZIVORGJED] FROM [ORGJED] WITH (NOLOCK) WHERE [IDORGJED] = @IDORGJED ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDORGJED", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowORGJED["IDORGJED"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                this.RcdFound191              = 1;
                this.rowORGJED["IDORGJED"]    = RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetInt32(reader, 0));
                this.rowORGJED["NAZIVORGJED"] = RuntimeHelpers.GetObjectValue(StringUtil.ObjectStringRightTrim(RuntimeHelpers.GetObjectValue(this.dsDefault.Db.GetString(reader, 1))));
                this.sMode191 = this.Gx_mode;
                this.Gx_mode  = StatementType.Select;
                this.LoadOrgjed();
                this.Gx_mode = this.sMode191;
            }
            else
            {
                this.RcdFound191 = 0;
            }
            reader.Close();
        }
Example #30
0
        private void CheckDeleteErrorsSpol()
        {
            ReadWriteCommand command2 = this.connDefault.GetCommand("SELECT TOP 1 [IDRADNIK] FROM [RADNIK] WITH (NOLOCK) WHERE [IDSPOL] = @IDSPOL ", false);

            if (command2.IDbCommand.Parameters.Count == 0)
            {
                command2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDSPOL", DbType.Int32));
            }
            command2.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowSPOL["IDSPOL"]));
            IDataReader reader2 = command2.FetchData();

            if (command2.HasMoreRows)
            {
                reader2.Close();
                throw new RADNIKInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "RADNIK" }));
            }
            reader2.Close();
            ReadWriteCommand command = this.connDefault.GetCommand("SELECT TOP 1 [RAD1SPOLID], [IDSPOL] FROM [RAD1VEZASPOL] WITH (NOLOCK) WHERE [IDSPOL] = @IDSPOL ", false);

            if (command.IDbCommand.Parameters.Count == 0)
            {
                command.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@IDSPOL", DbType.Int32));
            }
            command.SetParameter(0, RuntimeHelpers.GetObjectValue(this.rowSPOL["IDSPOL"]));
            IDataReader reader = command.FetchData();

            if (command.HasMoreRows)
            {
                reader.Close();
                throw new RAD1VEZASPOLInvalidDeleteException(string.Format(this.resourceManager.GetString("del"), new object[] { "RAD1VEZASPOL" }));
            }
            reader.Close();
        }