Ejemplo n.º 1
0
        /// <summary>
        /// Shows the edit form to modify a record.
        /// </summary>
        private void EditOrganisationItem(DBGuid ID)
        {
            if (ID.IsNull)
              {
            return;
              }

              frmOrganisationEdit frmEdit = null;
              try
              {
            frmEdit = new frmOrganisationEdit(ID, true);
            DialogResult result = frmEdit.ShowDialog();
            if (result == DialogResult.OK)
            {
              FillDatagridOrg(frmEdit.CurrentID);
            }
              }
              catch (Exception ex)
              {
            //	---	Log exception
            ExceptionManager.Publish(ex);
            //	---	Display Exception
            ErrorHandler.DisplayError("Hiba történt az adatok módosítása során.", ex);
              }
              finally
              {
            if (frmEdit != null)
            {
              frmEdit.Dispose();
            }
              }
        }
        /// <summary>
        /// Shows the edit form to modify a record.
        /// </summary>
        private void EditItem()
        {
            var id = DBGuid.Null;
              id.Value = dtgOrganisation.GetSelectedRowCell("ID");

              //lekérdezzük hogy kef e mert ha igen akkor a frmKefOrganisationEdit formot kell meghívni
              bool isKef = Convert.ToBoolean(dtgOrganisation.GetSelectedRowCell("IsKef"));

              frmOrganisationEdit frmEdit = null;
              frmKefOrganisationEdit frmKefEdit;

              try
              {
            frmEdit = new frmOrganisationEdit(id);
            frmKefEdit = new frmKefOrganisationEdit(id);

            DialogResult result = isKef ? frmKefEdit.ShowDialog() : frmEdit.ShowDialog();

            if (result == DialogResult.OK)
            {
              FillDatagrid(frmEdit.CurrentID);
            }
              }
              catch (Exception ex)
              {
            //	---	Log exception
            ExceptionManager.Publish(ex);
            //	---	Display Exception
            ErrorHandler.DisplayError("Hiba történt az adatok módosítása során.", ex);
              }
              finally
              {
            if (frmEdit != null)
            {
              frmEdit.Dispose();
            }
              }
        }