public virtual void Fill() { this.PreFill(); this.dsS_PLACA_ODBICI_GODINADataSet1 = new S_PLACA_ODBICI_GODINADataSet(); this.m_StartRow = 0; this.Cursor = Cursors.WaitCursor; this.m_GridLoading = true; ThreadPool.QueueUserWorkItem(new WaitCallback(this.FillDataThread), Thread.CurrentPrincipal); }
public void PuniTablicu() { if (Interaction.MsgBox("Želite li stvarno izbrisati postojeće podatke \r\n i napuniti tablicu prava na godišnje odbitke\r\n sa novim podacima???", MsgBoxStyle.YesNo, null) != MsgBoxResult.No) { DataRow current; IEnumerator enumerator = null; IEnumerator enumerator2 = null; try { enumerator = this.userControlDataGridGOOBRACUN.DataGrid.DataSet.GOOBRACUN.Rows.GetEnumerator(); while (enumerator.MoveNext()) { current = (DataRow)enumerator.Current; current.Delete(); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } GOOBRACUNDataAdapter adapter2 = new GOOBRACUNDataAdapter(); adapter2.Update(this.userControlDataGridGOOBRACUN.DataGrid.DataSet); S_PLACA_ODBICI_GODINADataAdapter adapter = new S_PLACA_ODBICI_GODINADataAdapter(); S_PLACA_ODBICI_GODINADataSet dataSet = new S_PLACA_ODBICI_GODINADataSet(); adapter.Fill(dataSet, "2010"); try { enumerator2 = dataSet.S_PLACA_ODBICI_GODINA.Rows.GetEnumerator(); while (enumerator2.MoveNext()) { DataRow row2 = (DataRow)enumerator2.Current; current = this.userControlDataGridGOOBRACUN.DataGrid.DataSet.GOOBRACUN.NewRow(); current["IDRADNIK"] = RuntimeHelpers.GetObjectValue(row2["IDRADNIK"]); current["ODBICIISKORISTIVO"] = RuntimeHelpers.GetObjectValue(row2["ODBITAK"]); current["OLAKSICEISKORISTIVO"] = RuntimeHelpers.GetObjectValue(row2["OLAKSICE"]); this.userControlDataGridGOOBRACUN.DataGrid.DataSet.GOOBRACUN.Rows.Add(current); } } finally { if (enumerator2 is IDisposable) { (enumerator2 as IDisposable).Dispose(); } } adapter2.Update(this.userControlDataGridGOOBRACUN.DataGrid.DataSet); } }