/// <summary> /// Otwarcie formularza dla dodawania obiektu /// </summary> /// <param name="formDataSource"></param> /// <returns></returns> public object OpenAddForm(object formDataSource) { AddEditForm addEditForm = new AddEditForm(); addEditForm.DataSource = formDataSource; addEditForm.ShowDialog(); return(null); }
private void btnAddGoods_Click(object sender, EventArgs e) { AddEditForm addForm = new AddEditForm(null); if (addForm.ShowDialog() == DialogResult.OK) { } }
/// <summary> /// Otwiera formularz dla wskazanego obiektu /// </summary> /// <param name="dataObject">Obiekt modelu, ktory będzie modyfikowany.</param> /// <returns>Zmodyfikowany obiekt modelu</returns> public object OpenForm(object dataObject) { _addEditForm.ChooseEntityEvent = ChooseEntity; _addEditForm.DataSource = dataObject; if (_addEditForm.ShowDialog() == System.Windows.Forms.DialogResult.Cancel) { return(null); } else { return(_addEditForm.DataSource); } }