void View_MoveSelected(object sender, EventArgs e) { if (View.LvLabelsToMove.SelectedItem == null) { Util.ShowError(Util.GetResourceLanguage("PLEASE_SELECT_RECORDS_IN_THE_LABELED_PRODUCT_LIST")); return; } if (View.Model.SourceLocation.LabelID == View.Model.DestLocation.LabelID) { Util.ShowError(Util.GetResourceLanguage("SOURCE_AND_DESTINATION_ARE_THE_SAME")); View.BinLocationD.Text = ""; View.BinLocationD.Focus(); View.Model.DestLocation = null; return; } //if (View.Model.SourceLocation.LabelType.DocTypeID == LabelType.ProductLabel && // View.Model.DestLocation.LabelType.DocTypeID != LabelType.BinLocation) //{ // Util.ShowError("Label can be moved only to a Bin.\n" + View.Model.DestLocation.Barcode + " is not a Bin."); // return; //} MovingLabeledProduct(); ResetToNext(); if (showNextTime) { showNextTime = UtilWindow.ConfirmResult("Process Completed."); } }
void View_MoveAll(object sender, EventArgs e) { if (View.Model.SourceLocation.LabelID == View.Model.DestLocation.LabelID) { Util.ShowError(Util.GetResourceLanguage("SOURCE_AND_DESTINATION_ARE_THE_SAME")); View.BinLocationD.Text = ""; View.BinLocationD.Focus(); return; } ProcessWindow pw = new ProcessWindow(Util.GetResourceLanguage("MOVING_ALL_BIN_STOCK_TO") + View.Model.DestLocation.Barcode + " ... "); //Selecting all Labels if (View.Model.LabelsToProcess != null && View.Model.LabelsToProcess.Count > 0) { View.LvLabelsToMove.SelectAll(); MovingLabeledProduct(); } if (View.Model.LinesToProcess != null && View.Model.LinesToProcess.Count > 0) { foreach (ProductStock record in View.Model.LinesToProcess) { //Moviendo el producto suelto. MovingReatilProduct(record, record.Stock, true); } } //refresh //LoadRetailStock(); //View.LvProductToMove.Items.Refresh(); //View.LvProductMoved.Items.Refresh(); pw.Close(); ResetToNext(); if (showNextTime) { showNextTime = UtilWindow.ConfirmResult("Process Completed."); } }
private void MoveProduct() { if (View.LvProductToMove.SelectedItem == null) { Util.ShowError(Util.GetResourceLanguage("PLEASE_SELECT_A_RECORD_IN_THE_UNLABELED_PRODUCT_LIST")); return; } if (View.Model.SourceLocation.LabelID == View.Model.DestLocation.LabelID) { Util.ShowError(Util.GetResourceLanguage("SOURCE_AND_DESTINATION_ARE_THE_SAME")); View.BinLocationD.Text = ""; View.BinLocationD.Focus(); return; } ProductStock record = View.LvProductToMove.SelectedItem as ProductStock; double qty; if (!double.TryParse(View.TxtQty.Text, out qty)) { Util.ShowError(Util.GetResourceLanguage("PLEASE_ENTER_A_VALID_QUANTITY")); return; } if (qty > record.Stock) { Util.ShowError(Util.GetResourceLanguage("QTY_TO_MOVE_IS_GREATHER_THAN_AVAILABLE")); View.TxtQty.Text = record.Stock.ToString(); return; } ProcessWindow pw = new ProcessWindow(Util.GetResourceLanguage("MOVING_UNLABELED_PRODUCT")); MovingReatilProduct(record, qty, false); View.LvProductToMove.SelectedItem = null; //recarga los source labels if (View.Model.SourceLocation.LabelType.DocTypeID == LabelType.ProductLabel) { LoadSourceLabels(); } //refresh View.LvProductToMove.Items.Refresh(); View.LvProductMoved.Items.Refresh(); pw.Close(); ResetToNext(); if (showNextTime) { showNextTime = UtilWindow.ConfirmResult("Process Completed."); } }