Beispiel #1
0
        private void TablaBase_KeyPress(object sender, KeyPressEventArgs e)
        {
#if TRACE
            PgMng.Timer.Reset();
            PgMng.Record("EMngSkinForm06::TablaBase_KeyPress INI");
#endif
            FilterByKey(e.KeyChar.ToString());
        }
Beispiel #2
0
        public virtual void InitForm()
        {
#if TRACE
            PgMng.Record("ChildForm::InitForm INI");
#endif
            ApplyAuthorizationRules();
            FormatForm();
#if TRACE
            PgMng.Record("ChildForm::InitForm END");
#endif
        }
        public override void ExecuteAction(molAction action, bool nested)
        {
            try
            {
#if TRACE
                PgMng.Record(String.Format("ItemMngBaseForm::ExecuteAction {0} INI", action.ToString()));
#endif
                if (!nested)
                {
                    if (Status == EStatus.Working)
                    {
                        return;
                    }

                    Status = EStatus.Working;

                    _current_action = action;

                    //Se usa un atributo porque si uso el DialogResult el ShowDialog entiende que quiero cerrar el formulario
                    _action_result = DialogResult.Ignore;
                }

                DoExecuteAction(action);
#if TRACE
                PgMng.Record(String.Format("ItemMngBaseForm::ExecuteAction {0} END", action.ToString()));
#endif
            }
            catch (iQValidationException ex)
            {
                Control control = ControlsMng.GetControlByProperty(Controls, ex.Field);

                if (control != null)
                {
                    MarkError(control, ex.Message);
                }
                else
                {
                    PgMng.ShowWarningException(ex);
                }
            }
            catch (Exception ex)
            {
                PgMng.ShowErrorException(ex);
            }
            finally
            {
                Status = EStatus.OK;
                if (PgMng != null)
                {
                    PgMng.FillUp();
                }
            }
        }
Beispiel #4
0
        /// <summary>
        /// Asigna el objeto al origen de datos y los orígenes de datos
        /// auxiliares a los ComboBox
        /// <returns>void</returns>
        /// </summary>
        protected virtual void SetFormData()
        {
            try
            {
                //Por si se llama despues de un intento fallido de acceder a un registro
                if (_disposing)
                {
                    return;
                }

                if (PgMng != null)
                {
                    PgMng.Message = Resources.Messages.LOADING_DATA;
                }

                if (_parent != null)
                {
                    BkGetFormData(null);
                }
                else
                {
                    _back_job = BackJob.GetFormData;
                    if (PgMng != null)
                    {
                        PgMng.StartBackJob(this);
                    }
                }
            }
            catch (Exception ex)
            {
                if (null != iQExceptionHandler <iQLockException> .GetiQException(ex))
                {
                    PgMng.ShowInfoException(Resources.Messages.LOCK_ERROR);
                }
                else
                {
                    PgMng.ShowInfoException(ex);
                }

                _disposing = true;
                Close();
            }
            finally
            {
#if TRACE
                if (PgMng != null)
                {
                    PgMng.Record("ManagerForm::SetFormData()");
                }
#endif
            }
        }
        /// <summary>
        /// Función para que lance un evento al cerrar el formulario
        /// o lo cierre directamente
        /// </summary>
        public void Cerrar()
        {
#if TRACE
            PgMng.Record("EntityDriverForm::Cerrar() INI");
#endif
            if (CloseForm != null)
            {
                CloseForm(this, EventArgs.Empty);
            }
#if TRACE
            PgMng.Record("EntityDriverForm::Cerrar() END");
#endif
        }
        public override void InitForm()
        {
#if TRACE
            PgMng.Record("TreeMngSkinForm::InitForm INI");
#endif
            ApplyAuthorizationRules();
            RefreshSecondaryData();
            RefreshList();
            FormatForm();
#if TRACE
            PgMng.Record("TreeMngSkinForm::InitForm END");
#endif
        }
Beispiel #7
0
        protected void GetFormData(long oid, object[] parameters)
        {
            //PARCHE: Codigo para que no pete en tiempo de diseño
            if (PgMng == null)
            {
                return;
            }

            try
            {
#if TRACE
                if (PgMng != null)
                {
                    PgMng.Record("ManagerForm::GetFormSourceData INI");
                }
#endif
                if (oid == -1)
                {
                    if (parameters == null)
                    {
                        GetFormSourceData();
                    }
                    else
                    {
                        GetFormSourceData(parameters);
                    }
                }
                else
                if (parameters == null)
                {
                    GetFormSourceData(oid);
                }
                else
                {
                    GetFormSourceData(oid, parameters);
                }
#if TRACE
                if (PgMng != null)
                {
                    PgMng.Record("ManagerForm::GetFormSourceData END");
                }
#endif
            }
            catch (Exception ex)
            {
                _disposing = true;
                throw ex;
            }
        }
Beispiel #8
0
        private void ChildForm_Load(object sender, EventArgs e)
        {
#if TRACE
            if (PgMng != null)
            {
                PgMng.Record("ChildForm::OnLoad INI");
            }
#endif
            InitForm();
#if TRACE
            if (PgMng != null)
            {
                PgMng.Record("ChildForm::OnLoad END");
            }
#endif
        }
Beispiel #9
0
        public virtual void ExecuteAction(molAction action, bool nested)
        {
            try
            {
#if TRACE
                PgMng.Record(String.Format("ChildForm::ExecuteAction {0} INI", action.ToString()));
#endif
                if (!nested)
                {
                    if (Status == EStatus.Working)
                    {
                        return;
                    }

                    Status = EStatus.Working;

                    _current_action = action;

                    //Se usa un atributo porque si uso el DialogResult el ShowDialog entiende que quiero cerrar el formulario
                    _action_result = DialogResult.Ignore;
                }

                DoExecuteAction(action);
#if TRACE
                PgMng.Record(String.Format("ChildForm::ExecuteAction {0} END", action.ToString()));
#endif
            }
            catch (iQImplementationException ex)
            {
                PgMng.ShowInfoException(ex);
            }
            catch (Exception ex)
            {
                PgMng.ShowErrorException(ex);
            }
            finally
            {
                Status = EStatus.OK;
                //EnableForm(true);
                PgMng.FillUp();
            }
        }
        protected override void FilterByKey(string key)
        {
#if TRACE
            PgMng.Record("EntityMngSkinForm04::FilterByKey - INI");
#endif
            switch (key)
            {
            case "\b":

                _filter_type = IFilterType.FilterBack;

                _filter_keys = (_filter_keys.Length > 1) ? _filter_keys.Substring(0, _filter_keys.Length - 1) : string.Empty;

                break;

            default:

                _filter_type = IFilterType.Filter;

                _filter_keys = _filter_keys + key;

                break;
            }

            EnableEvents(false);
            Search_TB.Text = _filter_keys;
            EnableEvents(true);

            if (_filter_keys != string.Empty)
            {
                ExecuteAction(molAction.FilterGlobal);
            }
            else
            {
                ExecuteAction(molAction.FilterOff);
            }
#if TRACE
            PgMng.Record("EntityMngSkinForm04::FilterByKey - INI");
#endif
        }
Beispiel #11
0
        protected void BkGetFormData(BackgroundWorker bk)
        {
            try
            {
                EnableEvents(false);
#if TRACE
                PgMng.Record("ManagerForm::RefreshSecondaryData INI");
#endif
                RefreshSecondaryData();
                PgMng.Grow(string.Empty, "ManagerForm::RefreshSecondaryData END");
#if TRACE
                PgMng.Record("ManagerForm::RefreshMainData INI");
#endif
                RefreshMainData();
                PgMng.Grow(string.Empty, "ManagerForm::RefreshMainData END");
#if TRACE
                PgMng.Record("ManagerForm::BuildCache INI");
#endif
                BuildCache();
                PgMng.Grow();
#if TRACE
                PgMng.Record("ManagerForm::BuildCache END");
#endif
            }

            /*catch (System.Security.SecurityException ex)
             * {
             *                  PgMng.ShowInfoException(ex);
             *          }*/
            catch (Exception ex)
            {
                PgMng.ShowInfoException(ex);
            }
            finally
            {
                EnableEvents(true);
            }
        }
        private void Search_TB_TextChanged(object sender, EventArgs e)
        {
#if TRACE
            PgMng.Record("EntityMngSkinForm04::Search_TB_TextChanged - INI");
#endif
            if (_filter_keys.Length > Search_TB.Text.Length)
            {
                string filter = Search_TB.Text;
                EnableEvents(false);
                _filter_type = IFilterType.FilterBack;
                _filter_keys = (_filter_keys.Length > 1) ? _filter_keys.Substring(0, _filter_keys.Length - 1) : string.Empty;
                EnableEvents(true);
            }
            else
            {
                _filter_keys = Search_TB.Text;
            }

            ExecuteAction(molAction.FilterGlobal);
            Search_TB.Focus();
#if TRACE
            PgMng.Record("EntityMngSkinForm04::Search_TB_TextChanged - END");
#endif
        }