Exemple #1
0
 public trazi_proizvodDataSet.PROIZVODRow AddPROIZVODRow(int iDPROIZVOD, string nAZIVPROIZVOD, decimal cIJENA, int fINPOREZIDPOREZ, decimal fINPOREZSTOPA, int iDJEDINICAMJERE, string nAZIVJEDINICAMJERE)
 {
     trazi_proizvodDataSet.PROIZVODRow row = (trazi_proizvodDataSet.PROIZVODRow) this.NewRow();
     row.ItemArray = new object[] { iDPROIZVOD, nAZIVPROIZVOD, cIJENA, fINPOREZIDPOREZ, fINPOREZSTOPA, iDJEDINICAMJERE, nAZIVJEDINICAMJERE };
     this.Rows.Add(row);
     return(row);
 }
Exemple #2
0
 public PROIZVODRowChangeEvent(trazi_proizvodDataSet.PROIZVODRow row, DataRowAction action)
 {
     this.eventRow    = row;
     this.eventAction = action;
 }
Exemple #3
0
 public void RemovePROIZVODRow(trazi_proizvodDataSet.PROIZVODRow row)
 {
     this.Rows.Remove(row);
 }
Exemple #4
0
 public void AddPROIZVODRow(trazi_proizvodDataSet.PROIZVODRow row)
 {
     this.Rows.Add(row);
 }
Exemple #5
0
        public void executePrivate(int startRow, int maxRows)
        {
            this.m_WhereString = " WHERE " + this.filterString + "  TM1.[NAZIVPROIZVOD] like '%' + @nazivproizvod + '%'";
            if (maxRows >= 0)
            {
                if (startRow == 0)
                {
                    this.scmdbuf = "SELECT TOP " + maxRows.ToString() + "  TM1.[IDPROIZVOD], TM1.[NAZIVPROIZVOD], TM1.[CIJENA], TM1.[FINPOREZIDPOREZ], T3.[FINPOREZSTOPA], TM1.[IDJEDINICAMJERE], T2.[NAZIVJEDINICAMJERE] FROM (([PROIZVOD] TM1 INNER JOIN [JEDINICAMJERE] T2 ON T2.[IDJEDINICAMJERE] = TM1.[IDJEDINICAMJERE]) INNER JOIN [FINPOREZ] T3 ON T3.[FINPOREZIDPOREZ] = TM1.[FINPOREZIDPOREZ])" + this.m_WhereString + "" + this.orderString + "";
                }
                else
                {
                    if (string.Compare(this.m_WhereString.TrimEnd(new char[] { ' ' }), "".TrimEnd(new char[] { ' ' }), false, CultureInfo.CurrentCulture) == 0)
                    {
                        this.sWhereSep = " WHERE ";
                    }
                    else
                    {
                        this.sWhereSep = " AND ";
                    }
                    int internalRecordCount = this.GetInternalRecordCount(this.AV8nazivpr);
                    this.m_TopRowCount = Conversions.ToInteger(Interaction.IIf(internalRecordCount >= (startRow + maxRows), maxRows, RuntimeHelpers.GetObjectValue(Interaction.IIf(internalRecordCount >= startRow, internalRecordCount - startRow, 0))));
                    if (this.m_TopRowCount == 0)
                    {
                        return;
                    }
                    this.scmdbuf = "SELECT TM1.[IDPROIZVOD], TM1.[NAZIVPROIZVOD], TM1.[CIJENA], TM1.[FINPOREZIDPOREZ], T3.[FINPOREZSTOPA], TM1.[IDJEDINICAMJERE], T2.[NAZIVJEDINICAMJERE] FROM (([PROIZVOD] TM1 INNER JOIN [JEDINICAMJERE] T2 ON T2.[IDJEDINICAMJERE] = TM1.[IDJEDINICAMJERE]) INNER JOIN [FINPOREZ] T3 ON T3.[FINPOREZIDPOREZ] = TM1.[FINPOREZIDPOREZ]) WHERE TM1.[IDPROIZVOD] IN ( SELECT TOP " + maxRows.ToString() + " TM1.[IDPROIZVOD]  FROM (([PROIZVOD] TM1 INNER JOIN [JEDINICAMJERE] T2 ON T2.[IDJEDINICAMJERE] = TM1.[IDJEDINICAMJERE]) INNER JOIN [FINPOREZ] T3 ON T3.[FINPOREZIDPOREZ] = TM1.[FINPOREZIDPOREZ])" + this.m_WhereString + "" + this.sWhereSep + "TM1.[IDPROIZVOD] NOT IN ( SELECT TOP " + startRow.ToString() + " TM1.[IDPROIZVOD]  FROM (([PROIZVOD] TM1 INNER JOIN [JEDINICAMJERE] T2 ON T2.[IDJEDINICAMJERE] = TM1.[IDJEDINICAMJERE]) INNER JOIN [FINPOREZ] T3 ON T3.[FINPOREZIDPOREZ] = TM1.[FINPOREZIDPOREZ])" + this.m_WhereString + "" + this.orderString + ")" + this.orderString + ")" + this.orderString + "";
                }
            }
            else
            {
                this.scmdbuf = "SELECT TM1.[IDPROIZVOD], TM1.[NAZIVPROIZVOD], TM1.[CIJENA], TM1.[FINPOREZIDPOREZ], T3.[FINPOREZSTOPA], TM1.[IDJEDINICAMJERE], T2.[NAZIVJEDINICAMJERE] FROM (([PROIZVOD] TM1 INNER JOIN [JEDINICAMJERE] T2 ON T2.[IDJEDINICAMJERE] = TM1.[IDJEDINICAMJERE]) INNER JOIN [FINPOREZ] T3 ON T3.[FINPOREZIDPOREZ] = TM1.[FINPOREZIDPOREZ])" + this.m_WhereString + "" + this.orderString + " ";
            }
            this.cmPROIZVODSelect2 = this.connDefault.GetCommand(this.scmdbuf, false);
            if (this.cmPROIZVODSelect2.IDbCommand.Parameters.Count == 0)
            {
                this.cmPROIZVODSelect2.IDbCommand.Parameters.Add(this.dsDefault.GetDbParameter("@nazivproizvod", DbType.String, 500));
            }
            this.lV8nazivpr = StringUtil.PadRight(StringUtil.RTrim(this.AV8nazivpr), 500, "%");
            this.cmPROIZVODSelect2.SetParameter(0, this.lV8nazivpr);
            this.cmPROIZVODSelect2.ErrorMask |= ErrorMask.Lock;
            this.PROIZVODSelect2              = this.cmPROIZVODSelect2.FetchData();
            int num = 0;

            while (this.cmPROIZVODSelect2.HasMoreRows && (num != maxRows))
            {
                this.m_IDPROIZVOD                      = this.dsDefault.Db.GetInt32(this.PROIZVODSelect2, 0, ref this.m__IDPROIZVODIsNull);
                this.m_NAZIVPROIZVOD                   = this.dsDefault.Db.GetString(this.PROIZVODSelect2, 1, ref this.m__NAZIVPROIZVODIsNull);
                this.m_CIJENA                          = this.dsDefault.Db.GetDecimal(this.PROIZVODSelect2, 2, ref this.m__CIJENAIsNull);
                this.m_FINPOREZIDPOREZ                 = this.dsDefault.Db.GetInt32(this.PROIZVODSelect2, 3, ref this.m__FINPOREZIDPOREZIsNull);
                this.m_FINPOREZSTOPA                   = this.dsDefault.Db.GetDecimal(this.PROIZVODSelect2, 4, ref this.m__FINPOREZSTOPAIsNull);
                this.m_IDJEDINICAMJERE                 = this.dsDefault.Db.GetInt32(this.PROIZVODSelect2, 5, ref this.m__IDJEDINICAMJEREIsNull);
                this.m_NAZIVJEDINICAMJERE              = this.dsDefault.Db.GetString(this.PROIZVODSelect2, 6, ref this.m__NAZIVJEDINICAMJEREIsNull);
                this.m_NAZIVJEDINICAMJERE              = this.dsDefault.Db.GetString(this.PROIZVODSelect2, 6, ref this.m__NAZIVJEDINICAMJEREIsNull);
                this.m_FINPOREZSTOPA                   = this.dsDefault.Db.GetDecimal(this.PROIZVODSelect2, 4, ref this.m__FINPOREZSTOPAIsNull);
                this.rowPROIZVOD                       = this.trazi_proizvodSet.PROIZVOD.NewPROIZVODRow();
                this.rowPROIZVOD["IDPROIZVOD"]         = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__IDPROIZVODIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_IDPROIZVOD));
                this.rowPROIZVOD["NAZIVPROIZVOD"]      = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__NAZIVPROIZVODIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_NAZIVPROIZVOD));
                this.rowPROIZVOD["CIJENA"]             = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__CIJENAIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_CIJENA));
                this.rowPROIZVOD["FINPOREZIDPOREZ"]    = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__FINPOREZIDPOREZIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_FINPOREZIDPOREZ));
                this.rowPROIZVOD["FINPOREZSTOPA"]      = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__FINPOREZSTOPAIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_FINPOREZSTOPA));
                this.rowPROIZVOD["IDJEDINICAMJERE"]    = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__IDJEDINICAMJEREIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_IDJEDINICAMJERE));
                this.rowPROIZVOD["NAZIVJEDINICAMJERE"] = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__NAZIVJEDINICAMJEREIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_NAZIVJEDINICAMJERE));
                this.AddRowProizvod();
                num++;
                this.cmPROIZVODSelect2.HasMoreRows = this.PROIZVODSelect2.Read();
            }
            this.PROIZVODSelect2.Close();
            this.Cleanup();
        }