private void btnPrintSelectedItemsLabels_Click(object sender, EventArgs e)
        {
            DataGridView dg = dgOrderItems;

            if (dgOrderItems.DataSource != null)
            {
                if (dgOrderItems.RowCount > 0)
                {
                    PurchaseLineItem lineItem = (PurchaseLineItem)dg.CurrentRow.DataBoundItem;

                    if (lineItem != null)
                    {
                        int    id       = lineItem.JobId.Value;
                        Job    job      = jobService.Find(id);
                        string JobName  = job.Jobname;
                        string revdate  = lineItem.PurchaseOrder.RecievedDate?.ToShortDateString() ?? "---NA---";
                        string orderNum = lineItem.PurchaseOrderId?.ToString() ?? "---NA---";
                        string receiver = lineItem.PurchaseOrder.Employee?.Lastname ?? "---NA---";

                        ThermalLabel label = labelService.GenerateInventoryDetailLabel(lineItem.LineID.ToString(), JobName, orderNum, receiver, revdate);
                        labelService.PrintLabel(label, int.Parse(this.numericUpDownCopies.Value.ToString()));
                    }
                }
            }
        }
Пример #2
0
        // Print a Barcoded Label for the part
        private void button1_Click(object sender, EventArgs e)
        {
            LabelService lbService = new LabelService();

            //string jobName = oService.GetOrderByID(_receipt.OrderNum.Value).Job.jobname;
            if (selectedPart != null)
            {
                ThermalLabel partLabel = labelService.GeneratePartLabel(selectedPart.PartID.ToString(), selectedPart.ItemDescription);
                lbService.PrintLabel(partLabel, 1);
            }
        }
Пример #3
0
        private void PrintSelectedItems()
        {
            labelService = new LabelService();
            string jobName = txtJobName.Text;
            int    qnty    = int.Parse(txtLabelQnty.Text);

            if (dgRecieptItems.DataSource != null)
            {
                if (dgRecieptItems.SelectedRows.Count > 0)
                {
                    foreach (DataGridViewRow row in dgRecieptItems.SelectedRows)
                    {
                        Inventory    inv = (Inventory)bsRecieptItemBindingSource[row.Index];
                        ThermalLabel lb  = labelService.GenerateInventoryLabel(inv.LineID.ToString(),
                                                                               jobName,
                                                                               DateTime.Today.ToShortDateString());
                        labelService.PrintLabel(lb, qnty);
                    }
                }
            }
        }
        /// <summary>
        /// Print Barcodes of Selected LineItems
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            LabelService lbService = new LabelService();
            string       jobName   = oService.GetOrderByID(_receipt.OrderNum.Value).Job.Jobname;

            if (dgOrderReceiptItems.DataSource != null)
            {
                if (dgOrderReceiptItems.SelectedRows.Count > 0)
                {
                    foreach (DataGridViewRow row in dgOrderReceiptItems.SelectedRows)
                    {
                        int          copies = Convert.ToInt16(row.Cells["LB_Qnty_col"].FormattedValue);
                        Inventory    inv    = (Inventory)bsOrderReceiptItems[row.Index];
                        ThermalLabel lb     = lbService.GenerateInventoryLabel(inv.LineID.ToString(),
                                                                               jobName,
                                                                               DateTime.Today.ToShortDateString());
                        lbService.PrintLabel(lb, copies);
                    }
                }
            }
        }