Exemple #1
0
        private void 選択した商品を印刷SToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.dataGridView1.ExtendSelection();

            List <Item> items = new List <Item>();

            kaede2nd.Dao.IItemDao idao = GlobalData.getIDao <kaede2nd.Dao.IItemDao>();
            for (int i = 0; i < this.dataGridView1.SelectedRows.Count; i++)
            {
                var itl = idao.GetItemById(this.recentList[i].item_id);
                if (itl.Count == 0)
                {
                    continue;
                }
                items.Add(itl[0]);
            }

            items.Sort(delegate(Item a, Item b) { return(a.item_id.CompareTo(b.item_id)); });

            foreach (Item it in items)
            {
                RecentItemSet ris = this.GetItemSetFromId(it.item_id);
                if (ris != null)
                {
                    ris.printed = true;
                }
            }

            ItemsPrintDocument.PrintItems(items);
            this.ReDraw();
        }
Exemple #2
0
        public void ReDraw()
        {
            this.dataGridView1.Rows.Clear();
            uint kensuu = 0;

            kaede2nd.Dao.IItemDao idao = GlobalData.getIDao <kaede2nd.Dao.IItemDao>();
            for (int cnt = this.recentList.Count - 1; cnt >= 0; cnt--)
            {
                if (this.recentList[cnt].printed == true)
                {
                    continue;
                }
                var itl = idao.GetItemById(this.recentList[cnt].item_id);
                if (itl.Count == 0)
                {
                    this.recentList.RemoveAt(cnt); continue;
                }

                DataGridViewRow row = this.dataGridView1.Rows[this.dataGridView1.Rows.Add()];
                this.setRowValue(row, itl[0]);
                kensuu += itl[0].GetTagPrintCount();
            }

            this.text_kensuu.Text = kensuu.ToString();
            if (kensuu >= this.countPerPage)
            {
                this.text_kensuu.ForeColor = Color.HotPink;
                this.BackColor             = Color.Red;
            }
            else
            {
                this.text_kensuu.ForeColor = SystemColors.WindowText;
                this.BackColor             = SystemColors.Control;
            }
        }
Exemple #3
0
        private void DoPrint(bool printAll)
        {
            this.DeleteOldPrinted();

            List <Item> items      = new List <Item>();
            uint        printCount = 0;

            kaede2nd.Dao.IItemDao idao = GlobalData.getIDao <kaede2nd.Dao.IItemDao>();
            for (int cnt = 0; cnt < this.recentList.Count; cnt++)
            {
                var itl = idao.GetItemById(this.recentList[cnt].item_id);
                if (itl.Count == 0)
                {
                    continue;
                }


                if (printAll == false)
                {
                    if ((printCount + itl[0].GetTagPrintCount()) > this.countPerPage)
                    {
                        break;
                    }
                }

                items.Add(itl[0]);
                this.recentList[cnt].printed = true;
                printCount += itl[0].GetTagPrintCount();
            }

            ItemsPrintDocument.PrintItems(items);

            this.ReDraw();
        }