Example #1
0
        protected override void FillDocumentRows()
        {
            Others = new List <RowSpec>();
            List <RowSpec> partRows;
            RowSpec        row = new RowSpec();

            row.Name = "Прочие изделия";
            Others.Add(row);
            Others.Add(new RowSpec());
            string note = "";

            foreach (Model.Group group in componentList.Groups)
            {
                group.CountManufactures(settings.GroupLimitSpec);
                Components previous = new Components();
                foreach (Components c in group)
                {
                    partRows = new List <RowSpec>();
                    row      = new RowSpec();
                    partRows.Add(row);
                    note            = "";
                    row.Position    = positionNumber.ToString();
                    positionNumber += positionInc;
                    string designators = DesignatorShortener.Short(c.GetDesignatorsList());

                    if (c.NoteNumber > 0 || c.NoteNumber1 > 0)
                    {
                        note = "Примеч. " + (c.NoteNumber > 0 ? c.NoteNumber.ToString() : "") +
                               (c.NoteNumber1 > 0 ? ", " + c.NoteNumber1.ToString() : "");
                        //row.Note = note;
                    }
                    if (!String.IsNullOrEmpty(note))
                    {
                        note += ", ";
                    }

                    if (!String.IsNullOrEmpty(c.Part.Description))
                    {
                        c.Part.Description = "(" + c.Part.Description + ")";
                    }
                    // print header for subgroup and print Name and Note
                    if (group.IsInHeaders(c))
                    {
                        if (!c.IsEqualHeader(previous))
                        {
                            // empty row within groups
                            Others.Add(new RowSpec());
                            PrintHeader(c, group.GetHeader(c));
                        }
                        row = AddName(partRows, c.Part.ManufacturerPartNumber);
                        row = AddName(partRows, c.Part.Description);

                        row = AddNote(partRows, note, designators);
                    }
                    // print Name and Note without header
                    else
                    {
                        if (group.IsInHeaders(previous))
                        {
                            // empty row within groups
                            Others.Add(new RowSpec());
                        }
                        row = AddName(partRows, c.Part.Type);
                        row = AddName(partRows, c.Part.ManufacturerPartNumber);
                        row = AddName(partRows, c.Part.Description);
                        row = AddName(partRows, c.Part.Manufacturer);

                        row = AddNote(partRows, note, designators);
                    }

                    row.Quantity = c.Quantity;

                    Others.AddRange(partRows);
                    previous = c;
                    Others.Add(new RowSpec());
                }
                // empty row within groups
                Others.Add(new RowSpec());
            }

            // generating notes
            NotesRows.Add(new RowSpec("", "", "", "Примечания - ", "", 0, ""));
            NotesRows.Add(new RowSpec("", "", "", "Допускается замена - ", "", 0, ""));
            row = new RowSpec();
            NotesRows.Add(row);

            for (int noteNumber = 0; noteNumber < notes.Count; noteNumber++)
            {
                string noteRow = (noteNumber + 1) + " " + notes[noteNumber];
                row = AddNoteRow(NotesRows, noteRow);
            }
        }
Example #2
0
        protected override void FillDocumentRows()
        {
            rows = new List <RowPE3>();
            RowPE3 row;
            string note = "";

            foreach (Group group in componentList.Groups)
            {
                group.CountManufactures(settings.GroupLimitPE3);
                foreach (GroupHeader header in group.Headers)
                {
                    row      = new RowPE3();
                    row.Name = header.TypeDescription + " " + header.Manufacturer;
                    if (header.NoteNumber > 0 || header.NoteNumber1 > 0)
                    {
                        note = "Примеч. " + (header.NoteNumber > 0 ? header.NoteNumber.ToString() : "") +
                               (header.NoteNumber1 > 0 ? ", " + header.NoteNumber1.ToString() : "");
                        row.Note = note;
                    }
                    rows.Add(row);
                }
                foreach (Components c in group)
                {
                    row = new RowPE3();
                    rows.Add(row);
                    row.Designator = DesignatorShortener.Short(c.GetDesignatorsList());
                    string description = null;
                    if (!String.IsNullOrEmpty(c.Part.Description))
                    {
                        description = "(" + c.Part.Description + ")";
                    }
                    if (group.IsInHeaders(c))
                    {
                        row = AddName(rows, c.Part.ManufacturerPartNumber);
                        row = AddName(rows, description);
                        //row.Name = c.Part.ManufacturerPartNumber + " " + c.Part.Description;
                    }
                    else
                    {
                        row = AddName(rows, c.Part.Type);
                        row = AddName(rows, c.Part.ManufacturerPartNumber);
                        row = AddName(rows, description);
                        row = AddName(rows, c.Part.Manufacturer);
                        //row.Name = c.Part.Type + " " + c.Part.ManufacturerPartNumber +
                        //    " " + c.Part.Description + " " + c.Part.Manufacturer;
                    }
                    row.Quantity = c.Quantity;
                    if (c.NoteNumber > 0 || c.NoteNumber1 > 0)
                    {
                        note = "Примеч. " + (c.NoteNumber > 0 ? c.NoteNumber.ToString() : "") +
                               (c.NoteNumber1 > 0 ? ", " + c.NoteNumber1.ToString() : "");
                        row.Note = note;
                    }
                    //rows.Add(row);
                }
                // empty row within groups
                rows.Add(new RowPE3());
            }

            string noteRow = "";

            for (int noteNumber = 0; noteNumber < notes.Count; noteNumber++)
            {
                row     = new RowPE3();
                noteRow = (noteNumber + 1) + " " + notes[noteNumber];
                row     = AddNoteRow(rows, noteRow);
            }
        }