Esempio n. 1
0
        private void PrintProReturnOut()
        {
            try
            {
                var ListItem = new List <SSBC_Data.Extend.LabelTemplate>();



                ListItem.Add(
                    new SSBC_Data.Extend.LabelTemplate
                {
                    //WinlineCode = _ScannerInfo.WinlineCo,
                    ItemName     = _ScannerInfo.WinlineName,
                    ColorCode    = _ScannerInfo.ColorCode,
                    ColorName    = _ScannerInfo.ColorName,
                    MaterialCo   = _ScannerInfo.MaterialCo,
                    MaterialName = _ScannerInfo.MaterialName,
                    MaterialType = _ScannerInfo.MaterialType,
                    ScaleWeight  = _ScannerInfo.ScaleWeight,
                    ScaleDate    = _ScannerInfo.ScaleDate,
                    LabelName    = "Pro-Out (Kho SX)",
                    Barcode      = _ScannerInfo.TrackNo,
                    BatchNo      = _ScannerInfo.BatchNo.ToString(),
                    MachineInfo  = _ScannerInfo.MachineInfo
                });


                var MyReader = new System.Configuration.AppSettingsReader();

                string Printer = "";

                Printer = MyReader.GetValue("Printer_White", typeof(string)).ToString();

                Report.rptLabelBarcode rep = new Report.rptLabelBarcode();
                rep.CreateDocument(false);
                rep.Load(ListItem);
                rep.PrinterName = Printer;
                rep.Print();
                rep.Dispose();
                //rep.ShowPreview();
            }
            catch (Exception err)
            {
            }
        }
Esempio n. 2
0
        private void dgvData_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            lblStatus.Text = "XAY NHỰA";
            //tabControl1.SelectedTab = TabPageInput;



            rowindex    = dgvData.CurrentCell.RowIndex;
            columnindex = dgvData.CurrentCell.ColumnIndex;

            dgvData.Rows[rowindex].Cells[columnindex].Value.ToString();



            if (dgvData.Rows[rowindex].Cells[columnindex].Value.ToString() == "IN TEM")
            {
                var ListItem = new List <SSBC_Data.Extend.LabelTemplate>();

                ListItem.Add(new SSBC_Data.Extend.LabelTemplate
                {
                    ItemName     = dgvData.Rows[rowindex].Cells[3].Value.ToString(),
                    ColorCode    = Decimal.Parse(dgvData.Rows[rowindex].Cells[4].Value.ToString()),
                    ColorName    = dgvData.Rows[rowindex].Cells[5].Value.ToString(),
                    MaterialCo   = dgvData.Rows[rowindex].Cells[6].Value.ToString(),
                    MaterialName = dgvData.Rows[rowindex].Cells[7].Value.ToString(),
                    MaterialType = "RE",
                    ScaleWeight  = decimal.Parse(dgvData.Rows[rowindex].Cells[8].Value.ToString()),
                    ScaleDate    = DateTime.Parse(dgvData.Rows[rowindex].Cells[2].Value.ToString()),
                    LabelName    = "CRUSH (XAY)",
                    Barcode      = dgvData.Rows[rowindex].Cells[9].Value.ToString(),
                    BatchNo      = dgvData.Rows[rowindex].Cells[11].Value.ToString(),
                    MachineInfo  = ""
                }
                             );



                var MyReader = new System.Configuration.AppSettingsReader();

                string Printer = "";

                Printer = MyReader.GetValue("Printer_White", typeof(string)).ToString();

                Report.rptLabelBarcode rep = new Report.rptLabelBarcode();
                rep.CreateDocument(false);
                rep.Load(ListItem);
                rep.PrinterName = Printer;
                rep.Print();
                //rep.ShowPreviewDialog();
                rep.Dispose();
                return;
            }

            if (dgvData.Rows[rowindex].Cells[columnindex].Value.ToString() == "XÓA")
            {
                if (MessageBox.Show("Bạn có chắc muốn xóa dòng này?", "Thông Báo", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    var Para_TrackType = new SqlParameter {
                        ParameterName = "TrackType", Value = "CRUSH"
                    };
                    var Para_Barcode = new SqlParameter {
                        ParameterName = "Barcode", Value = dgvData.Rows[rowindex].Cells[9].Value.ToString()
                    };
                    lblMsg.Visible = true;
                    lblMsg.Text    = dbContext.Database.SqlQuery <string>("dbo.sp_SSBC_Delete_Trackings @TrackType,@Barcode", Para_Barcode, Para_TrackType).FirstOrDefault();
                }

                return;
            }
        }
Esempio n. 3
0
        private void PrintMIX()
        {
            try
            {
                var    ListItem  = new List <SSBC_Data.Extend.LabelTemplate>();
                string LabelName = "";

                if (_ScannerInfo.TrackNo.Substring(0, 2) == "MI")
                {
                    if (txtBarcodeFull.Text.Split('-')[1] == "MI")
                    {
                        LabelName = "Copy Mix (Trộn)";
                    }
                    else if (txtBarcodeFull.Text.Split('-')[1] == "RU")
                    {
                    }
                    else if (txtBarcodeFull.Text.Split('-')[1] == "DE")
                    {
                        LabelName = "Copy Defect (Phế)";
                    }
                    else if (txtBarcodeFull.Text.Split('-')[1] == "RE")
                    {
                        LabelName = "Copy Red (Chấm Đen)";
                    }
                }

                ListItem.Add(
                    new SSBC_Data.Extend.LabelTemplate
                {
                    //winlineCode = _ScannerInfo.WinlineCo,
                    ItemName     = _ScannerInfo.WinlineName,
                    ColorCode    = _ScannerInfo.ColorCode,
                    ColorName    = _ScannerInfo.ColorName,
                    MaterialCo   = _ScannerInfo.MaterialCo,
                    MaterialName = _ScannerInfo.MaterialCo,
                    MaterialType = _ScannerInfo.MaterialType,
                    ScaleWeight  = _ScannerInfo.ScaleWeight,
                    ScaleDate    = _ScannerInfo.ScaleDate,
                    LabelName    = LabelName,
                    Barcode      = _ScannerInfo.TrackNo + "-" + txtBarcodeFull.Text.Substring(_ScannerInfo.TrackNo.Length + 1, 2),
                    BatchNo      = _ScannerInfo.BatchNo.ToString()
                });

                var MyReader = new System.Configuration.AppSettingsReader();

                string Printer = "";

                Printer = MyReader.GetValue("Printer_White", typeof(string)).ToString();

                Report.rptLabelBarcode rep = new Report.rptLabelBarcode();
                rep.CreateDocument(false);
                rep.Load(ListItem);
                rep.PrinterName = Printer;
                rep.Print();
                rep.Dispose();
                //rep.ShowPreview();
            }
            catch (Exception err)
            {
            }
        }