Example #1
0
        private void item_Add()
        {
            var fm = new FormItemAdd(db, m_modelCurrent);

            fm.OnSubmit += (model, data) =>
            {
                object ok = db.AddItem(model, data);
                if (ok != null)
                {
                    MessageBox.Show("Add item model: " + model + " successfully.");
                    fm.Close();
                    (mui_tabModel.SelectedTab as TabPageCustom).OnLoadData();
                }
                else
                {
                    MessageBox.Show("Add item model: " + model + " fail: " + ok.ToString());
                }
            };
            fm.ShowDialog();
        }
Example #2
0
        private void item_Add()
        {
            string modelName = dbName[tab.SelectedIndex];
            var    fm        = new FormItemAdd(db, modelName);

            fm.OnSubmit += (model, data) =>
            {
                var ok = db.AddItem(model, data);
                if (ok == EditStatus.SUCCESS)
                {
                    MessageBox.Show("Add item model: " + model + " successfully.");
                    fm.Close();
                    (tab.SelectedTab as TabPageCustom).OnLoadData();
                }
                else
                {
                    MessageBox.Show("Add item model: " + model + " fail: " + ok.ToString());
                }
            };
            fm.ShowDialog();
        }