Пример #1
0
 private void CloseField(object sender, RunCheckCodeEventArgs e)
 {
     if (this.AfterStack.Peek().Key == EventActionEnum.CloseField)
     {
         this.AfterStack.Pop().Value.Execute();
     }
 }
Пример #2
0
        private void NewRecord(object sender, RunCheckCodeEventArgs e)
        {
            //----2101
            this.ClearPageEventForNewRecord(e.Parameter);
            //--
            this.UnRollRecord();
            this.AfterStack.Push(new KeyValuePair <EventActionEnum, StackCommand>(EventActionEnum.CloseRecord, new StackCommand(this.EpiInterpreter, "record", "after", "")));
            this.ResetFields();


            foreach (IDataField dataField in this.mView.Fields.DataFields)
            {
                if (dataField is IInputField && ((IInputField)dataField).ShouldRepeatLast)
                {
                    this.mView.IsDirty = true;
                }
                else
                {
                    dataField.CurrentRecordValueObject = null;
                }
            }

            if (this.mView.IsRelatedView)
            {
                this.mView.ForeignKeyField.CurrentRecordValueString = this.ParentGlobalRecordId;
            }

            this.mView.GlobalRecordIdField.NewValue();
            this.ExecuteCheckCode("record", "before", "");
        }
Пример #3
0
 private void ClickField(object sender, RunCheckCodeEventArgs e)
 {
     if (this.mCurrentField is IFieldWithCheckCodeClick)
     {
         this.ExecuteCheckCode("field", "click", this.mCurrentField.Name);
     }
 }
Пример #4
0
        private void CloseRecord(object sender, RunCheckCodeEventArgs e)
        {
            EventActionEnum Level = this.AfterStack.Peek().Key;

            switch (Level)
            {
            case EventActionEnum.CloseRecord:
                this.AfterStack.Pop().Value.Execute();
                break;

            case EventActionEnum.ClosePage:
                this.AfterStack.Pop().Value.Execute();
                this.AfterStack.Pop().Value.Execute();
                break;

            case EventActionEnum.CloseField:
                this.AfterStack.Pop().Value.Execute();
                this.AfterStack.Pop().Value.Execute();
                this.AfterStack.Pop().Value.Execute();
                break;

            default:
                break;
            }

            if (View.IsEmptyNewRecord() == false)
            {
                this.View.SaveRecord(this.View.CurrentRecordId);
            }
        }
Пример #5
0
 private void OpenRecord(object sender, RunCheckCodeEventArgs e)
 {
     this.UnRollRecord();
     // push after_record onto stack
     this.AfterStack.Push(new KeyValuePair <EventActionEnum, StackCommand>(EventActionEnum.CloseRecord, new StackCommand(this.EpiInterpreter, "record", "after", "")));
     this.ExecuteCheckCode("record", "before", "");
     //this.RunCheckCodeCommands(this.mView.RecordCheckCodeBefore);
 }
Пример #6
0
        private void OpenPage(object sender, RunCheckCodeEventArgs e)
        {
            this.UnRollPage();

            // push after_page onto stack
            if (this.AfterStack.Peek().Key == EventActionEnum.CloseView)
            {
                this.OpenRecord(sender, new RunCheckCodeEventArgs(EventActionEnum.OpenRecord, "<<"));
            }

            Epi.Page page = this.mView.Pages.Find(x => x.Name.ToUpperInvariant() == e.Parameter.ToUpperInvariant());
            this.mCurrentPage = page;
            this.AfterStack.Push(new KeyValuePair <EventActionEnum, StackCommand>(EventActionEnum.ClosePage, new StackCommand(this.EpiInterpreter, "page", "after", page.Name)));
            this.ExecuteCheckCode("page", "before", page.Name);
        }
Пример #7
0
        /*private void OpenView(object sender, RunCheckCodeEventArgs e)
         * {
         *
         * }*/
        public void CloseView(object sender, RunCheckCodeEventArgs e)
        {
            //execute after stack until current level = view
            while (this.AfterStack.Count > 0)
            {
                this.AfterStack.Pop().Value.Execute();
            }

            this.mCurrentField = null;
            this.mCurrentPage  = null;
            this.mView         = null;

            // then execute current level after_view
            //this.RunCheckCodeCommands(this.mView.CheckCodeAfter);
        }
Пример #8
0
        private void NextRecord(object sender, RunCheckCodeEventArgs e)
        {
            this.UnRollRecord();
            this.AfterStack.Push(new KeyValuePair <EventActionEnum, StackCommand>(EventActionEnum.CloseRecord, new StackCommand(this.EpiInterpreter, "record", "after", "")));
            this.ResetFields();

            if (this.mView.IsRelatedView)
            {
                this.mView.ForeignKeyField.CurrentRecordValueString = this.ParentGlobalRecordId;
            }

            this.mView.GlobalRecordIdField.NewValue();
            this.mView.LoadNextRecord(this.mView.CurrentRecordId);
            this.UpdateCurrentRecordNumber();
            this.ExecuteCheckCode("record", "before", "");
        }
Пример #9
0
        public void CheckCodeHandler(object sender, RunCheckCodeEventArgs e)
        {
            if (this.mCurrentView.Count > 0)
            {
                switch (e.EventType)
                {
                case EventActionEnum.CloseView:
                    this.mCurrentView.Peek().CheckCodeHandler(sender, e);
                    this.mCurrentView.Pop();
                    break;

                default:
                    this.mCurrentView.Peek().CheckCodeHandler(sender, e);
                    break;
                }
            }
        }
Пример #10
0
        private void OpenField(object sender, RunCheckCodeEventArgs e)
        {
            this.mCurrentField = this.mView.Fields[e.Parameter];

            this.UnRollField();

            // push after_field onto stack

            if (this.mCurrentField is IFieldWithCheckCodeAfter)
            {
                this.AfterStack.Push(new KeyValuePair <EventActionEnum, StackCommand>(EventActionEnum.CloseField, new StackCommand(this.EpiInterpreter, "field", "after", this.mCurrentField.Name)));
            }

            if (this.mCurrentField is IFieldWithCheckCodeBefore)
            {
                this.ExecuteCheckCode("field", "before", this.mCurrentField.Name);
            }
        }
Пример #11
0
        private void ClosePage(object sender, RunCheckCodeEventArgs e)
        {
            EventActionEnum Level = this.AfterStack.Peek().Key;

            switch (Level)
            {
            case EventActionEnum.ClosePage:
                this.AfterStack.Pop().Value.Execute();
                break;

            case EventActionEnum.CloseField:
                this.AfterStack.Pop().Value.Execute();
                this.AfterStack.Pop().Value.Execute();
                break;

            default:
                break;
            }
        }
Пример #12
0
        public void CheckCodeHandler(object sender, RunCheckCodeEventArgs e)
        {
            switch (e.EventType)
            {
            /*case EventActionEnum.OpenView:
             *  this.OpenView(sender, e);
             *  break;*/
            case EventActionEnum.CloseView:
                this.CloseView(sender, e);
                break;

            case EventActionEnum.OpenRecord:
                switch (e.Parameter)
                {
                case "+":
                case Constants.Plus:
                    this.NewRecord(sender, e);
                    break;

                case "<<":
                    this.FirstRecord(sender, e);
                    break;

                case "<":
                    this.PreviousRecord(sender, e);
                    break;

                case ">":
                    this.NextRecord(sender, e);
                    break;

                case ">>":
                    this.LastRecord(sender, e);
                    break;

                default:
                    this.GotoRecord(sender, e);
                    break;
                }
                break;

            case EventActionEnum.CloseRecord:
                this.CloseRecord(sender, e);
                break;

            case EventActionEnum.OpenPage:
                this.OpenPage(sender, e);
                break;

            case EventActionEnum.ClosePage:
                this.ClosePage(sender, e);
                break;

            case EventActionEnum.OpenField:
                this.OpenField(sender, e);
                break;

            case EventActionEnum.CloseField:
                this.CloseField(sender, e);
                break;

            case EventActionEnum.ClickField:
                this.ClickField(sender, e);
                break;

            case EventActionEnum.FirstRecord:
                this.FirstRecord(sender, e);
                break;

            case EventActionEnum.NextRecord:
                this.NextRecord(sender, e);
                break;

            case EventActionEnum.PreviousRecord:
                this.PreviousRecord(sender, e);
                break;

            case EventActionEnum.LastRecord:
                this.LastRecord(sender, e);
                break;

            case EventActionEnum.GotoRecord:
                this.GotoRecord(sender, e);
                break;

            case EventActionEnum.NewRecord:
                this.NewRecord(sender, e);
                break;

            default:
                break;
            }
        }