private void TxtProduto_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     using (var forms = new frmStocksAdd(null, new StocksModelsRepository(new BiblioteContext()),
                                         new LivrosRepository(new BiblioteContext())))
     {
         var usercontrol = OpenFormsDialog.ShowForm(null, forms);
         if (usercontrol == DialogResult.OK)
         {
             Loader();
         }
     }
 }
Пример #2
0
 private void MenuNovo_Click(object sender, System.EventArgs e)
 {
     using (var forms = new frmStocksAdd(null,
                                         new StocksModelsRepository(new BiblioteContext()),
                                         new LivrosRepository(new BiblioteContext())))
     {
         var usercontrol = OpenFormsDialog.ShowForm(null, forms);
         if (usercontrol == DialogResult.OK)
         {
             Loader();
         }
     }
 }
Пример #3
0
 private void MenuEditar_Click(object sender, System.EventArgs e)
 {
     if (gridView1.FocusedRowHandle >= 0 || gridView1.SelectedRowsCount > 0)
     {
         using (var forms = new frmStocksAdd(
                    stocksModelsBindingSource.Current as StocksModels,
                    new StocksModelsRepository(new BiblioteContext()),
                    new LivrosRepository(new BiblioteContext())))
         {
             var usercontrol = OpenFormsDialog.ShowForm(null, forms);
             if (usercontrol == DialogResult.OK)
             {
                 Loader();
             }
         }
     }
 }