Пример #1
0
        internal void Double(object sender)
//создание правой клавишей мышки окошка для дублирования полосы внутри выпусков одного дня
        {
            ListView m = (ListView)sender;

            if (m.SelectedItems.Count != 0)
            {
                DblPageInfo pageToDouble = new DblPageInfo();

                for (int f = 0; f < m.SelectedItems.Count; f++)
                {
                    ListViewItem tempPnum = m.SelectedItems[f];

                    pageToDouble.sourceSectionId = Startup.myData.GetSectionIDbyCode(tempPnum.ImageKey);

                    for (int c = 0; c < Startup.issuesList.Count; c++)
                    {
                        if (Startup.issuesList[c].Id != Convert.ToInt32(m.Tag))
                        {
                            pInfo o = new pInfo();

                            o.issueName = Startup.issuesList[c].Name;
                            o.issueId   = Startup.issuesList[c].Id;
                            o.pageCount = Startup.issuesList[c].Pages;
                            o.planeId   = Startup.myData.GetTemplateID(Startup.globalDate.ToShortDateString(), o.issueId);

                            o.pageNum = Startup.myData.GetLinkPageNum(o.issueId, pageToDouble.sourceSectionId, Convert.ToInt32(m.SelectedItems[f].Text), Convert.ToInt32(m.Tag), o.planeId);

                            pageToDouble.targetPageInfo.Add(o);
                        }
                    }
                    DoublePages wDuble = new DoublePages(ref pageToDouble);
                    wDuble.Location = Startup.Location(wDuble);

                    wDuble.Text = wDuble.Text + " полосу " + tempPnum.Text.Trim();
                    wDuble.Tag  = tempPnum.Text.Trim();

                    if (wDuble.ShowDialog() == DialogResult.OK)
                    {
                        for (int i = 0; i < pageToDouble.targetPageInfo.Count; i++)
                        {
                            Startup.myData.AddLink(Startup.myData.GetTemplateID(Startup.globalDate.ToShortDateString(), pageToDouble.targetPageInfo[i].issueId),
                                                   pageToDouble.targetPageInfo[i].issueId,
                                                   pageToDouble.targetPageInfo[i].pageNum,
                                                   pageToDouble.sourceSectionId,
                                                   Convert.ToInt32(tempPnum.Text),
                                                   Convert.ToInt32(m.Tag));
                        }
                        Startup.anyChanges           = true;
                        myOwner.saveMenuItem.Enabled = true;
                    }
                    pageToDouble.Clear();
                }
                for (int k = 0; k < workingTable.ColumnCount; k++)
                {
                    ListView m1 = (ListView)workingTable.GetControlFromPosition(k, workingTable.RowCount - 1);
                    FillIssue(m1, "template_edit", m1.Items.Count, Startup.myData.GetTemplate(Startup.globalDate, Convert.ToInt32(m1.Tag.ToString()))[0], Convert.ToInt32(m1.Tag.ToString()));
                }
            }
        }
Пример #2
0
            public void Add(int issId, int pNum)
            {
                pInfo p = new pInfo();

                p.issueId = issId;
                //int x = Startup.myData.GetLinkPageNum(initialIssueId, -1, pNum, issId, Startup.globalDate);
                int x = Startup.myData.GetLinkPageNum(issId, -1, pNum, initialIssueId, Startup.myData.GetTemplateID(Startup.globalDate.ToShortDateString(), issId));

                p.pageNum   = (x == -1 ? pNum : x);
                p.isColor   = Startup.myData.GetColorForPage(p.pageNum, issId, (int)Startup.globalDate.DayOfWeek);
                p.issueCode = Startup.myData.GetIssueCodebyID(issId);
                p.isChecked = (x != -1 ? true : (issId == initialIssueId ? true : false));
                pagesInfo.Add(p);
            }