예제 #1
0
 public PROVIDER_BRUTODataSet.ELEMENTRow AddELEMENTRow(int iDELEMENT, string nAZIVELEMENT, short iDVRSTAELEMENTA, decimal pOSTOTAK, string eL)
 {
     PROVIDER_BRUTODataSet.ELEMENTRow row = (PROVIDER_BRUTODataSet.ELEMENTRow) this.NewRow();
     row.ItemArray = new object[] { iDELEMENT, nAZIVELEMENT, iDVRSTAELEMENTA, pOSTOTAK, eL };
     this.Rows.Add(row);
     return(row);
 }
예제 #2
0
        public void executePrivate(int startRow, int maxRows)
        {
            this.m_WhereString = " WHERE " + this.filterString + "  TM1.[IDVRSTAELEMENTA] = 2";
            if (maxRows >= 0)
            {
                if (startRow == 0)
                {
                    this.scmdbuf = "SELECT TOP " + maxRows.ToString() + "  TM1.[IDELEMENT], TM1.[NAZIVELEMENT], TM1.[IDVRSTAELEMENTA], TM1.[POSTOTAK], T2.[NAZIVVRSTAELEMENT]  FROM ([ELEMENT] TM1 INNER JOIN [VRSTAELEMENT] T2 ON T2.[IDVRSTAELEMENTA] = TM1.[IDVRSTAELEMENTA])" + this.m_WhereString + "" + this.orderString + "";
                }
                else
                {
                    string[] strArray = new string[] { " SELECT * FROM ( SELECT  TM1.[IDELEMENT], TM1.[NAZIVELEMENT], TM1.[IDVRSTAELEMENTA], TM1.[POSTOTAK], T2.[NAZIVVRSTAELEMENT], ROW_NUMBER() OVER  ( ", this.orderString, " ) AS DK_PAGENUM   FROM ([ELEMENT] TM1 INNER JOIN [VRSTAELEMENT] T2 ON T2.[IDVRSTAELEMENTA] = TM1.[IDVRSTAELEMENTA]) ", this.m_WhereString, " ) AS DK_PAGE WHERE DK_PAGENUM BETWEEN ", (startRow + 1).ToString(), " AND ", (startRow + maxRows).ToString() };
                    this.scmdbuf = string.Concat(strArray);
                }
            }
            else
            {
                this.scmdbuf = "SELECT TM1.[IDELEMENT], TM1.[NAZIVELEMENT], TM1.[IDVRSTAELEMENTA], TM1.[POSTOTAK], T2.[NAZIVVRSTAELEMENT] FROM ([ELEMENT] TM1 INNER JOIN [VRSTAELEMENT] T2 ON T2.[IDVRSTAELEMENTA] = TM1.[IDVRSTAELEMENTA])" + this.m_WhereString + "" + this.orderString + " ";
            }
            this.cmELEMENTSelect2            = this.connDefault.GetCommand(this.scmdbuf, false);
            this.cmELEMENTSelect2.ErrorMask |= ErrorMask.Lock;
            this.ELEMENTSelect2              = this.cmELEMENTSelect2.FetchData();
            int num = 0;

            while (this.cmELEMENTSelect2.HasMoreRows && (num != maxRows))
            {
                this.m_IDELEMENT         = this.dsDefault.Db.GetInt32(this.ELEMENTSelect2, 0, ref this.m__IDELEMENTIsNull);
                this.m_NAZIVELEMENT      = this.dsDefault.Db.GetString(this.ELEMENTSelect2, 1, ref this.m__NAZIVELEMENTIsNull);
                this.m_IDVRSTAELEMENTA   = this.dsDefault.Db.GetInt16(this.ELEMENTSelect2, 2, ref this.m__IDVRSTAELEMENTAIsNull);
                this.m_POSTOTAK          = this.dsDefault.Db.GetDecimal(this.ELEMENTSelect2, 3, ref this.m__POSTOTAKIsNull);
                this.m_NAZIVVRSTAELEMENT = this.dsDefault.Db.GetString(this.ELEMENTSelect2, 4, ref this.m__NAZIVVRSTAELEMENTIsNull);
                this.m_NAZIVVRSTAELEMENT = this.dsDefault.Db.GetString(this.ELEMENTSelect2, 4, ref this.m__NAZIVVRSTAELEMENTIsNull);
                if (!this.m__NAZIVVRSTAELEMENTIsNull)
                {
                    this.m_EL = this.m_NAZIVELEMENT.Trim() + " | " + this.m_NAZIVVRSTAELEMENT.Trim();
                }
                this.rowELEMENT = this.PROVIDER_BRUTOSet.ELEMENT.NewELEMENTRow();
                this.rowELEMENT["IDELEMENT"]       = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__IDELEMENTIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_IDELEMENT));
                this.rowELEMENT["NAZIVELEMENT"]    = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__NAZIVELEMENTIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_NAZIVELEMENT));
                this.rowELEMENT["IDVRSTAELEMENTA"] = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__IDVRSTAELEMENTAIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_IDVRSTAELEMENTA));
                this.rowELEMENT["POSTOTAK"]        = RuntimeHelpers.GetObjectValue(Interaction.IIf(this.m__POSTOTAKIsNull, RuntimeHelpers.GetObjectValue(Convert.DBNull), this.m_POSTOTAK));
                this.rowELEMENT.EL = this.m_EL;
                this.AddRowElement();
                num++;
                this.cmELEMENTSelect2.HasMoreRows = this.ELEMENTSelect2.Read();
            }
            this.ELEMENTSelect2.Close();
            this.Cleanup();
        }
예제 #3
0
 public virtual int FillPage(PROVIDER_BRUTODataSet dataSet, int startRow, int maxRows)
 {
     this.Initialize();
     this.connDefault        = this.dsDefault.GetReadWriteConnection(this.daCurrentTransaction);
     this.PROVIDER_BRUTOSet  = dataSet;
     this.rowELEMENT         = this.PROVIDER_BRUTOSet.ELEMENT.NewELEMENTRow();
     this.orderString        = GetOrderString(this.Order, true);
     this.reverseOrderString = GetOrderString(this.Order, false);
     try
     {
         this.executePrivate(startRow, maxRows);
     }
     finally
     {
         this.Cleanup();
     }
     return(0);
 }
예제 #4
0
 public ELEMENTRowChangeEvent(PROVIDER_BRUTODataSet.ELEMENTRow row, DataRowAction action)
 {
     this.eventRow    = row;
     this.eventAction = action;
 }
예제 #5
0
 public void RemoveELEMENTRow(PROVIDER_BRUTODataSet.ELEMENTRow row)
 {
     this.Rows.Remove(row);
 }
예제 #6
0
 public void AddELEMENTRow(PROVIDER_BRUTODataSet.ELEMENTRow row)
 {
     this.Rows.Add(row);
 }