Beispiel #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();
        }
Beispiel #2
0
        public void AddRecentItemId(UInt32 iid, bool doRedraw)
        {
            RecentItemSet ris = this.GetItemSetFromId(iid);

            if (ris != null)
            {
                if (ris.printed == false)
                {
                    return;
                }
                else
                {
                    this.recentList.Remove(ris);
                }
            }

            this.recentList.Add(new RecentItemSet(iid));

            if (doRedraw)
            {
                this.ReDraw();
            }
        }