Exemplo n.º 1
0
        public void OpenReport(object obj = null)
        {
            if (!CanOpenReport(obj))
            {
                return;
            }

            if (obj is CommandEventParameter)
            {
                CommandEventParameter commEvtParam = obj as CommandEventParameter;
                MouseButtonEventArgs  e            = commEvtParam.EventArgs as MouseButtonEventArgs;
                if (e.ClickCount < 2 || e.LeftButton != MouseButtonState.Pressed)
                {
                    return;
                }
            }

            MessStatus.ClearStatus();
            try
            {
                _model.OpenReport(CurrentReport, _filter);
            }
            catch (Exception ex)
            {
                MessStatus.SetStatus(ex.Message, enMessageStatus.Error);
            }
        }
Exemplo n.º 2
0
        private void EditReport(object obj = null)
        {
            if (!CanEditReport(obj))
            {
                return;
            }
            MessStatus.ClearStatus();
            try
            {
                switch (CurrentReport.Type)
                {
                case enTypeReport.All:
                    _model.OpenDesignAll(CurrentReport, _filter);
                    break;

                case enTypeReport.Table:
                    _model.OpenDesignTable(CurrentReport, _filter);
                    break;

                case enTypeReport.Object:
                    _model.OpenDesignObject(CurrentReport, _filter);
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                MessStatus.SetStatus(ex.Message, enMessageStatus.Error);
            }
        }