Beispiel #1
0
        public void Editar()
        {
            if (DgvGeneral.RowCount > 0 && DgvGeneral.GetFocusedRow() != null)
            {
                int         idGeneral = Convert.ToInt32(DgvGeneral.GetFocusedRowCellValue("Id"));
                FrmGetAreas areas     = new FrmGetAreas();
                areas.Database = Database;
                areas.Modo     = "E";
                areas.Id       = idGeneral;
                areas.ShowDialog();

                if (areas.DialogResult == DialogResult.OK)
                {
                    if (!BkgwBuscar.IsBusy)
                    {
                        PrgBuscar.Visible = true;
                        BkgwBuscar.RunWorkerAsync();
                    }
                }
            }
            else
            {
                XtraMessageBox.Show("Debe seleccionar un registro.", Resources.AppName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Beispiel #2
0
        public void Añadir()
        {
            FrmGetAreas areas = new FrmGetAreas();

            areas.Database = Database;
            areas.Modo     = "N";
            areas.ShowDialog();

            if (areas.DialogResult == DialogResult.OK)
            {
                if (!BkgwBuscar.IsBusy)
                {
                    PrgBuscar.Visible = true;
                    BkgwBuscar.RunWorkerAsync();
                }
            }
        }