public virtual void AddAction() { ItemForm.TextBox.Clear(); if (ItemForm.ShowDialog() == DialogResult.OK) { AddAction(ItemForm.TextBox.Text); } }
public virtual void ChangeAction(ListViewItem item) { ItemForm.TextBox.Clear(); ItemForm.TextBox.Text = item.Text; if (ItemForm.ShowDialog() == DialogResult.OK && IsValidItem(ItemForm.TextBox.Text)) { item.Text = ItemForm.TextBox.Text; } }
public virtual void OnChangeAction(GenericListViewItem <T> lvitem) { ItemForm.TextBox.Clear(); ItemForm.TextBox.Text = lvitem.Text; if (ItemForm.ShowDialog() == DialogResult.OK && IsValidItemText(ItemForm.TextBox.Text)) { lvitem.Text = ItemForm.TextBox.Text; } }
private Item OpenItemFormDialog(string formTitle, Item input = null) { Item output = null; using (ItemForm iform = new ItemForm(input)) { iform.Text = formTitle; DialogResult result = iform.ShowDialog(); if (result == DialogResult.OK) { output = JsonConvert.DeserializeObject <Item>(iform.Data); } } return(output); }
public virtual void AddAction(String text) { while (true) { if (IsValidItem(text)) { Add(text); } else { ItemForm.TextBox.Clear(); ItemForm.TextBox.Text = text; if (ItemForm.ShowDialog() == DialogResult.OK) { text = ItemForm.TextBox.Text; continue; } } break; } }
public virtual void OnAddAction(String text) { while (true) { if (TryConvertToItem(text, out T item) && IsValidItem(item)) { TryInsert(SelectedIndices.OfType <Int32>().FirstOr(SelectedIndices.Count), item); } else { ItemForm.TextBox.Clear(); ItemForm.TextBox.Text = text; if (ItemForm.ShowDialog() == DialogResult.OK) { text = ItemForm.TextBox.Text; continue; } } break; } }
private void Model_btn_Click(object sender, EventArgs e) { ItemForm modelmasterform = new ItemForm(); modelmasterform.ShowDialog(); }
private void InitForm(string mode) { Form newForm; DataGridViewRow selectedRow = new DataGridViewRow(); if (mode.Equals("Edit")) { try { selectedRow = DgvGeneric.SelectedRows[0]; } catch (Exception ex) { Console.WriteLine(ex.Message); MessageBox.Show( text: "Debes seleccionar una fila", caption: "Error", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error); return; } } switch (activeGrid) { case 0: newForm = new EmployeeForm(mode, selectedRow); newForm.ShowDialog(); break; case 1: newForm = new DepartmentForm(mode, selectedRow); newForm.ShowDialog(); break; case 2: newForm = new ItemForm(mode, selectedRow); newForm.ShowDialog(); break; case 3: newForm = new BrandForm(mode, selectedRow); newForm.ShowDialog(); break; case 4: newForm = new UnitForm(mode, selectedRow); newForm.ShowDialog(); break; case 5: newForm = new ProviderForm(mode, selectedRow); newForm.ShowDialog(); break; case 6: newForm = new ItemRequestForm(mode, selectedRow); newForm.ShowDialog(); break; case 7: newForm = new PurchaseOrderForm(mode, selectedRow); newForm.ShowDialog(); break; case 8: newForm = new UserForm(mode, selectedRow); newForm.ShowDialog(); break; } }