Пример #1
0
        private void Btn_printQR_Click(object sender, EventArgs e)
        {
            PritingLabel pritingLabel = new PritingLabel();
            LabelItem    labelItem    = new LabelItem();

            labelItem.Location       = txt_warehouse.Text + "-" + txt_ERPlocation.Text;
            labelItem.PurchasingCode = txt_ERPlocation.Text;
            labelItem.MaterialCode   = txt_commodity.Text;
            labelItem.Commodity      = "";
            labelItem.Quantity       = txt_quantity.Text;
            labelItem.ImportDate     = DateTime.ParseExact(txt_importDate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            labelItem.LotPo          = txt_lotpo.Text;
            labelItem.ExpiryDate     = DateTime.ParseExact(txt_expiryDay.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            //string QRInfor = txt_warehouseName.Text + ";" + txt_location.Text + ";" + txt_rack.Text;
            //  pritingLabel.PrintLabelQRCode(labelItem);
        }
        private void Btn_Generate_Click(object sender, EventArgs e)
        {
            try
            {
                int          numberPrint  = (int)nmr_quanityPrinting.Value;
                PritingLabel pritingLabel = new PritingLabel();
                LabelItem    labelItem    = new LabelItem();
                labelItem.Location       = "";
                labelItem.PurchasingCode = txt_Purchasingcode.Text;
                labelItem.MaterialCode   = txt_materialCode.Text;

                labelItem.Quantity = nmr_quantity.Value.ToString("N2");

                labelItem.LotPo      = txt_LotPo.Text;
                labelItem.ExpiryDate = dt_ExpiryDate.Value;
                labelItem.Invoice    = txt_Invoice.Text.Trim();
                DBOperation dBOperation = new DBOperation();
                DataTable   dt          = dBOperation.GetNameOfProductCode(labelItem.MaterialCode);
                if (dt != null && dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["TD005"].ToString().Length > 10)
                    {
                        labelItem.Commodity = dt.Rows[0]["TD005"].ToString().Substring(0, 9);
                    }
                    else
                    {
                        labelItem.Commodity = dt.Rows[0]["TD005"].ToString();
                    }
                }
                else
                {
                    labelItem.Commodity = "";
                }

                //string QRInfor = txt_warehouseName.Text + ";" + txt_location.Text + ";" + txt_rack.Text;
                pritingLabel.PrintLabelQRCode(labelItem, numberPrint);
            }
            catch (Exception ex)
            {
                SystemLog.Output(SystemLog.MSG_TYPE.Err, "Btn_Generate_Click(object sender, EventArgs e)", ex.Message);
            }
        }