private void UltraButton1_Click(object sender, EventArgs e) { CurrencyManager manager = (CurrencyManager)this.BindingContext[this.ds.S_OS_STANJE_LOKACIJA]; CurrencyManager manager2 = (CurrencyManager)this.BindingContext[this.dslokacije.LOKACIJE]; OSRAZMJESTAJDataAdapter adapter = new OSRAZMJESTAJDataAdapter(); OSRAZMJESTAJDataSet dataSet = new OSRAZMJESTAJDataSet(); DataRow row = dataSet.OSRAZMJESTAJ.NewRow(); DataRow row2 = dataSet.OSRAZMJESTAJ.NewRow(); row["idlokacije"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager2.Current)["idlokacije"]); row["invbroj"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["invbroj"]); row["kolicinaulaza"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["stanje"]); row["kolicinarashoda"] = 0; row2["idlokacije"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["idlokacije"]); row2["invbroj"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["invbroj"]); row2["kolicinaulaza"] = 0; row2["kolicinarashoda"] = 0 - Conversions.ToInteger(((DataRowView)manager.Current)["stanje"]); dataSet.OSRAZMJESTAJ.Rows.Add(row); dataSet.OSRAZMJESTAJ.Rows.Add(row2); adapter.Update(dataSet); this.ds.Clear(); this.m_cmDisable = true; this.daStanje.Fill(this.ds, Conversions.ToLong(NewLateBinding.LateGet(this.__CurrencyManager.Current, null, "item", new object[] { 0 }, null, null, null))); this.IzbaciLokacije(); this.m_cmDisable = false; this.m_cm_PositionChanged(null, null); }
public virtual void Fill() { this.PreFill(); this.dsOSRAZMJESTAJDataSet1 = new OSRAZMJESTAJDataSet(); this.m_StartRow = 0; this.Cursor = Cursors.WaitCursor; this.m_GridLoading = true; ThreadPool.QueueUserWorkItem(new WaitCallback(this.FillDataThread), Thread.CurrentPrincipal); }
private void UltraButton2_Click(object sender, EventArgs e) { CurrencyManager manager = (CurrencyManager)this.BindingContext[this.ds.S_OS_STANJE_LOKACIJA]; if (manager.Count == 0) { return; } frmKolicina kolicina = new frmKolicina { kolicina = { MaxValue = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["stanje"]), Value = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["stanje"]) } }; if (kolicina.ShowDialog() == DialogResult.OK) { int num = Convert.ToInt32(kolicina.kolicina.Value); if (num > 0) { CurrencyManager manager2 = (CurrencyManager)this.BindingContext[this.dslokacije.LOKACIJE]; OSRAZMJESTAJDataAdapter adapter = new OSRAZMJESTAJDataAdapter(); OSRAZMJESTAJDataSet dataSet = new OSRAZMJESTAJDataSet(); DataRow row = dataSet.OSRAZMJESTAJ.NewRow(); DataRow row2 = dataSet.OSRAZMJESTAJ.NewRow(); row["idlokacije"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager2.Current)["idlokacije"]); row["invbroj"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["invbroj"]); row["kolicinaulaza"] = num; row["kolicinarashoda"] = 0; row2["idlokacije"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["idlokacije"]); row2["invbroj"] = RuntimeHelpers.GetObjectValue(((DataRowView)manager.Current)["invbroj"]); row2["kolicinaulaza"] = 0; row2["kolicinarashoda"] = 0 - num; dataSet.OSRAZMJESTAJ.Rows.Add(row); dataSet.OSRAZMJESTAJ.Rows.Add(row2); adapter.Update(dataSet); this.m_cmDisable = true; this.ds.Clear(); this.daStanje.Fill(this.ds, Conversions.ToLong(this.OSController.DataSet.OS.Rows[0]["invbroj"])); this.IzbaciLokacije(); this.m_cmDisable = false; this.m_cm_PositionChanged(null, null); } } }
public void ChangeBinding() { this.bindingSourceOSRAZMJESTAJ.DataSource = this.OSRAZMJESTAJController.DataSet; this.dsOSRAZMJESTAJDataSet1 = this.OSRAZMJESTAJController.DataSet; }
private void InitializeComponent() { this.components = new Container(); ResourceManager manager = new ResourceManager(typeof(OSRAZMJESTAJFormUserControl)); 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.bindingSourceOSRAZMJESTAJ = new BindingSource(this.components); ((ISupportInitialize)this.bindingSourceOSRAZMJESTAJ).BeginInit(); this.layoutManagerformOSRAZMJESTAJ = new TableLayoutPanel(); this.layoutManagerformOSRAZMJESTAJ.SuspendLayout(); this.layoutManagerformOSRAZMJESTAJ.AutoSize = true; this.layoutManagerformOSRAZMJESTAJ.Dock = DockStyle.Fill; this.layoutManagerformOSRAZMJESTAJ.AutoSizeMode = AutoSizeMode.GrowAndShrink; this.layoutManagerformOSRAZMJESTAJ.AutoScroll = false; System.Drawing.Point point = new System.Drawing.Point(0, 0); this.layoutManagerformOSRAZMJESTAJ.Location = point; Size size = new System.Drawing.Size(0, 0); this.layoutManagerformOSRAZMJESTAJ.Size = size; this.layoutManagerformOSRAZMJESTAJ.ColumnCount = 2; this.layoutManagerformOSRAZMJESTAJ.RowCount = 5; this.layoutManagerformOSRAZMJESTAJ.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformOSRAZMJESTAJ.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.layoutManagerformOSRAZMJESTAJ.RowStyles.Add(new RowStyle()); this.layoutManagerformOSRAZMJESTAJ.RowStyles.Add(new RowStyle()); this.layoutManagerformOSRAZMJESTAJ.RowStyles.Add(new RowStyle()); this.layoutManagerformOSRAZMJESTAJ.RowStyles.Add(new RowStyle()); this.layoutManagerformOSRAZMJESTAJ.RowStyles.Add(new RowStyle()); this.label1IDLOKACIJE = new UltraLabel(); this.comboIDLOKACIJE = new LOKACIJEComboBox(); this.label1INVBROJ = new UltraLabel(); this.textINVBROJ = new UltraNumericEditor(); this.label1KOLICINAULAZA = new UltraLabel(); this.textKOLICINAULAZA = new UltraNumericEditor(); this.label1KOLICINARASHODA = new UltraLabel(); this.textKOLICINARASHODA = new UltraNumericEditor(); ((ISupportInitialize)this.textINVBROJ).BeginInit(); ((ISupportInitialize)this.textKOLICINAULAZA).BeginInit(); ((ISupportInitialize)this.textKOLICINARASHODA).BeginInit(); this.dsOSRAZMJESTAJDataSet1 = new OSRAZMJESTAJDataSet(); this.dsOSRAZMJESTAJDataSet1.BeginInit(); this.SuspendLayout(); this.dsOSRAZMJESTAJDataSet1.DataSetName = "dsOSRAZMJESTAJ"; this.dsOSRAZMJESTAJDataSet1.Locale = new CultureInfo("hr-HR"); this.bindingSourceOSRAZMJESTAJ.DataSource = this.dsOSRAZMJESTAJDataSet1; this.bindingSourceOSRAZMJESTAJ.DataMember = "OSRAZMJESTAJ"; ((ISupportInitialize)this.bindingSourceOSRAZMJESTAJ).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 = "Lokacija:"; this.label1IDLOKACIJE.StyleSetName = "FieldUltraLabel"; this.label1IDLOKACIJE.AutoSize = true; this.label1IDLOKACIJE.Anchor = AnchorStyles.Left; this.label1IDLOKACIJE.Appearance.TextVAlign = VAlign.Middle; this.label1IDLOKACIJE.Appearance.ForeColor = Color.Black; this.label1IDLOKACIJE.BackColor = Color.Transparent; this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.label1IDLOKACIJE, 0, 0); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.label1IDLOKACIJE, 1); this.layoutManagerformOSRAZMJESTAJ.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(0x47, 0x17); this.label1IDLOKACIJE.Size = size; point = new System.Drawing.Point(0, 0); this.comboIDLOKACIJE.Location = point; this.comboIDLOKACIJE.Name = "comboIDLOKACIJE"; this.comboIDLOKACIJE.Tag = "IDLOKACIJE"; this.comboIDLOKACIJE.TabIndex = 0; this.comboIDLOKACIJE.Anchor = AnchorStyles.Left; this.comboIDLOKACIJE.MouseEnter += new EventHandler(this.mouseEnter_Text); this.comboIDLOKACIJE.DropDownStyle = DropDownStyle.DropDown; this.comboIDLOKACIJE.ComboBox.DropDownStyle = DropDownStyle.DropDown; this.comboIDLOKACIJE.ComboBox.AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest; this.comboIDLOKACIJE.Enabled = true; this.comboIDLOKACIJE.DataBindings.Add(new Binding("Value", this.bindingSourceOSRAZMJESTAJ, "IDLOKACIJE")); this.comboIDLOKACIJE.ShowPictureBox = true; this.comboIDLOKACIJE.PictureBoxClicked += new EventHandler(this.PictureBoxClickedIDLOKACIJE); this.comboIDLOKACIJE.ValueMember = "IDLOKACIJE"; this.comboIDLOKACIJE.SelectionChanged += new EventHandler(this.SelectedIndexChangedIDLOKACIJE); this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.comboIDLOKACIJE, 1, 0); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.comboIDLOKACIJE, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.comboIDLOKACIJE, 1); padding = new Padding(0, 1, 3, 2); this.comboIDLOKACIJE.Margin = padding; size = new System.Drawing.Size(0x1dc, 0x17); this.comboIDLOKACIJE.MinimumSize = size; size = new System.Drawing.Size(0x1dc, 0x17); this.comboIDLOKACIJE.Size = size; point = new System.Drawing.Point(0, 0); this.label1INVBROJ.Location = point; this.label1INVBROJ.Name = "label1INVBROJ"; this.label1INVBROJ.TabIndex = 1; this.label1INVBROJ.Tag = "labelINVBROJ"; this.label1INVBROJ.Text = "Inventarni broj:"; this.label1INVBROJ.StyleSetName = "FieldUltraLabel"; this.label1INVBROJ.AutoSize = true; this.label1INVBROJ.Anchor = AnchorStyles.Left; this.label1INVBROJ.Appearance.TextVAlign = VAlign.Middle; this.label1INVBROJ.Appearance.ForeColor = Color.Black; this.label1INVBROJ.BackColor = Color.Transparent; this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.label1INVBROJ, 0, 1); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.label1INVBROJ, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.label1INVBROJ, 1); padding = new Padding(3, 1, 5, 2); this.label1INVBROJ.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1INVBROJ.MinimumSize = size; size = new System.Drawing.Size(0x72, 0x17); this.label1INVBROJ.Size = size; point = new System.Drawing.Point(0, 0); this.textINVBROJ.Location = point; this.textINVBROJ.Name = "textINVBROJ"; this.textINVBROJ.Tag = "INVBROJ"; this.textINVBROJ.TabIndex = 0; this.textINVBROJ.Anchor = AnchorStyles.Left; this.textINVBROJ.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textINVBROJ.ReadOnly = false; this.textINVBROJ.PromptChar = ' '; this.textINVBROJ.Enter += new EventHandler(this.numericEditor_Enter); this.textINVBROJ.DataBindings.Add(new Binding("Value", this.bindingSourceOSRAZMJESTAJ, "INVBROJ")); this.textINVBROJ.NumericType = NumericType.Double; this.textINVBROJ.MaxValue = 79228162514264337593543950335M; this.textINVBROJ.MinValue = -79228162514264337593543950335M; this.textINVBROJ.MaskInput = "{LOC}-nnnnnnnnnnnn"; EditorButton button = new EditorButton { Key = "editorButtonOSINVBROJ", Tag = "editorButtonOSINVBROJ", Text = "..." }; this.textINVBROJ.ButtonsRight.Add(button); this.textINVBROJ.EditorButtonClick += new EditorButtonEventHandler(this.CallPromptOSINVBROJ); this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.textINVBROJ, 1, 1); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.textINVBROJ, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.textINVBROJ, 1); padding = new Padding(0, 1, 3, 2); this.textINVBROJ.Margin = padding; size = new System.Drawing.Size(0x77, 0x16); this.textINVBROJ.MinimumSize = size; size = new System.Drawing.Size(0x77, 0x16); this.textINVBROJ.Size = size; point = new System.Drawing.Point(0, 0); this.label1KOLICINAULAZA.Location = point; this.label1KOLICINAULAZA.Name = "label1KOLICINAULAZA"; this.label1KOLICINAULAZA.TabIndex = 1; this.label1KOLICINAULAZA.Tag = "labelKOLICINAULAZA"; this.label1KOLICINAULAZA.Text = "Količina ulaza:"; this.label1KOLICINAULAZA.StyleSetName = "FieldUltraLabel"; this.label1KOLICINAULAZA.AutoSize = true; this.label1KOLICINAULAZA.Anchor = AnchorStyles.Left; this.label1KOLICINAULAZA.Appearance.TextVAlign = VAlign.Middle; this.label1KOLICINAULAZA.Appearance.ForeColor = Color.Black; this.label1KOLICINAULAZA.BackColor = Color.Transparent; this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.label1KOLICINAULAZA, 0, 2); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.label1KOLICINAULAZA, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.label1KOLICINAULAZA, 1); padding = new Padding(3, 1, 5, 2); this.label1KOLICINAULAZA.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1KOLICINAULAZA.MinimumSize = size; size = new System.Drawing.Size(0x69, 0x17); this.label1KOLICINAULAZA.Size = size; point = new System.Drawing.Point(0, 0); this.textKOLICINAULAZA.Location = point; this.textKOLICINAULAZA.Name = "textKOLICINAULAZA"; this.textKOLICINAULAZA.Tag = "KOLICINAULAZA"; this.textKOLICINAULAZA.TabIndex = 0; this.textKOLICINAULAZA.Anchor = AnchorStyles.Left; this.textKOLICINAULAZA.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textKOLICINAULAZA.ReadOnly = false; this.textKOLICINAULAZA.PromptChar = ' '; this.textKOLICINAULAZA.Enter += new EventHandler(this.numericEditor_Enter); this.textKOLICINAULAZA.DataBindings.Add(new Binding("Value", this.bindingSourceOSRAZMJESTAJ, "KOLICINAULAZA")); this.textKOLICINAULAZA.NumericType = NumericType.Double; this.textKOLICINAULAZA.MaxValue = 79228162514264337593543950335M; this.textKOLICINAULAZA.MinValue = -79228162514264337593543950335M; this.textKOLICINAULAZA.MaskInput = "{LOC}-nnnnnnnnnn.nn"; this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.textKOLICINAULAZA, 1, 2); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.textKOLICINAULAZA, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.textKOLICINAULAZA, 1); padding = new Padding(0, 1, 3, 2); this.textKOLICINAULAZA.Margin = padding; size = new System.Drawing.Size(0x66, 0x16); this.textKOLICINAULAZA.MinimumSize = size; size = new System.Drawing.Size(0x66, 0x16); this.textKOLICINAULAZA.Size = size; point = new System.Drawing.Point(0, 0); this.label1KOLICINARASHODA.Location = point; this.label1KOLICINARASHODA.Name = "label1KOLICINARASHODA"; this.label1KOLICINARASHODA.TabIndex = 1; this.label1KOLICINARASHODA.Tag = "labelKOLICINARASHODA"; this.label1KOLICINARASHODA.Text = "Količina rashoda:"; this.label1KOLICINARASHODA.StyleSetName = "FieldUltraLabel"; this.label1KOLICINARASHODA.AutoSize = true; this.label1KOLICINARASHODA.Anchor = AnchorStyles.Left; this.label1KOLICINARASHODA.Appearance.TextVAlign = VAlign.Middle; this.label1KOLICINARASHODA.Appearance.ForeColor = Color.Black; this.label1KOLICINARASHODA.BackColor = Color.Transparent; this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.label1KOLICINARASHODA, 0, 3); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.label1KOLICINARASHODA, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.label1KOLICINARASHODA, 1); padding = new Padding(3, 1, 5, 2); this.label1KOLICINARASHODA.Margin = padding; size = new System.Drawing.Size(0, 0); this.label1KOLICINARASHODA.MinimumSize = size; size = new System.Drawing.Size(0x7a, 0x17); this.label1KOLICINARASHODA.Size = size; point = new System.Drawing.Point(0, 0); this.textKOLICINARASHODA.Location = point; this.textKOLICINARASHODA.Name = "textKOLICINARASHODA"; this.textKOLICINARASHODA.Tag = "KOLICINARASHODA"; this.textKOLICINARASHODA.TabIndex = 0; this.textKOLICINARASHODA.Anchor = AnchorStyles.Left; this.textKOLICINARASHODA.MouseEnter += new EventHandler(this.mouseEnter_Text); this.textKOLICINARASHODA.ReadOnly = false; this.textKOLICINARASHODA.PromptChar = ' '; this.textKOLICINARASHODA.Enter += new EventHandler(this.numericEditor_Enter); this.textKOLICINARASHODA.DataBindings.Add(new Binding("Value", this.bindingSourceOSRAZMJESTAJ, "KOLICINARASHODA")); this.textKOLICINARASHODA.NumericType = NumericType.Double; this.textKOLICINARASHODA.MaxValue = 79228162514264337593543950335M; this.textKOLICINARASHODA.MinValue = -79228162514264337593543950335M; this.textKOLICINARASHODA.MaskInput = "{LOC}-nnnnnnnnnn.nn"; this.layoutManagerformOSRAZMJESTAJ.Controls.Add(this.textKOLICINARASHODA, 1, 3); this.layoutManagerformOSRAZMJESTAJ.SetColumnSpan(this.textKOLICINARASHODA, 1); this.layoutManagerformOSRAZMJESTAJ.SetRowSpan(this.textKOLICINARASHODA, 1); padding = new Padding(0, 1, 3, 2); this.textKOLICINARASHODA.Margin = padding; size = new System.Drawing.Size(0x66, 0x16); this.textKOLICINARASHODA.MinimumSize = size; size = new System.Drawing.Size(0x66, 0x16); this.textKOLICINARASHODA.Size = size; this.Controls.Add(this.layoutManagerformOSRAZMJESTAJ); 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.bindingSourceOSRAZMJESTAJ; this.errorProviderValidator1.ErrorProvider = this.errorProvider1; this.Name = "OSRAZMJESTAJFormUserControl"; this.Text = "OSRAZMJESTAJ"; this.AutoSize = true; this.AutoScroll = true; this.Load += new EventHandler(this.OSRAZMJESTAJFormUserControl_Load); this.layoutManagerformOSRAZMJESTAJ.ResumeLayout(false); this.layoutManagerformOSRAZMJESTAJ.PerformLayout(); ((ISupportInitialize)this.bindingSourceOSRAZMJESTAJ).EndInit(); ((ISupportInitialize)this.textINVBROJ).EndInit(); ((ISupportInitialize)this.textKOLICINAULAZA).EndInit(); ((ISupportInitialize)this.textKOLICINARASHODA).EndInit(); this.dsOSRAZMJESTAJDataSet1.EndInit(); this.ResumeLayout(false); this.PerformLayout(); }