示例#1
0
        /// <summary>
        /// Форма для редактирования уже существующей ведомости
        /// </summary>
        /// <param name="statement"></param>
        public Statement1_Form(Statement1 statement)
        {
            InitializeComponent();
            this.Statement = statement;
            this.Text      = "Редактирование существующей ведомости";

            //
            // Информация в контролы
            //

            this.TextBox_Year.Text                = statement.Year.ToString();
            this.ComboBox_Education.Text          = statement.EducationName;
            this.ComboBox_Group.Text              = statement.EducationName;
            this.ComboBox_Qualification.Text      = statement.EducationName;
            this.ComboBox_Specialization.Text     = statement.EducationName;
            this.ComboBox_SpecialtyDirection.Text = statement.EducationName;
            this.ComboBox_Specialty.Text          = statement.EducationName;
            this.TextBox_Info.Text                = statement.InformationAboutGraduates;

            //
            // Табличная часть
            //

            for (int rowIndex = 0; rowIndex < this.Statement.TabularPart.Length; rowIndex++)
            {
                ListViewItem item = this.metroListView1.Items.Add(this.Statement.TabularPart[rowIndex].FIO);
                item.Tag = this.Statement.TabularPart[rowIndex];
            }
        }
示例#2
0
        public Block BuildDocument(int indentation)
        {
            Section s = new Section();

            s.Blocks.Add(Statement1.BuildDocument(indentation));
            s.Blocks.Add(Statement2.BuildDocument(indentation));
            return(s);
        }
示例#3
0
        public FrameworkElement BuildForm(IValueEnvironment vEnv, ITypeEnvironment tEnv)
        {
            StackPanel sp = new StackPanel();

            sp.Children.Add(Statement1.BuildForm(vEnv, tEnv));
            sp.Children.Add(Statement2.BuildForm(vEnv, tEnv));

            return(sp);
        }
示例#4
0
        private void button7_Click(object sender, EventArgs e)
        {
            Statement1 = txtStatement1.Text;
            Statement2 = txtStatement2.Text;
            Statement3 = txtStatement3.Text;

            Conclusion4 = txtConclusion4.Text;

            Statement         s1            = new Statement(Statement1.ToUpper().Trim());
            Statement         s2            = new Statement(Statement2.ToUpper().Trim());
            Statement         s3            = new Statement(Statement3.ToUpper().Trim());
            IList <Statement> StatementList = new List <Statement> {
            };

            if (!String.IsNullOrEmpty(Statement1.Trim()))
            {
                StatementList.Add(s1);
            }
            if (!String.IsNullOrEmpty(Statement2.Trim()))
            {
                StatementList.Add(s2);
            }
            if (!String.IsNullOrEmpty(Statement3.Trim()))
            {
                StatementList.Add(s3);
            }

            Conclusion c4 = null;

            if (!String.IsNullOrEmpty(Conclusion4.Trim()))
            {
                c4 = new Conclusion(Conclusion4.ToUpper().Trim(), StatementList);
            }
            IList <Statement> sList = new List <Statement>();

            StatementList = CorrespondingPair.GetCorrespondingAlignedStatementsByConclusion(c4, StatementList, out sList);

            if (StatementList.Count == 1)
            {
                lblResult.Text = "Corresponding Statement is : " + "\n\n" +
                                 "1 ) " + StatementList[0].StatementName.ToUpper() + "\n";
            }
            else if (StatementList.Count == 2)
            {
                lblResult.Text = "Corresponding Statements are : " + "\n\n" +
                                 "1 ) " + StatementList[0].StatementName.ToUpper() + "\n" +
                                 "2 ) " + StatementList[1].StatementName.ToUpper() + "\n";
            }
            else if (StatementList.Count == 3)
            {
                lblResult.Text = "Corresponding Statements are : " + "\n\n" +
                                 "1 ) " + StatementList[0].StatementName.ToUpper() + "\n" +
                                 "2 ) " + StatementList[1].StatementName.ToUpper() + "\n" +
                                 "3 ) " + StatementList[2].StatementName.ToUpper() + "\n";
            }
        }
示例#5
0
        public override bool Equals(object obj)
        {
            if (!(obj is CompStmnt))
            {
                return(false);
            }

            CompStmnt other = (CompStmnt)obj;

            return(Statement1.Equals(other.Statement1) && Statement2.Equals(other.Statement2));
        }
        protected override string Serialize()
        {
            var result = new StringBuilder();

            result.AppendLine(base.Serialize());
            result.AppendLine(@"<ShowStatement1>" + ShowStatement1 + @"</ShowStatement1>");
            result.AppendLine(@"<ShowStatement2>" + ShowStatement2 + @"</ShowStatement2>");
            result.AppendLine(@"<ShowStatement3>" + ShowStatement3 + @"</ShowStatement3>");
            result.AppendLine(@"<SlideHeader>" + SlideHeader.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</SlideHeader>");
            result.AppendLine(@"<Statement1>" + Statement1.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</Statement1>");
            result.AppendLine(@"<Statement2>" + Statement2.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</Statement2>");
            result.AppendLine(@"<Statement3>" + Statement3.Replace(@"&", "&#38;").Replace("\"", "&quot;") + @"</Statement3>");
            return(result.ToString());
        }
 public override IEnumerable <Tuple <string, VarType> > GetVars()
 {
     foreach (var s in Expression.GetVars())
     {
         yield return(s);
     }
     foreach (var s in Statement1.GetVars())
     {
         yield return(s);
     }
     foreach (var s in Statement2.GetVars())
     {
         yield return(s);
     }
 }
示例#8
0
        /// <summary>
        /// Сохранить ведомость
        /// </summary>
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (this.Statement != null)
            {
                //
                // Если форма была создана для редактирования ведомости
                //
                this.Statement.Year                      = Convert.ToUInt16(this.TextBox_Year.Text);
                this.Statement.EducationName             = this.ComboBox_Education.Text;
                this.Statement.InformationAboutGraduates = this.TextBox_Info.Text;
                this.Statement.Specialty                 = this.ComboBox_Specialty.Text;
                this.Statement.SpecialtyDirection        = this.ComboBox_SpecialtyDirection.Text;
                this.Statement.Specialization            = this.ComboBox_Specialization.Text;
                this.Statement.Qualification             = this.ComboBox_Qualification.Text;
                this.Statement.Group                     = this.ComboBox_Group.Text;
            }
            else
            {
                Statement1 newStatement = new Statement1(Statement1.Statement1_Document.DocumentElement,
                                                         this.TextBox_Year.Text,
                                                         this.ComboBox_Education.Text,
                                                         this.TextBox_Info.Text,
                                                         this.ComboBox_Specialty.Text,
                                                         this.ComboBox_SpecialtyDirection.Text,
                                                         this.ComboBox_Specialization.Text,
                                                         this.ComboBox_Qualification.Text,
                                                         this.ComboBox_Group.Text);

                //
                //  Табличная часть
                //

                foreach (ListViewItem item in this.metroListView1.Items)
                {
                    newStatement.AppendRow((Statement1_Row)item.Tag);
                }
            }

            new PopupNotifier()
            {
                TitleText   = "База данных",
                ContentText = "Ведомость сохранена"
            }.Popup();

            Statement1.Statement1_Document.Save(Config.Statement1_Path);
            Save = true;
            this.Close();
        }
示例#9
0
        public FrameworkElement BuildForm(IValueEnvironment vEnv, ITypeEnvironment tEnv)
        {
            Style s = new Style();

            s.Setters.Add(new Setter(UIElement.VisibilityProperty, Visibility.Collapsed));
            s.Setters.Add(new Setter(FrameworkElement.MarginProperty, new Thickness(0)));

            TabControl t = new TabControl()
            {
                ItemContainerStyle = s
            };

            t.Margin          = new Thickness(0);
            t.Padding         = new Thickness(0);
            t.BorderThickness = new Thickness(0);
            t.Items.Add(Statement1.BuildForm(vEnv, tEnv));
            t.Items.Add(Statement2.BuildForm(vEnv, tEnv));

            return(t);
        }
示例#10
0
        private void Show_Form_Shown(object sender, EventArgs e)
        {
            //
            // Вывод списка ведомостей персонального учета
            //

            Statement1[] statements1 = Statement1.GetStatementsFromDocument();

            foreach (Statement1 statement in statements1)
            {
                ListViewItem item = metroListView1.Items.Add(statement.Year.ToString());
                item.Tag = statement;
                item.SubItems.Add(statement.Group.ToString());
            }

            this.metroListView1.Columns[0].Width = this.metroListView1.Width / 2;
            this.metroListView1.Columns[1].Width = this.metroListView1.Width / 2;

            //
            // Вывод списка ведомостей распределения
            //

            Statement2[] statements = Statement2.GetStatements2FromDocument();

            foreach (Statement2 statement in statements)
            {
                ListViewItem item = metroListView2.Items.Add(statement.codeAndSpecialityName);
                item.Tag = statement;
                item.SubItems.Add(statement.Year.ToString());
                //Количество потомков в "элементе" таблицы(потомки - строки)
                item.SubItems.Add(statement.getTabularPart().ChildNodes.Count.ToString());
            }

            this.metroListView2.Columns[1].Width = 100;
            this.metroListView2.Columns[2].Width = 250;

            Show_Form_ResizeEnd(null, null);
        }
        public override string ToString(int level)
        {
            var outstr = "";

            for (var i = 0; i < level; i++)
            {
                outstr += "-";
            }
            outstr += "IF: \n" + Expression.ToString(level + 1) + "\n";
            for (var i = 0; i < level; i++)
            {
                outstr += "-";
            }
            outstr += "THEN: \n";
            outstr += Statement1.ToString(level + 1) + "\n";
            for (var i = 0; i < level; i++)
            {
                outstr += "-";
            }
            outstr += "ELSE: \n";
            outstr += Statement2.ToString(level + 1) + "\n";
            return(outstr);
        }
示例#12
0
        public MarkupGrammar(IParserSettings settings)
        {
            var Apos = Ch('\'');
            var Quot = Ch('\"');
            var Lt   = Ch('<');
            var Gt   = Ch('>');


            //var CombiningChar = Ch('*');
            //var Extener = Ch('*');

            //[4]       NameChar	   ::=       Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender
            var NameChar = Ch(char.IsLetterOrDigit).Or(Ch('.', '-', '_', ':')) /*.Or(CombiningChar).Or(Extener)*/;

            //[5]       Name	   ::=      (Letter | '_' | ':') (NameChar)*
            var Name =
                Ch(char.IsLetter).Or(Ch('_', ':')).And(Rep(NameChar))
                .Build(hit => hit.Left + new string(hit.Down.ToArray()));

            //[7]       Nmtoken	   ::=      (NameChar)+
            var NmToken =
                Rep1(NameChar)
                .Build(hit => new string(hit.ToArray()));

            //[3]       S	   ::=      (#x20 | #x9 | #xD | #xA)+
            Whitespace = Rep1(Ch(char.IsWhiteSpace));

            //[25]      Eq	   ::=       S? '=' S?
            var Eq = Opt(Whitespace).And(Ch('=')).And(Opt(Whitespace));



            var paintedStatement1 = Statement1.Build(hit => new StatementNode(hit)).Paint <StatementNode, Node>();

            var statementMarker = string.IsNullOrEmpty(settings.StatementMarker) ? "#" : settings.StatementMarker;

            // Syntax 1: '\r'? ('\n' | '\u0002') S? '#' (statement ^('\r' | '\n' | '\u0003') )
            var StatementNode1 = Opt(Ch('\r')).And(Ch('\n').Or(ChSTX())).And(Rep(Ch(' ', '\t'))).And(TkCode(Ch(statementMarker))).And(paintedStatement1).IfNext(Ch('\r', '\n').Or(ChETX()))
                                 .Build(hit => hit.Down);


            var paintedStatement2 = Statement2.Build(hit => new StatementNode(hit)).Paint <StatementNode, Node>();

            // Syntax 2: '<%' (statement ^'%>')  '%>'
            var StatementNode2 = TkAspxCode(Ch("<%")).NotNext(Ch('=')).And(paintedStatement2).And(TkAspxCode(Ch("%>")))
                                 .Build(hit => hit.Left.Down);

            Statement = StatementNode1.Or(StatementNode2);



            // Syntax 1: ${csharp_expression}
            var Code1 = TkCode(Ch("${")).And(Expression).And(TkCode(Ch('}')))
                        .Build(hit => new ExpressionNode(hit.Left.Down)
            {
                AutomaticEncoding = settings.AutomaticEncoding
            });

            // Syntax 3: <%=csharp_expression%>;
            var Code3 = TkAspxCode(Ch("<%")).And(TkAttDelim(Ch('='))).And(Expression).And(TkAspxCode(Ch("%>")))
                        .Build(hit => new ExpressionNode(hit.Left.Down));

            // Syntax 4: $!{csharp_expression}
            var Code4 = TkCode(Ch("$!{")).And(Expression).And(TkCode(Ch('}')))
                        .Build(hit => new ExpressionNode(hit.Left.Down)
            {
                SilentNulls = true, AutomaticEncoding = settings.AutomaticEncoding
            });

            // Syntax 5: !{sharp_expression}
            var Code5 = TkCode(Ch("!{")).And(Expression).And(TkCode(Ch('}')))
                        .Build(hit => new ExpressionNode(hit.Left.Down));

            Code = Code1.Or(Code3).Or(Code4).Or(Code5);

            var Condition = TkCode(Ch("?{")).And(Expression).And(TkCode(Ch('}')))
                            .Build(hit => new ConditionNode(hit.Left.Down));

            var LessThanTextNode = Ch('<')
                                   .Build(hit => (Node) new TextNode("<"));

            //[68]      EntityRef	   ::=      '&' Name ';'
            EntityRef =
                TkEntity(Ch('&').And(Name).And(Ch(';')))
                .Build(hit => new EntityNode(hit.Left.Down));

            var EntityRefOrAmpersand = AsNode(EntityRef).Or(Ch('&').Build(hit => (Node) new TextNode("&")));

            //[10]      AttValue	   ::=      '"' ([^<&"] | Reference)* '"' |  "'" ([^<&'] | Reference)* "'"
            var AttValueSingleText = TkAttVal(Rep1(ChNot('<', '&', '\'').Unless(Code).Unless(Condition))).Build(hit => new TextNode(hit));
            var AttValueSingle     = TkAttQuo(Apos).And(Rep(AsNode(AttValueSingleText).Or(EntityRefOrAmpersand).Or(AsNode(Code)).Or(AsNode(Condition)).Or(LessThanTextNode).Paint())).And(TkAttQuo(Apos));
            var AttValueDoubleText = TkAttVal(Rep1(ChNot('<', '&', '\"').Unless(Code).Unless(Condition))).Build(hit => new TextNode(hit));
            var AttValueDouble     = TkAttQuo(Quot).And(Rep(AsNode(AttValueDoubleText).Or(EntityRefOrAmpersand).Or(AsNode(Code)).Or(AsNode(Condition)).Or(LessThanTextNode).Paint())).And(TkAttQuo(Quot));
            var AttValue           = AttValueSingle.Or(AttValueDouble).Left().Down();


            //[41]      Attribute	   ::=       Name  Eq  AttValue
            Attribute =
                TkAttNam(Name).And(TkAttDelim(Eq)).And(AttValue)
                .Build(hit => new AttributeNode(hit.Left.Left, hit.Down)).Paint <AttributeNode, Node>();


            //[40]      STag	   ::=      '<' Name (S  Attribute)* S? '>'
            //[44]      EmptyElemTag	   ::=      '<' Name (S  Attribute)* S? '/>'
            Element =
                Opt(Ch("\r\n").Or(Ch("\n")).And(StringOf(Ch(char.IsWhiteSpace).Unless(Ch('\r', '\n'))))).And(TkTagDelim(Lt)).And(TkEleNam(Name)).And(Rep(Whitespace.And(Attribute).Down())).And(Opt(Whitespace)).And(Opt(TkTagDelim(Ch('/')))).And(TkTagDelim(Gt))
                .Build(hit => new ElementNode(
                           hit.Left.Left.Left.Left.Down,
                           hit.Left.Left.Left.Down,
                           hit.Left.Down != default(char),
                           hit.Left.Left.Left.Left.Left.Left == null ? string.Empty : hit.Left.Left.Left.Left.Left.Left.Left + hit.Left.Left.Left.Left.Left.Left.Down));

            //[42]      ETag	   ::=      '</' Name  S? '>'
            EndElement =
                Opt(Ch("\r\n").Or(Ch("\n")).And(StringOf(Ch(char.IsWhiteSpace).Unless(Ch('\r', '\n'))))).And(TkTagDelim(Lt.And(Ch('/')))).And(TkEleNam(Name)).And(Opt(Whitespace)).And(TkTagDelim(Gt))
                .Build(hit => new EndElementNode(hit.Left.Left.Down, hit.Left.Left.Left.Left == null ? string.Empty : hit.Left.Left.Left.Left.Left + hit.Left.Left.Left.Left.Down));

            Text =
                Rep1(ChNot('&', '<').Unless(Statement).Unless(Code).Unless(Element).Unless(EndElement))
                .Build(hit => new TextNode(hit));

            //[15]      Comment	   ::=      '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
            Comment =
                TkComm(Ch("<!--").And(Rep(ChNot('-').Or(Ch('-').IfNext(ChNot('-'))))).And(Ch("-->")))
                .Build(hit => new CommentNode(hit.Left.Down));

            //[11]      SystemLiteral	   ::=      ('"' [^"]* '"') | ("'" [^']* "'")
            var SystemLiteral =
                Quot.And(Rep(ChNot('\"'))).And(Quot).Or(Apos.And(Rep(ChNot('\''))).And(Apos))
                .Build(hit => new string(hit.Left.Down.ToArray()));

            //[13]      PubidChar	   ::=      #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
            var PubidChar1 = Ch(char.IsLetterOrDigit).Or(Ch(" \r\n-()+,./:=?;!*#@$_%".ToArray()));
            var PubidChar2 = PubidChar1.Or(Apos);

            //[12]      PubidLiteral	   ::=      '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
            var PubidLiteral =
                Quot.And(Rep(PubidChar2)).And(Quot).Or(Apos.And(Rep(PubidChar1)).And(Apos))
                .Build(hit => new string(hit.Left.Down.ToArray()));

            //[75]      ExternalID	   ::=      'SYSTEM' S  SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral
            var ExternalIDSystem =
                Ch("SYSTEM").And(Whitespace).And(SystemLiteral)
                .Build(hit => new ExternalIdInfo
            {
                ExternalIdType = hit.Left.Left,
                SystemId       = hit.Down
            });
            var ExternalIDPublic =
                Ch("PUBLIC").And(Whitespace).And(PubidLiteral).And(Whitespace).And(SystemLiteral)
                .Build(hit => new ExternalIdInfo
            {
                ExternalIdType = hit.Left.Left.Left.Left,
                PublicId       = hit.Left.Left.Down,
                SystemId       = hit.Down
            });
            var ExternalID = ExternalIDSystem.Or(ExternalIDPublic);

            //[28]      doctypedecl	   ::=      '<!DOCTYPE' S  Name (S  ExternalID)? S? ('[' intSubset ']' S?)? '>'
            DoctypeDecl = Ch("<!DOCTYPE").And(Whitespace).And(Name).And(Opt(Whitespace.And(ExternalID).Down())).And(Opt(Whitespace)).And(Ch('>'))
                          .Build(hit => new DoctypeNode {
                Name = hit.Left.Left.Left.Down, ExternalId = hit.Left.Left.Down
            });

            //[26]      VersionNum	   ::=      '1.0'
            var VersionNum = Ch("1.0");

            //[24]      VersionInfo	   ::=       S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
            var VersionInfo = Whitespace.And(Ch("version")).And(Eq).And(
                Apos.And(VersionNum).And(Apos).Or(Quot.And(VersionNum).And(Quot)));

            //[81]      EncName	   ::=      [A-Za-z] ([A-Za-z0-9._] | '-')*
            var EncName = Ch(char.IsLetter).And(Rep(Ch(char.IsLetterOrDigit).Or(Ch('.', '_', '-'))))
                          .Build(hit => hit.Left + new string(hit.Down.ToArray()));

            //[80]      EncodingDecl	   ::=       S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
            var EncodingDecl = Whitespace.And(Ch("encoding")).And(Eq).And(
                Apos.And(EncName).And(Apos).Or(Quot.And(EncName).And(Quot)))
                               .Build(hit => hit.Down.Left.Down);

            //[32]      SDDecl	   ::=       S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"'))
            var SSDecl = Whitespace.And(Ch("standalone")).And(Eq).And(
                Apos.And(Ch("yes").Or(Ch("no"))).And(Apos).Or(Quot.And(Ch("yes").Or(Ch("no"))).And(Quot)))
                         .Build(hit => hit.Down.Left.Down);

            //[23]      XMLDecl	   ::=      '<?xml' VersionInfo  EncodingDecl? SDDecl? S? '?>'
            XMLDecl =
                Ch("<?xml").And(VersionInfo).And(Opt(EncodingDecl)).And(Opt(SSDecl)).And(Opt(Whitespace)).And(Ch("?>"))
                .Build(hit => new XMLDeclNode {
                Encoding = hit.Left.Left.Left.Down, Standalone = hit.Left.Left.Down
            });

            //[17]      PITarget	   ::=      Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
            var PITarget = Name.Unless(Ch('X', 'x').And(Ch('M', 'm')).And(Ch('L', 'l')));

            //[16]      PI	   ::=      '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
            ProcessingInstruction = Ch("<?").And(PITarget).And(Opt(Whitespace)).And(Rep(Ch(ch => true).Unless(Ch("?>")))).And(Ch("?>"))
                                    .Build(hit => new ProcessingInstructionNode {
                Name = hit.Left.Left.Left.Down, Body = new string(hit.Left.Down.ToArray())
            });


            AnyNode = AsNode(Element).Paint()
                      .Or(AsNode(EndElement).Paint())
                      .Or(AsNode(Text).Paint())
                      .Or(EntityRefOrAmpersand.Paint())
                      .Or(AsNode(Statement))
                      .Or(AsNode(Code).Paint())
                      .Or(AsNode(DoctypeDecl).Paint())
                      .Or(AsNode(Comment).Paint())
                      .Or(AsNode(XMLDecl).Paint())
                      .Or(AsNode(ProcessingInstruction).Paint())
                      .Or(AsNode(LessThanTextNode).Paint());

            Nodes = Rep(AnyNode);
        }
示例#13
0
 public override int GetHashCode()
 {
     return(Statement1.GetHashCode() ^ Statement2.GetHashCode());
 }
示例#14
0
 public void TypeCheck(ITypeEnvironment env)
 {
     Statement1.TypeCheck(env);
     Statement2.TypeCheck(env);
 }
示例#15
0
        /// <summary>
        /// Сгенерировать ведомость персонального учета выпускников в формате Word
        /// </summary>
        /// <param name="statement"></param>
        /// <param name="PathToTemplateDocument"></param>
        /// <returns></returns>
        public static bool BuildStatement1(
            Statement1 statement,
            string PathToTemplateDocument = "Templates\\Statement2.docx"
            )
        {
            string FileName = $"{statement.Specialty} {statement.Specialization} {DateTime.Now.Year}.{DateTime.Now.Month}.{DateTime.Now.Day}.docx";
            bool   Error    = false;

            //Если файл существует, то добавляем (Количество файлов в папке + 1) к названию файла
            if (File.Exists(Directory.GetCurrentDirectory() + "\\TemporaryFiles\\" + FileName))
            {
                FileName = (1 + Directory.GetFiles(Directory.GetCurrentDirectory() + "\\TemporaryFiles\\").Length) + "  " + FileName;
            }

            File.Copy(Directory.GetCurrentDirectory() + "\\Templates\\Statement1.docx",
                      Directory.GetCurrentDirectory() + "\\TemporaryFiles\\" + FileName);

            var wordApplication = new Word.Application()
            {
                Visible = false
            };
            var wordDocument = wordApplication.Documents.Open(Directory.GetCurrentDirectory() + "\\TemporaryFiles\\" + FileName);

            ReplaceInWord("{Edu}", statement.EducationName + "    ", wordDocument);
            ReplaceInWord("{Info}", statement.InformationAboutGraduates, wordDocument);
            ReplaceInWord("{Specialty}", statement.Specialty, wordDocument);
            ReplaceInWord("{dSpecialty}", statement.SpecialtyDirection, wordDocument);
            ReplaceInWord("{Specialization}", statement.Specialization, wordDocument);
            ReplaceInWord("{Qualification}", statement.Qualification, wordDocument);
            ReplaceInWord("{Group}", statement.Group, wordDocument);

            Word.Table TabularPart = wordDocument.Tables[1];

#warning Если учтено больше трёх лет, необходимо запрашивать у пользователя за какие "годы" выводить информацию в документ

            Statement1_Row[] Rows = statement.GetAllRows();

            System.UInt16 AllRowOffset = 4; //Первая строка, с которой начинается вывод информации, является четвертой, поэтому тут 4 заранее

            for (System.UInt16 index = 0; index < Rows.Length; index++)
            {
                //TabularPart.Rows.Add();

                InformationForTheYear[] info = Rows[index].GetAllInformation();
                Array.Sort(info);

                Dictionary <System.UInt16, List <InformationForTheYear> > keyValues = ArrayToDictionary(info);

                //
                // Добавление строк в таблицу
                //

                System.UInt16 AllocateRows = 0;
                foreach (System.UInt16 key in keyValues.Keys)
                {
                    if (keyValues[key].Count > AllocateRows)
                    {
                        AllocateRows = (System.UInt16)keyValues[key].Count;
                    }
                }

                for (System.UInt16 counter = 0; counter < AllocateRows; counter++)
                {
                    TabularPart.Rows.Add();
                }

                //
                // Добавление информации в таблицу
                //

                //ФИО, адрес, телефон
                TabularPart.Cell(AllRowOffset, 1).Range.Text = Rows[index].FIO;

                byte Column = 2;    //Колонка для "название организации, адрес, телефон отдел кадров", 2 потому что первая колонка это ФИО, может принимать значения 2 5 8

                //С УЧЕТОМ ТОГО, ЧТО УЧЕТ БЫЛ НЕ БОЛЕЕ ЧЕМ ЗА 3 ГОДА
                foreach (System.UInt16 key in keyValues.Keys)
                {
                    byte localRowOffset = 0; //Сдвиг от первой строки(где первая строка - строка с фамилией)

                    foreach (InformationForTheYear YearInfo in keyValues[key])
                    {
                        TabularPart.Cell(AllRowOffset + localRowOffset, Column).Range.Text     = YearInfo.Organization;
                        TabularPart.Cell(AllRowOffset + localRowOffset, Column + 1).Range.Text = YearInfo.Position;
                        TabularPart.Cell(AllRowOffset + localRowOffset, Column + 2).Range.Text = YearInfo.Note;

                        localRowOffset++;
                    }

                    //Потому что двигаемся дальше, записывать информацию за следующий год
                    Column += 3;
                }

                AllRowOffset += AllocateRows;
            }

            wordDocument.Save();
            wordApplication.Visible = true;

            return(Error);
        }