Esempio n. 1
0
        private void btnNewRegister_Click(object sender, EventArgs e)
        {
            if (tabControl.SelectedTab == tabPageNAC)
            {
                using (var form = new FormNacRegister())
                {
                    var result = form.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        Models.Nacimientos reg = form.Register;
                        using (Models.notariadbContext db = new Models.notariadbContext())
                        {
                            db.Add(reg);

                            db.SaveChanges();
                            SheetController test = new SheetController();
                            test.UpdateSheets(nacSheetGridView, matSheetGridView, defSheetGridView, userSheetGridView);
                        }
                    }
                }
            }

            if (tabControl.SelectedTab == tabPageMAT)
            {
                using (var form = new FormMatRegister())
                {
                    var result = form.ShowDialog();
                    if (result == DialogResult.OK)
                    {
                        //DatabaseModel.insert(reg);
                    }
                }
            }
        }
Esempio n. 2
0
        public formMain()
        {
            InitializeComponent();
            includeDataSheetsToView();
            nacSheetGridView.SelectionChanged  += new EventHandler(SheetGridView_SelectionChanged);
            matSheetGridView.SelectionChanged  += new EventHandler(SheetGridView_SelectionChanged);
            defSheetGridView.SelectionChanged  += new EventHandler(SheetGridView_SelectionChanged);
            userSheetGridView.SelectionChanged += new EventHandler(SheetGridView_SelectionChanged);

            SheetController test = new SheetController();

            test.UpdateSheets(nacSheetGridView, matSheetGridView, defSheetGridView, userSheetGridView);

            applyStyles();
        }