private void SetComboBoxColumnProperties(bool setColumnsWidth) { if (DataAdapterFactory.Provider == null) { DataAdapterFactory.Provider = new SimpleDataAdapterFactory(); } DataSet dataSet = new LOKACIJEDataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetLOKACIJEDataAdapter().Fill(dataSet); } System.Data.DataView dataList = new System.Data.DataView(dataSet.Tables["LOKACIJE"]) { Sort = "LOK" }; CreateValueList(this.DataGrid, "LOKACIJEIDLOKACIJE", dataList, "IDLOKACIJE", "LOK"); UltraGridColumn column = this.DataGrid.DisplayLayout.Bands["OSRAZMJESTAJ"].Columns["IDLOKACIJE"]; column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column.ValueList = this.DataGrid.DisplayLayout.ValueLists["LOKACIJEIDLOKACIJE"]; if (setColumnsWidth) { column.Width = 370; } }
public virtual void Fill() { this.PreFill(); this.dsLOKACIJEDataSet1 = new LOKACIJEDataSet(); this.m_StartRow = 0; this.Cursor = Cursors.WaitCursor; this.m_GridLoading = true; ThreadPool.QueueUserWorkItem(new WaitCallback(this.FillDataThread), Thread.CurrentPrincipal); }
public RazmjestajSredstava() { base.Load += new EventHandler(this.IznosiNabave_Load); this.ds = new S_OS_STANJE_LOKACIJADataSet(); this.dalok = new LOKACIJEDataAdapter(); this.dslokacije = new LOKACIJEDataSet(); this.daStanje = new S_OS_STANJE_LOKACIJADataAdapter(); this.m_cmDisable = true; this.InitializeComponent(); }
public void DosImportHandler(object sender, EventArgs e) { LOKACIJEDataSet dataSet = new LOKACIJEDataSet(); LOKACIJEDataAdapter adapter2 = new LOKACIJEDataAdapter(); if (Interaction.MsgBox("Postojeće Lokacije biti će obrisane, želite li stvarno nastaviti???", MsgBoxStyle.YesNo, "Osnovna sredstva / SI") != MsgBoxResult.No) { IEnumerator enumerator = null; try { enumerator = this.userControlDataGridLOKACIJE.DataGrid.DataSet.LOKACIJE.Rows.GetEnumerator(); while (enumerator.MoveNext()) { ((DataRow)enumerator.Current).Delete(); } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } adapter2.Update(this.userControlDataGridLOKACIJE.DataGrid.DataSet); OpenFileDialog dialog = new OpenFileDialog { InitialDirectory = @"c:\", Filter = "txt files (*.dbf)|*.dbf|All files (*.*)|*.*", FilterIndex = 2, RestoreDirectory = true }; if (dialog.ShowDialog() == DialogResult.OK) { string str3 = dialog.FileName.ToUpper().Replace(@"\OSM.DBF", ""); string prompt = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + str3 + ";Extended Properties=dBase IV;"; Interaction.MsgBox(prompt, MsgBoxStyle.OkOnly, null); OleDbConnection selectConnection = new OleDbConnection(prompt); OleDbDataAdapter adapter = new OleDbDataAdapter("select * from KORISNIK ORDER BY SIFRA", selectConnection); DataSet set2 = new DataSet(); try { adapter.Fill(set2, "OSA"); if (Interaction.MsgBox("Broj pronađenih zapisa: " + Conversions.ToString(set2.Tables["OSA"].Rows.Count) + "\r\n\r\nŽelite li zadržati importirane zapise?", MsgBoxStyle.YesNo, null) == MsgBoxResult.No) { set2.RejectChanges(); } else { DataRow row3; IEnumerator enumerator2 = null; int num = 1; try { enumerator2 = set2.Tables["OSA"].Rows.GetEnumerator(); while (enumerator2.MoveNext()) { DataRow current = (DataRow)enumerator2.Current; row3 = dataSet.LOKACIJE.NewRow(); row3["idlokacije"] = Conversions.ToInteger(DB.IzvuciSamoBrojke(Conversions.ToString(current["SIFRA"]), false)); row3["opislokacije"] = DB.Ko437to852(Conversions.ToString(current["NAZIV"])).Substring(0, DB.Ko437to852(Conversions.ToString(current["NAZIV"])).Length - 1); dataSet.LOKACIJE.Rows.Add(row3); try { adapter2.Update(dataSet); } catch (System.Exception exception1) { throw exception1; } num++; } } finally { if (enumerator2 is IDisposable) { (enumerator2 as IDisposable).Dispose(); } } row3 = dataSet.LOKACIJE.NewRow(); row3["idlokacije"] = 0x270f; row3["opislokacije"] = "Neraspoređeno"; dataSet.LOKACIJE.Rows.Add(row3); try { adapter2.Update(dataSet); } catch (System.Exception exception4) { throw exception4; //System.Exception exception2 = exception4; //Interaction.MsgBox(exception2.Message, MsgBoxStyle.OkOnly, null); } MessageBox.Show("Importiranje lokacija završeno!", "Import", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); adapter2.Fill(this.userControlDataGridLOKACIJE.DataGrid.DataSet); } } catch (System.Exception exception5) { throw exception5; //System.Exception exception3 = exception5; //Interaction.MsgBox("Greška prilikom prebacivanja podataka!" + exception3.Message, MsgBoxStyle.OkOnly, null); } } } }
private void SetComboBoxColumnProperties(bool setColumnsWidth) { if (DataAdapterFactory.Provider == null) { DataAdapterFactory.Provider = new SimpleDataAdapterFactory(); } DataSet dataSet = new OSVRSTADataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetOSVRSTADataAdapter().Fill(dataSet); } System.Data.DataView dataList = new System.Data.DataView(dataSet.Tables["OSVRSTA"]) { Sort = "OSV" }; CreateValueList(this.DataGrid, "OSVRSTAIDOSVRSTA", dataList, "IDOSVRSTA", "OSV"); UltraGridColumn column2 = this.DataGrid.DisplayLayout.Bands["OS"].Columns["IDOSVRSTA"]; column2.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column2.ValueList = this.DataGrid.DisplayLayout.ValueLists["OSVRSTAIDOSVRSTA"]; if (setColumnsWidth) { column2.Width = 0x145; } DataSet set = new AMSKUPINEDataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetAMSKUPINEDataAdapter().Fill(set); } System.Data.DataView view = new System.Data.DataView(set.Tables["AMSKUPINE"]) { Sort = "AM" }; CreateValueList(this.DataGrid, "AMSKUPINEIDAMSKUPINE", view, "IDAMSKUPINE", "AM"); UltraGridColumn column = this.DataGrid.DisplayLayout.Bands["OS"].Columns["IDAMSKUPINE"]; column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column.ValueList = this.DataGrid.DisplayLayout.ValueLists["AMSKUPINEIDAMSKUPINE"]; if (setColumnsWidth) { column.Width = 370; } DataSet set3 = new OSDOKUMENTDataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetOSDOKUMENTDataAdapter().Fill(set3); } System.Data.DataView view3 = new System.Data.DataView(set3.Tables["OSDOKUMENT"]) { Sort = "OSDK" }; CreateValueList(this.DataGrid, "OSDOKUMENTIDOSDOKUMENT", view3, "IDOSDOKUMENT", "OSDK"); UltraGridColumn column3 = this.DataGrid.DisplayLayout.Bands["OS_OSTEMELJNICA"].Columns["IDOSDOKUMENT"]; column3.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column3.ValueList = this.DataGrid.DisplayLayout.ValueLists["OSDOKUMENTIDOSDOKUMENT"]; if (setColumnsWidth) { column3.Width = 370; } DataSet set4 = new LOKACIJEDataSet(); if (DataAdapterFactory.Provider != null) { DataAdapterFactory.GetLOKACIJEDataAdapter().Fill(set4); } System.Data.DataView view4 = new System.Data.DataView(set4.Tables["LOKACIJE"]) { Sort = "LOK" }; CreateValueList(this.DataGrid, "LOKACIJERASHODLOKACIJEIDLOKACIJE", view4, "IDLOKACIJE", "LOK"); UltraGridColumn column4 = this.DataGrid.DisplayLayout.Bands["OS_OSTEMELJNICA"].Columns["RASHODLOKACIJEIDLOKACIJE"]; column4.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column4.ValueList = this.DataGrid.DisplayLayout.ValueLists["LOKACIJERASHODLOKACIJEIDLOKACIJE"]; if (setColumnsWidth) { column4.Width = 370; } }
public void ChangeBinding() { this.bindingSourceLOKACIJE.DataSource = this.LOKACIJEController.DataSet; this.dsLOKACIJEDataSet1 = this.LOKACIJEController.DataSet; }
private void InitializeComponent() { this.components = new Container(); ResourceManager manager = new ResourceManager(typeof(LOKACIJEFormUserControl)); this.contextMenu1 = new ContextMenu(); this.SetNullItem = new MenuItem(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.errorProvider1 = new ErrorProvider(); this.errorProviderValidator1 = new ErrorProviderValidator(this.components); this.bindingSourceLOKACIJE = new BindingSource(this.components); ((ISupportInitialize)this.bindingSourceLOKACIJE).BeginInit(); this.layoutManagerformLOKACIJE = new TableLayoutPanel(); this.layoutManagerformLOKACIJE.SuspendLayout(); this.layoutManagerformLOKACIJE.AutoSize = true; this.layoutManagerformLOKACIJE.Dock = DockStyle.Fill; this.layoutManagerformLOKACIJE.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.layoutManagerformLOKACIJE.AutoScroll = false; System.Drawing.Point point = new System.Drawing.Point(0, 0); this.layoutManagerformLOKACIJE.Location = point; Size size = new System.Drawing.Size(0, 0); this.layoutManagerformLOKACIJE.Size = size; this.layoutManagerformLOKACIJE.ColumnCount = 2; this.layoutManagerformLOKACIJE.RowCount = 4; this.layoutManagerformLOKACIJE.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformLOKACIJE.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformLOKACIJE.RowStyles.Add(new RowStyle()); this.layoutManagerformLOKACIJE.RowStyles.Add(new RowStyle()); this.layoutManagerformLOKACIJE.RowStyles.Add(new RowStyle()); this.layoutManagerformLOKACIJE.RowStyles.Add(new RowStyle()); this.label1IDLOKACIJE = new UltraLabel(); this.textIDLOKACIJE = new UltraNumericEditor(); this.label1OPISLOKACIJE = new UltraLabel(); this.textOPISLOKACIJE = new UltraTextEditor(); this.label1LOK = new UltraLabel(); this.labelLOK = new UltraLabel(); ((ISupportInitialize)this.textIDLOKACIJE).BeginInit(); ((ISupportInitialize)this.textOPISLOKACIJE).BeginInit(); this.dsLOKACIJEDataSet1 = new LOKACIJEDataSet(); this.dsLOKACIJEDataSet1.BeginInit(); this.SuspendLayout(); this.dsLOKACIJEDataSet1.DataSetName = "dsLOKACIJE"; this.dsLOKACIJEDataSet1.Locale = new CultureInfo("hr-HR"); this.bindingSourceLOKACIJE.DataSource = this.dsLOKACIJEDataSet1; this.bindingSourceLOKACIJE.DataMember = "LOKACIJE"; ((ISupportInitialize)this.bindingSourceLOKACIJE).BeginInit(); point = new System.Drawing.Point(0, 0); this.label1IDLOKACIJE.Location = point; this.label1IDLOKACIJE.Name = "label1IDLOKACIJE"; this.label1IDLOKACIJE.TabIndex = 1; this.label1IDLOKACIJE.Tag = "labelIDLOKACIJE"; this.label1IDLOKACIJE.Text = "Šfr.:"; this.label1IDLOKACIJE.StyleSetName = "FieldUltraLabel"; this.label1IDLOKACIJE.AutoSize = true; this.label1IDLOKACIJE.Anchor = AnchorStyles.Left; this.label1IDLOKACIJE.Appearance.TextVAlign = VAlign.Middle; this.label1IDLOKACIJE.Appearance.Image = RuntimeHelpers.GetObjectValue(manager.GetObject("pictureBoxKey.Image")); this.label1IDLOKACIJE.Appearance.ImageHAlign = HAlign.Right; size = new System.Drawing.Size(7, 10); this.label1IDLOKACIJE.ImageSize = size; this.label1IDLOKACIJE.Appearance.ForeColor = Color.Black; this.label1IDLOKACIJE.BackColor = Color.Transparent; this.layoutManagerformLOKACIJE.Controls.Add(this.label1IDLOKACIJE, 0, 0); this.layoutManagerformLOKACIJE.SetColumnSpan(this.label1IDLOKACIJE, 1); this.layoutManagerformLOKACIJE.SetRowSpan(this.label1IDLOKACIJE, 1); Padding padding = new Padding(3, 1, 5, 2); this.label1IDLOKACIJE.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1IDLOKACIJE.MinimumSize = size; size = new System.Drawing.Size(0x26, 0x17); this.label1IDLOKACIJE.Size = size; point = new System.Drawing.Point(0, 0); this.textIDLOKACIJE.Location = point; this.textIDLOKACIJE.Name = "textIDLOKACIJE"; this.textIDLOKACIJE.Tag = "IDLOKACIJE"; this.textIDLOKACIJE.TabIndex = 0; this.textIDLOKACIJE.Anchor = AnchorStyles.Left; this.textIDLOKACIJE.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textIDLOKACIJE.ReadOnly = false; this.textIDLOKACIJE.PromptChar = ' '; this.textIDLOKACIJE.Enter += new EventHandler(this.numericEditor_Enter); this.textIDLOKACIJE.DataBindings.Add(new Binding("Value", this.bindingSourceLOKACIJE, "IDLOKACIJE")); this.textIDLOKACIJE.NumericType = NumericType.Integer; this.textIDLOKACIJE.MaskInput = "{LOC}-nnnnn"; this.layoutManagerformLOKACIJE.Controls.Add(this.textIDLOKACIJE, 1, 0); this.layoutManagerformLOKACIJE.SetColumnSpan(this.textIDLOKACIJE, 1); this.layoutManagerformLOKACIJE.SetRowSpan(this.textIDLOKACIJE, 1); padding = new Padding(0, 1, 3, 2); this.textIDLOKACIJE.Margin = padding; size = new System.Drawing.Size(0x33, 0x16); this.textIDLOKACIJE.MinimumSize = size; size = new System.Drawing.Size(0x33, 0x16); this.textIDLOKACIJE.Size = size; point = new System.Drawing.Point(0, 0); this.label1OPISLOKACIJE.Location = point; this.label1OPISLOKACIJE.Name = "label1OPISLOKACIJE"; this.label1OPISLOKACIJE.TabIndex = 1; this.label1OPISLOKACIJE.Tag = "labelOPISLOKACIJE"; this.label1OPISLOKACIJE.Text = "Opis:"; this.label1OPISLOKACIJE.StyleSetName = "FieldUltraLabel"; this.label1OPISLOKACIJE.AutoSize = true; this.label1OPISLOKACIJE.Anchor = AnchorStyles.Left; this.label1OPISLOKACIJE.Appearance.TextVAlign = VAlign.Middle; this.label1OPISLOKACIJE.Appearance.ForeColor = Color.Black; this.label1OPISLOKACIJE.BackColor = Color.Transparent; this.layoutManagerformLOKACIJE.Controls.Add(this.label1OPISLOKACIJE, 0, 1); this.layoutManagerformLOKACIJE.SetColumnSpan(this.label1OPISLOKACIJE, 1); this.layoutManagerformLOKACIJE.SetRowSpan(this.label1OPISLOKACIJE, 1); padding = new Padding(3, 1, 5, 2); this.label1OPISLOKACIJE.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1OPISLOKACIJE.MinimumSize = size; size = new System.Drawing.Size(0x2e, 0x17); this.label1OPISLOKACIJE.Size = size; point = new System.Drawing.Point(0, 0); this.textOPISLOKACIJE.Location = point; this.textOPISLOKACIJE.Name = "textOPISLOKACIJE"; this.textOPISLOKACIJE.Tag = "OPISLOKACIJE"; this.textOPISLOKACIJE.TabIndex = 0; this.textOPISLOKACIJE.Anchor = AnchorStyles.Left; this.textOPISLOKACIJE.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textOPISLOKACIJE.ReadOnly = false; this.textOPISLOKACIJE.DataBindings.Add(new Binding("Text", this.bindingSourceLOKACIJE, "OPISLOKACIJE")); this.textOPISLOKACIJE.MaxLength = 50; this.layoutManagerformLOKACIJE.Controls.Add(this.textOPISLOKACIJE, 1, 1); this.layoutManagerformLOKACIJE.SetColumnSpan(this.textOPISLOKACIJE, 1); this.layoutManagerformLOKACIJE.SetRowSpan(this.textOPISLOKACIJE, 1); padding = new Padding(0, 1, 3, 2); this.textOPISLOKACIJE.Margin = padding; size = new System.Drawing.Size(0x16e, 0x16); this.textOPISLOKACIJE.MinimumSize = size; size = new System.Drawing.Size(0x16e, 0x16); this.textOPISLOKACIJE.Size = size; point = new System.Drawing.Point(0, 0); this.label1LOK.Location = point; this.label1LOK.Name = "label1LOK"; this.label1LOK.TabIndex = 1; this.label1LOK.Tag = "labelLOK"; this.label1LOK.Text = "LOK:"; this.label1LOK.StyleSetName = "FieldUltraLabel"; this.label1LOK.AutoSize = true; this.label1LOK.Anchor = AnchorStyles.Left; this.label1LOK.Appearance.TextVAlign = VAlign.Middle; this.label1LOK.Appearance.ForeColor = Color.Black; this.label1LOK.BackColor = Color.Transparent; this.layoutManagerformLOKACIJE.Controls.Add(this.label1LOK, 0, 2); this.layoutManagerformLOKACIJE.SetColumnSpan(this.label1LOK, 1); this.layoutManagerformLOKACIJE.SetRowSpan(this.label1LOK, 1); padding = new Padding(3, 1, 5, 2); this.label1LOK.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1LOK.MinimumSize = size; size = new System.Drawing.Size(0x2c, 0x17); this.label1LOK.Size = size; point = new System.Drawing.Point(0, 0); this.labelLOK.Location = point; this.labelLOK.Name = "labelLOK"; this.labelLOK.Tag = "LOK"; this.labelLOK.TabIndex = 0; this.labelLOK.Anchor = AnchorStyles.Left; this.labelLOK.BackColor = Color.Transparent; this.labelLOK.DataBindings.Add(new Binding("Text", this.bindingSourceLOKACIJE, "LOK")); this.labelLOK.Appearance.TextVAlign = VAlign.Middle; this.layoutManagerformLOKACIJE.Controls.Add(this.labelLOK, 1, 2); this.layoutManagerformLOKACIJE.SetColumnSpan(this.labelLOK, 1); this.layoutManagerformLOKACIJE.SetRowSpan(this.labelLOK, 1); padding = new Padding(0, 1, 3, 2); this.labelLOK.Margin = padding; size = new System.Drawing.Size(0x1b4, 0x16); this.labelLOK.MinimumSize = size; size = new System.Drawing.Size(0x1b4, 0x16); this.labelLOK.Size = size; this.Controls.Add(this.layoutManagerformLOKACIJE); this.SetNullItem.Index = 0; this.SetNullItem.Text = "Set Null"; this.SetNullItem.Click += new EventHandler(this.SetNullItem_Click); this.contextMenu1.Popup += new EventHandler(this.contextMenu1_Popup); this.contextMenu1.MenuItems.AddRange(new MenuItem[] { this.SetNullItem }); this.errorProvider1.DataSource = this.bindingSourceLOKACIJE; this.errorProviderValidator1.ErrorProvider = this.errorProvider1; this.Name = "LOKACIJEFormUserControl"; this.Text = "Lokacije OS-a i SI-a"; this.AutoSize = true; this.AutoScroll = true; this.Load += new EventHandler(this.LOKACIJEFormUserControl_Load); this.layoutManagerformLOKACIJE.ResumeLayout(false); this.layoutManagerformLOKACIJE.PerformLayout(); ((ISupportInitialize)this.bindingSourceLOKACIJE).EndInit(); ((ISupportInitialize)this.textIDLOKACIJE).EndInit(); ((ISupportInitialize)this.textOPISLOKACIJE).EndInit(); this.dsLOKACIJEDataSet1.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }