private void frmCPStation_Load(object sender, EventArgs e) { WriteLog("Khởi động Mix"); lblMsg.Visible = false; ////Kích Hoạt Cân //_listener = new SSBC_Data.Extend.LowLevelKeyboardListener(); //_listener.OnKeyPressed += _listener_OnKeyPressed; //_listener.HookKeyboard(); //Khởi tạo _ScannerInfo = new ScannerInfo(); dbContext = new SSBC_Data.SourceContext(); // _spManager.StartListening(); TrackType = "COMPOUND"; lblStatus.Text = "ĐÙN NHỰA"; tabControl1.SelectedTab = TabPageInput; ReSetControl(); txtBarcode.Focus(); //Tạo ListView }
//Scan private void scanCRUSH() { var Para_Barcode = new SqlParameter { ParameterName = "Barcode", Value = txtBarcode.Text }; var Para_ScaleWeight = new SqlParameter { ParameterName = "ScaleWeight", Value = WeightInput }; _ScannerInfo = dbContext.Database.SqlQuery <ScannerInfo>("dbo.sp_scanCRUSH @Barcode,@ScaleWeight", Para_Barcode, Para_ScaleWeight).FirstOrDefault(); }
private void scanCOMPOUND() { var Para_TrackType = new SqlParameter { ParameterName = "TrackType", Value = TrackType }; var Para_Barcode = new SqlParameter { ParameterName = "Barcode", Value = txtBarcode.Text }; var Para_ScaleWeight = new SqlParameter { ParameterName = "ScaleWeight", Value = WeightInput }; _ScannerInfo = dbContext.Database.SqlQuery <ScannerInfo>("dbo.sp_scanCOMPOUND @TrackType,@Barcode,@ScaleWeight", Para_Barcode, Para_ScaleWeight, Para_TrackType).FirstOrDefault(); }
private void txtBarcode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { lblMsg.Text = ""; lblMsg.Visible = false; var fBarcode = txtBarcode.Text; //Kiểm tra tự động chuyển var Para_Barcode = new SqlParameter { ParameterName = "Barcode", Value = fBarcode }; _ScannerInfo = dbContext.Database.SqlQuery <ScannerInfo>("dbo.sp_Station_CopyLabel @Barcode", Para_Barcode).FirstOrDefault(); if (_ScannerInfo.Msg == "") { txtBarcode.Text = ""; txtBarcodeFull.Text = fBarcode; txtTrackNo.Text = _ScannerInfo.TrackNo; //txtWinlineCode.Text = _ScannerInfo.WinlineCo; txtItemName.Text = _ScannerInfo.WinlineName; txtColorCode.Text = (_ScannerInfo.ColorCode).ToString(); txtColor.Text = _ScannerInfo.ColorName; txtMatCode.Text = _ScannerInfo.MaterialCo; txtMatName.Text = _ScannerInfo.MaterialCo; PrintMIX(); txtBarcode.Focus(); } else { lblMsg.Visible = true; lblMsg.Text = _ScannerInfo.Msg; //=========== ReSetControl(); } } }
private void frmCopyStation_Load(object sender, EventArgs e) { lblMsg.Visible = false; //Kích Hoạt Cân //_listener = new SSBC_Data.Extend.LowLevelKeyboardListener(); //_listener.OnKeyPressed += _listener_OnKeyPressed; //_listener.HookKeyboard(); //Khởi tạo _ScannerInfo = new ScannerInfo(); dbContext = new SSBC_Data.SourceContext(); //Get Default Data //LoadDefaultData(); //ListWinline = Data.Views.WinlineProductsItem.ItemsSource().ToList(); ReSetControl(); //Load Winline Product }
private void txtBarcode_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { lblMsg.Text = ""; lblMsg.Visible = false; var fBarcode = txtBarcode.Text; WeightInput = decimal.Parse(txtWeight.Text); //Kiểm tra tự động chuyển if (txtBarcode.Text.Length < 3) { lblMsg.Text = "Kiểm tra lại Barcode"; lblMsg.Visible = true; ReSetControl(); } else if (WeightInput == 0) { lblMsg.Visible = true; lblMsg.Text = "Kiểm tra lại Số lượng"; ReSetControl(); } else { var Para_Barcode = new SqlParameter { ParameterName = "Barcode", Value = fBarcode }; var Para_ScaleWeight = new SqlParameter { ParameterName = "ScaleWeight", Value = WeightInput }; _ScannerInfo = dbContext.Database.SqlQuery <ScannerInfo>("dbo.sp_CrushStation_GetData @Barcode,@ScaleWeight", Para_Barcode, Para_ScaleWeight).FirstOrDefault(); if (_ScannerInfo.Msg == "") { txtBarcode.Text = ""; txtBarcodeFull.Text = fBarcode; txtTrackNo.Text = _ScannerInfo.TrackNo; txtColorCode.Text = (_ScannerInfo.ColorCode).ToString(); txtColor.Text = _ScannerInfo.ColorName; txtMatCode.Text = _ScannerInfo.MaterialCo; txtMatName.Text = _ScannerInfo.MaterialCo; Print(); txtBarcode.Focus(); } else { lblMsg.Visible = true; lblMsg.Text = _ScannerInfo.Msg; //=========== ReSetControl(); } } //==== // var ItemsSource = (List<SSBC_Mix.Data.SQLView.ViewStocks>)gvData.DataSource; } }