private void OnGenerateLabels(object sender, EventArgs e)
        {
            if (View.Model.LinesToPrint == null || View.Model.LinesToPrint.Count == 0)
            {
                Util.ShowError("No lines to generate.");
                return;
            }


            ProcessWindow pw = new ProcessWindow("Generating Labels ...");

            try
            {
                View.Model.LabelsToPrint = service.GenerateLabelsToPrint(View.Model.LinesToPrint.ToList(),
                                                                         View.PrintLot.Text, App.curRol).Where(f => f.Product.PrintLabel == true).ToList();

                View.Model.LinesToPrint = null;

                step = 1;
                View.BtnConfirm.IsEnabled = false;
                EnablePrintModule();

                pw.Close();
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Problem generating Label.\n" + ex.Message);
                return;
            }
        }
Beispiel #2
0
        void View_ConfirmCountTask(object sender, EventArgs e)
        {
            ProcessWindow pw = new ProcessWindow("Confirming Task " + View.Model.Document.DocNumber + " ...");

            //Counting Task Confirmation
            try
            {
                IEnumerable <CountTaskBalance> list = View.Model.CountSummary.Where(f => f.Mark == true);

                if (list == null || list.Count() == 0 && !View.Model.CountSummary.Any(f => f.Mark == true))
                {
                    pw.Close();
                    Util.ShowError("No records to confirm.");
                    return;
                }

                View.Model.Document = service.ConfirmCountingTaskDocument(View.Model.Document, list.ToList(), App.curUser.UserName);


                pw.Close();

                Util.ShowMessage("Count Task# " + View.Model.Document.DocNumber + " was Confirmed.\nPlease see confirmation Document for details.");

                LoadDetails(View.Model.Document);
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Error Confirming Task " + View.Model.Document.DocNumber + ".\n" + ex.Message);
            }
        }
Beispiel #3
0
        private void OnSearchDocument(object sender, DataEventArgs <string> e)
        {
            try
            {
                ProcessWindow("Searching ...", false);

                if (string.IsNullOrEmpty(e.Value))
                {
                    pw.Close();
                    LoadHistAdjustments();
                    return;
                }

                View.Model.Adjustments = service.SearchDocument(e.Value, new DocumentType {
                    DocTypeID = SDocType.InventoryAdjustment
                });

                //si encuentra un resultado lo carga
                if (View.Model.Adjustments != null && View.Model.Adjustments.Count == 1)
                {
                    View.ListAdj.SelectedIndex = 0;
                    LoadAdjustment(View.Model.Adjustments[0]);
                }


                pw.Close();
            }
            catch { pw.Close(); }
        }
Beispiel #4
0
        public void LoadDetails(Document histDoc)
        {
            try
            {
                pw = new ProcessWindow("Loading Document " + histDoc.DocNumber + " ...");
                View.StkDetail.Visibility = Visibility.Visible;
                View.Model.HistData       = Util.ToShowData(histDoc);
                View.Model.HistLines      = service.GetDocumentLine(new DocumentLine {
                    Document = histDoc
                });
                View.Model.HistDoc = histDoc;

                //Loadin Cross Docks
                View.Model.CrossDocs = service.GetTaskDocumentRelation(new TaskDocumentRelation {
                    TaskDoc = View.Model.HistDoc
                });

                pw.Close();
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Document could not be loaded.\n" + ex.Message);
            }
        }
Beispiel #5
0
        void View_LoadDetails(object sender, DataEventArgs <Document> e)
        {
            if (e.Value == null)
            {
                return;
            }

            if (View.Model.Document != null && View.Model.Document.DocID == e.Value.DocID)
            {
                return;
            }


            ProcessWindow pw = new ProcessWindow("Loading Document " + e.Value.DocNumber + " ...");

            try
            {
                LoadDetails(e.Value);
                pw.Close();
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Document could not be loaded.\n" + ex.Message);
            }
        }
        private void OnPrintLabels(object sender, EventArgs e)
        {
            SelectedPrinter = (Printer)View.PrinterList.SelectedItem;


            //if (View.Model.LabelsToPrint == null || View.Model.LabelsToPrint.Count == 0)
            if (View.ToPrintLabels.SelectedItems == null)
            {
                Util.ShowError("No labels selected to print.");
                return;
            }

            ProcessWindow pw = new ProcessWindow("Printing Labels ...");

            try
            {
                //Setea el template si lo escogio.
                LabelTemplate tplFile = View.PrintTemplate.SelectedItem != null ?
                                        ((LabelTemplate)View.PrintTemplate.SelectedItem) : null;

                //Si el template es Null Trata de setear el Template De receiving
                if (!string.IsNullOrEmpty(Util.GetConfigOption("RECVTPL")) && tplFile == null)
                {
                    try { tplFile = service.GetLabelTemplate(
                              new LabelTemplate {
                            RowID = int.Parse(Util.GetConfigOption("RECVTPL"))
                        }).First(); }
                    catch { }
                }


                //Send Labels to Print.
                List <WpfFront.WMSBusinessService.Label> lblToPrint = new List <WpfFront.WMSBusinessService.Label>();

                foreach (object lbl in View.ToPrintLabels.SelectedItems)
                {
                    lblToPrint.Add((WpfFront.WMSBusinessService.Label)lbl);
                }


                if (tplFile.IsPL == true)
                {
                    service.PrintLabelsFromDevice(WmsSetupValues.DEFAULT, tplFile.Header, lblToPrint); //View.Model.LabelsToPrint.ToList()
                }
                else
                {
                    ReportMngr.PrintLabelsInBatch(tplFile, SelectedPrinter, lblToPrint); //View.Model.LabelsToPrint
                }
                ResetForm();
                pw.Close();
                Util.ShowMessage("Process Completed.");

                return;
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Error printing labels.\n" + ex.Message);
            }
        }
Beispiel #7
0
 private void OnShowTicket(object sender, EventArgs e)
 {
     try
     {
         pw = new ProcessWindow("Generating Document ... ");
         UtilWindow.ShowDocument(View.Model.Document.DocType.Template, View.Model.HistDoc.DocID, "", false); //"PDF995"
         pw.Close();
     }
     catch { pw.Close(); }
 }
        private void LoadSourceContent(bool forced)
        {
            if (View.Model.SourceLocation != null && View.BinLocation.Text == View.Model.SourceLocation.Barcode && !forced)
            {
                return;
            }

            View.StkLabel.Visibility     = Visibility.Collapsed;
            View.StkRetail.Visibility    = Visibility.Collapsed;
            View.BtnMoveLabel.Visibility = Visibility.Collapsed;
            View.StkQtyRetail.Visibility = Visibility.Collapsed;
            View.Model.WithContent       = false;
            View.Model.LabelsToProcess   = new List <Label>();


            //Obtiene lo labels sin padre y el producto suelto que este en el BIN

            //Obtener el Bin
            View.Model.SourceLocation = service.GetLocationData(View.BinLocation.Text, false);

            if (View.Model.SourceLocation == null)
            {
                Util.ShowError(Util.GetResourceLanguage("BIN/LABEL_SOURCE") + " " + View.BinLocation.Text + Util.GetResourceLanguage("IS_NOT_VALID"));
                View.BinLocation.Text = "";
                return;
            }


            ProcessWindow pw = new ProcessWindow(Util.GetResourceLanguage("LOADING_STOCK_FOR") + View.BinLocation.Text + " ...");


            //Carga los labels contenidos en el Bin o el labels
            LoadSourceLabels();


            //Obtener el producto Suelto solo cuando es tipo
            if (View.Model.SourceLocation.LabelType.DocTypeID == LabelType.BinLocation)
            {
                LoadRetailStock();
            }


            if (View.Model.WithContent == false)
            {
                pw.Close();
                Util.ShowError(Util.GetResourceLanguage("THE_LOCATION") + View.BinLocation.Text + Util.GetResourceLanguage("DOES_NOT_CONTAIN_STOCK"));
            }
            else
            {
                View.BrDestination.Visibility = Visibility.Visible;
                //View.BinLocationD.Focus();
                pw.Close();
            }
        }
Beispiel #9
0
 void View_ShowInitialTicket(object sender, EventArgs e)
 {
     try
     {
         pw = new ProcessWindow("Generating Document ... ");
         UtilWindow.ShowDocument(new LabelTemplate {
             Header = WmsSetupValues.CountTicketTemplate
         }, View.Model.Document.DocID, "", false);                                                                                         //"PDF995"
         pw.Close();
     }
     catch { pw.Close(); }
 }
        private void OnProcessReplenish(object sender, EventArgs e)
        {
            //ViewRepPack.DgRepList.Items.Refresh();
            IList <ProductStock> list = ViewRepPack.Model.RepPackList
                                        .Where(f => f.PackStock > 0 && f.Mark == true)
                                        .ToList();

            ////foreach (Object obj in ViewRepPack.DgRepList.Items)
            //    if (((ProductStock)obj).Mark && ((ProductStock)obj).PackStock > 0)
            //        list.Add((ProductStock)obj);


            if (list.Count() == 0)
            {
                Util.ShowError("No record selected.");
                return;
            }

            ProcessWindow pw = new ProcessWindow("Creating Replenishment Order ... ");
            //1. Create a Replenishment order (new)
            Document repOrder = service.CreateReplenishOrder(list.ToList(), App.curUser.UserName, App.curLocation);

            pw.Close();

            //Refresh Document List.
            ViewRepPack.UCDocList.LoadDocuments("");

            Util.ShowMessage("Replenishment Order [" + repOrder.DocNumber + "] Created.");

            //Document to print
            UtilWindow.ShowDocument(repOrder.DocType.Template, repOrder.DocID, "", false);
        }
        public BinPresenter(IUnityContainer container, IBinView view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <BinModel>();

            //Event Delegate
            View.LoadSearch += new EventHandler <DataEventArgs <string> >(this.OnLoadSearch);
            View.New        += new EventHandler <EventArgs>(this.OnNew);
            View.LoadData   += new EventHandler <DataEventArgs <Bin> >(this.OnLoadData);
            View.Save       += new EventHandler <EventArgs>(this.OnSave);
            View.Delete     += new EventHandler <EventArgs>(this.OnDelete);

            ProcessWindow pw = new ProcessWindow("Loading ...");


            View.Model.EntityList = service.GetBin(new Bin());
            View.Model.Record     = null;


            //List Height
            View.ListRecords.MaxHeight = SystemParameters.FullPrimaryScreenHeight - 250;

            pw.Close();
        }
Beispiel #12
0
        private void GridDetails_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ProcessWindow pw = new ProcessWindow("Displaying File ...");

            try
            {
                //Para el selected Item despliega el archivo.
                if (GridDetails.SelectedItem == null)
                {
                    return;
                }

                ProcessEntityResource per = GridDetails.SelectedItem as ProcessEntityResource;
                if (per.Template != null)
                {
                    UtilWindow.ShowDocument(per.Template, per.EntityRowID, "", false);
                }

                else if (per.File != null)
                {
                    UtilWindow.ShowFile(per.File);
                }
            }
            catch (Exception ex) { Util.ShowError("Fiel could not be displayed.\n" + ex.Message); }
            finally { pw.Close(); }
        }
Beispiel #13
0
        public SysUserPresenter(IUnityContainer container, ISysUserView view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <SysUserModel>();

            //Event Delegate
            View.LoadSearch     += new EventHandler <DataEventArgs <string> >(this.OnLoadSearch);
            View.New            += new EventHandler <EventArgs>(this.OnNew);
            View.LoadData       += new EventHandler <EventArgs>(this.OnLoadData);
            View.Save           += new EventHandler <EventArgs>(this.OnSave);
            View.Delete         += new EventHandler <EventArgs>(this.OnDelete);
            View.AddRol         += new EventHandler <EventArgs>(this.OnAddRol);
            View.RemoveFromList += new EventHandler <EventArgs>(this.OnRemoveFromList);

            ProcessWindow pw = new ProcessWindow("Loading ...");

            View.Model.EntityList = service.GetSysUser(new SysUser());
            //View.Model.Record = null;

            View.Model.LocationList = service.GetLocation(new Location {
                Company = App.curCompany
            }).OrderBy(f => f.Name).ToList();
            View.Model.ListRol = service.GetRol(new Rol()).OrderBy(f => f.Name).ToList();

            pw.Close();
        }
        private void PrintParentLabel(DocumentPackage parentPack)
        {
            ProcessWindow pw = new ProcessWindow("Printing Label ... ");

            try
            {
                service.PrintLabelsFromDevice(WmsSetupValues.DEFAULT, WmsSetupValues.DefaultPalletLabelTemplate,
                                              new List <WpfFront.WMSBusinessService.Label> {
                    parentPack.PackLabel
                });
            }
            catch { }
            finally { pw.Close(); }

            /*
             * DocumentPackage basePack = service.GetDocumentPackage(new DocumentPackage
             * {
             *  PostingDocument = curPosted,
             *  ParentPackage = new DocumentPackage { PackID = -1 }
             * }).First();
             *
             * //Acomoda el label del pallet para que salga en el Template de los packages.
             * WpfFront.WMSBusinessService.Label parentLabel = basePack.PackLabel;
             *
             * parentLabel.LabelCode = parentLabel.Barcode = "SHPMNT " + curPosted.DocNumber;
             * parentLabel.Package.Sequence = 0;
             * parentLabel.Package.Weight = 0;
             * parentLabel.Package.Dimension = "";
             * parentLabel.Package.Pieces = 0;
             * parentLabel.CurrQty = 0;
             * parentLabel.StartQty = 0;
             * parentLabel.LabelID = 0;
             * parentLabel.Package.PackID = 0;
             */
        }
        public UnitPresenter(IUnityContainer container, IUnitView view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <UnitModel>();

            //Event Delegate
            View.LoadSearch     += new EventHandler <DataEventArgs <string> >(this.OnLoadSearch);
            View.New            += new EventHandler <EventArgs>(this.OnNew);
            View.LoadData       += new EventHandler <DataEventArgs <Unit> >(this.OnLoadData);
            View.Save           += new EventHandler <EventArgs>(this.OnSave);
            View.Delete         += new EventHandler <EventArgs>(this.OnDelete);
            View.ShowOnlyGroups += new EventHandler <EventArgs>(OnShowOnlyGroups);


            ProcessWindow pw = new ProcessWindow("Loading ...");

            View.Model.EntityList = service.GetUnit(new Unit {
                Company = App.curCompany
            });
            View.Model.Record           = null;
            View.TxtUnitGroup.IsEnabled = false;

            //List Height
            View.ListRecords.MaxHeight = SystemParameters.FullPrimaryScreenHeight - 250;

            //loading Units
            View.Model.UnitGroupList = service.GetUnit(new Unit {
                Company = App.curCompany, BaseAmount = 1
            }).Where(f => f.BaseAmount == 1).ToList();

            pw.Close();
        }
        void ViewRepPack_FilterByBin(object sender, DataEventArgs <String> e)
        {
            ProcessWindow pw = new ProcessWindow("Loading Records ... ");

            FilterData();

            pw.Close();
        }
Beispiel #17
0
        public ProductPresenter(IUnityContainer container, IProductView view)
        {
            View           = view;
            this.container = container;
            this.service   = new WMSServiceClient();
            View.Model     = this.container.Resolve <ProductModel>();

            //Event Delegate
            View.LoadSearch            += new EventHandler <DataEventArgs <string> >(this.OnLoadSearch);
            View.New                   += new EventHandler <EventArgs>(this.OnNew);
            View.LoadData              += new EventHandler <DataEventArgs <Product> >(this.OnLoadData);
            View.Save                  += new EventHandler <EventArgs>(this.OnSave);
            View.Delete                += new EventHandler <EventArgs>(this.OnDelete);
            View.AssignBinToProduct    += new EventHandler <DataEventArgs <Bin> >(OnAssignBinToProduct);
            View.RemoveFromList        += new EventHandler <EventArgs>(this.OnRemoveFromList);
            View.AddProductTrackOption += new EventHandler <EventArgs>(OnAddProductTrackOption);
            View.AddProductUnit        += new EventHandler <EventArgs>(OnAddProductUnit);
            View.LoadUnitsFromGroup    += new EventHandler <EventArgs>(OnLoadUnitsFromGroup);
            //View.LoadBins += new EventHandler<DataEventArgs<string>>(OnLoadBins);
            View.SetRequired          += new EventHandler <DataEventArgs <object> >(View_SetRequired);
            View.UnSetRequired        += new EventHandler <DataEventArgs <object> >(View_UnSetRequired);
            View.UpdateBinToProduct   += new EventHandler <DataEventArgs <ZoneBinRelation> >(View_UpdateBinToProduct);
            View.AddAlternateProduct  += new EventHandler <EventArgs>(View_AddAlternateProduct);
            View.AddProductAccount    += new EventHandler <DataEventArgs <ProductAccountRelation> >(View_AddProductAccount);
            View.UpdateProductAccount += new EventHandler <DataEventArgs <object> >(View_UpdateProductAccount);
            //View.SetIsMain += new EventHandler<DataEventArgs<object>>(View_SetIsMain);
            //View.UnSetIsMain += new EventHandler<DataEventArgs<object>>(View_UnSetIsMain);


            ProcessWindow pw = new ProcessWindow("Loading ...");

            View.Model.EntityList = service.GetProductApp(new Product {
                Company = App.curCompany, Reference = App.curLocation.LocationID.ToString()
            }, 25);
            View.Model.Record     = null;
            View.Model.StatusList = App.EntityStatusList;
            //Load Pick Methods
            View.Model.PickMethods  = App.PickMethodList;
            view.Model.TemplateList = service.GetLabelTemplate(new LabelTemplate {
                LabelType = new DocumentType {
                    DocTypeID = LabelType.ProductLabel
                }
            });
            view.Model.TemplateList.Add(new LabelTemplate());

            //List Height
            View.ListRecords.MaxHeight = SystemParameters.FullPrimaryScreenHeight - 250;
            View.Model.CurAltern       = new ProductAlternate();

            //USE CASN
            if (Util.GetConfigOption("USECASN").Equals("T"))
            {
                View.TbItmCasN.Visibility = Visibility.Visible;
            }


            pw.Close();
        }
Beispiel #18
0
        //Encargada de obtener el cruce entre el purchase document y los sales document
        //Involucrados en el proceso cross dock;
        private void OnCrossDockPreview(object sender, EventArgs e)
        {
            View.BtnStep1.IsEnabled = false;


            //Obteniendo el Balance
            DocumentBalance docBalance = new DocumentBalance
            {
                Document = View.Model.Document,
                Node     = View.Model.Node,
                Location = App.curLocation
            };

            ProcessWindow pw = new ProcessWindow("");

            pw.Show();

            try
            {
                //Obteniendo el cruce de documentos.
                View.Model.CrossDockBalance = service.GetCrossDockBalance(docBalance, View.Model.AssignedDocs.ToList())
                                              .Where(f => !string.IsNullOrEmpty(f.Notes))
                                              .OrderBy(f => f.Notes).ToList();

                //Mostrando el Warning de not suppied if apply
                if (View.Model.CrossDockBalance != null && View.Model.CrossDockBalance.Where(f => f.Notes == "Qty not supplied").Count() > 0)
                {
                    View.TxtWarning.Visibility = Visibility.Visible;
                }

                //Ocultando el expander superior
                View.ExpDocs.IsExpanded = false;

                //Visible the second panel
                View.ExpResult.IsExpanded = true;
                View.ExpResult.Visibility = Visibility.Visible;

                pw.Close();
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Problem generating the Cross Dock preview.\n" + ex.Message);
            }
        }
        private void imgTicket_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (lvOrders.SelectedItem == null)
            {
                Util.ShowError("Please select a record.");
                return;
            }

            ProcessWindow pw = new ProcessWindow("Generating Document ... ");

            //Open the Document Ticket
            try
            {
                UtilWindow.ShowDocument(CurDocumentType.Template, ((Document)lvOrders.SelectedItem).DocID, "", false);
                pw.Close();
            }
            catch { pw.Close(); }
        }
        private void Btn_Guardar_Click_1(object sender, RoutedEventArgs e)
        {
            //Mostrar ventana de Cargando...
            ProcessWindow pw = new ProcessWindow("Procesando registros...por favor espere...");

            SaveDetails(sender, e);

            pw.Visibility = Visibility.Collapsed;
            pw.Close();
        }
Beispiel #21
0
        void View_CreateNewTask(object sender, EventArgs e)
        {
            //Create the new Count Task y la Selecciona. Igual que create Empty document

            ProcessWindow pw = new ProcessWindow("Creating New Counting Task ...");

            try
            {
                Document document = new Document
                {
                    DocType      = docType,
                    CrossDocking = false,
                    IsFromErp    = false,
                    Location     = App.curLocation,
                    Company      = App.curCompany,
                    Date1        = DateTime.Today,
                    CreatedBy    = App.curUser.UserName
                };

                document = service.CreateNewDocument(document, true);

                View.Model.DocumentList.Add(document);

                View.DgDocument.Items.Refresh();

                pw.Close();
                Util.ShowMessage("Task Document " + document.DocNumber + " created.");


                View.ExpSetup.IsExpanded = true;

                //LoadDetails(document);
                View.CboToDo.IsEnabled     = true;
                View.CboToDo.SelectedIndex = -1;
                View.Model.Document        = document;
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Document could not be created. \n" + ex.Message);
            }
        }
        private void Btn_Guardar_Click_11(object sender, RoutedEventArgs e)
        {
            //Mostrar ventana de Cargando...
            ProcessWindow pw = new ProcessWindow("Procesando registros...por favor espere...");

            SaveDetailsReciclaje(sender, e);
            //Cierro ventana de Cargando...
            pw.Visibility = Visibility.Collapsed;
            pw.Close();
            fUpload.IsEnabled = true;
        }
Beispiel #23
0
        /// <summary>
        /// Mostrar el otro campo y eliminar los seriales.
        /// Falta programar el metodo en el PRESENTER!
        /// Los parametros son Cliente y numero del documento.
        /// OK!.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_BuscarSeriales_Click_1(object sender, RoutedEventArgs e)
        {
            //Mostrar ventana de Cargando...
            ProcessWindow pw = new ProcessWindow("Buscando registros...por favor espere...");

            //Metodo.
            BuscarSeriales(sender, e);
            pw.Visibility = Visibility.Collapsed;
            pw.Close();
            //Mostrar el Border details.
            Border_2.Visibility = Visibility.Visible;
        }
        void View_ShowShipTkt(object sender, EventArgs e)
        {
            ProcessWindow pw = new ProcessWindow(Util.GetResourceLanguage("GENERATING_DOCUMENT"));

            Document document = service.GetDocument(new Document {
                CustPONumber = View.Model.CurDoc.DocNumber
            }).First();

            UtilWindow.ShowDocument(document.DocType.Template, document.DocID, "", true);

            pw.Close();
        }
Beispiel #25
0
        private void Btn_Guardar_Click(object sender, RoutedEventArgs e)
        {
            //Mostrar ventana de Cargando...
            ProcessWindow pw = new ProcessWindow("Procesando registros...por favor espere...");

            SaveDetails(sender, e);
            //Cierro ventana de Cargando...
            pw.Visibility = Visibility.Collapsed;
            pw.Close();
            Btn_Copiar.IsEnabled    = true;
            btn_confirmar.IsEnabled = false;
        }
        private void chkRep_Checked_1(object sender, RoutedEventArgs e)
        {
            //Mostrar ventana de Cargando...
            ProcessWindow pw = new ProcessWindow("Replicando registros...por favor espere...");

            //Replica la informacion de la primera linea en las demas.
            ReplicateDetails(sender, e);
            //Cierro ventana de Cargando...
            pw.Visibility = Visibility.Collapsed;
            pw.Close();
            chkRep.IsChecked = false;
        }
        private void MovingLabeledProduct()
        {
            //recorre la lista de labels y producto seleccionado y lo mueve al destino
            ProcessWindow pw       = new ProcessWindow(Util.GetResourceLanguage("MOVING_LABELED_PRODUCT"));
            string        error    = "";
            Label         curLabel = null;

            foreach (Label label in View.LvLabelsToMove.SelectedItems)
            {
                try {
                    label.ModifiedBy = App.curUser.UserName;
                    curLabel         = service.ChangeLabelUbication(label, View.Model.DestLocation);

                    if (!curLabel.Notes.Contains("Change OK!"))
                    {
                        error += label.LabelCode + ": " + curLabel.Notes + "\n";
                    }
                    //error += "On label " + label.LabelCode + " " + curLabel.Notes + "\n";
                }
                catch (Exception ex)
                {
                    error += Util.GetResourceLanguage("FOR_LABEL") + label.LabelCode + ": " + ex.Message + "\n";;
                    continue;
                }

                //Add in Moved List
                View.Model.LabelsMoved.Add(label);

                //Remove from Original List
                View.Model.LabelsToProcess.Remove(label);
            }


            //refresh
            //View.LvLabelsToMove.Items.Refresh();
            //View.LvLabelsMoved.Items.Refresh();

            //recarga los source labels
            //if (View.Model.SourceLocation.LabelType.DocTypeID == LabelType.ProductLabel)
            //LoadSourceLabels();


            //ResetToNext();

            pw.Close();


            if (!string.IsNullOrEmpty(error))
            {
                Util.ShowError(Util.GetResourceLanguage("PROCESS_COMPLETED_WITH_ERRORS") + "\n\n" + error);
            }
        }
        private void ShowTicket(Document document)
        {
            if (document == null)
            {
                return;
            }

            ProcessWindow pw = new ProcessWindow(Util.GetResourceLanguage("GENERATING_DOCUMENT"));

            UtilWindow.ShowDocument(document.DocType.Template, document.DocID, "", true);

            pw.Close();
        }
Beispiel #29
0
        void View_FilterByBin(object sender, DataEventArgs <string> e)
        {
            ProcessWindow pw = new ProcessWindow("Loading Bins ... ");

            //Obtiene el rango de Bins
            String[] binRange = e.Value.Split(':');
            try
            {
                // CAA [2010/07/07] Nuevos filtros de busqueda
                DictionaryEntry operatorItem = (DictionaryEntry)View.BFilters.cboStrComp.SelectedItem;
                switch (operatorItem.Key.ToString())
                {
                case "between (range)":
                    View.Model.AvailableBin = oriAvailableBin.Where(f => f.Location.LocationID == App.curLocation.LocationID && f.BinCode.ToUpper().CompareTo(binRange[0].ToUpper()) >= 0).ToList();
                    View.Model.AvailableBin = View.Model.AvailableBin.Where(f => f.BinCode.ToUpper().CompareTo(binRange[1].ToUpper()) <= 0).ToList();
                    break;

                case "endswith":
                    View.Model.AvailableBin = oriAvailableBin.Where(f => f.Location.LocationID == App.curLocation.LocationID && f.BinCode.ToUpper().EndsWith(binRange[0].ToUpper())).ToList();
                    break;

                case "startswith":
                    View.Model.AvailableBin = oriAvailableBin.Where(f => f.Location.LocationID == App.curLocation.LocationID && f.BinCode.ToUpper().StartsWith(binRange[0].ToUpper())).ToList();
                    break;

                case "contains":
                    View.Model.AvailableBin = oriAvailableBin.Where(f => f.Location.LocationID == App.curLocation.LocationID && f.BinCode.ToUpper().Contains(binRange[0].ToUpper())).ToList();
                    break;

                case "equal":
                    View.Model.AvailableBin = oriAvailableBin.Where(f => f.Location.LocationID == App.curLocation.LocationID && f.BinCode.ToUpper().Equals(binRange[0].ToUpper())).ToList();
                    break;

                case "notcontains":
                    View.Model.AvailableBin = oriAvailableBin.Where(f => !f.BinCode.ToUpper().Contains(binRange[0].ToUpper()) && f.Location.LocationID == App.curLocation.LocationID).ToList();
                    break;

                default:
                    break;
                }

                //   View.Model.AvailableBin = oriAvailableBin.Where(f => f.BinCode.ToUpper().CompareTo(binRange[0].ToUpper()) >= 0).ToList();
                //   View.Model.AvailableBin = View.Model.AvailableBin.Where(f => f.BinCode.ToUpper().CompareTo(binRange[1].ToUpper()) <= 0).ToList();
                // HideBins();

                View.LvAssigned.Items.Refresh();
                View.LvAvailable.Items.Refresh();
            }
            catch { }
            finally { pw.Close(); }
        }
Beispiel #30
0
        private void PutAwayPendingQuantities()
        {
            if (PutAway == null)
            {
                Util.ShowError("Put away location could not be resolved.");
                return;
            }

            try
            {
                pw = new ProcessWindow("Receiving Product ...");
                service.ReceiptAtOnce(View.Model.Document, PutAway, View.Model.Node);
                RefreshBalance(View.Model.Document);
                pw.Close();
                Util.ShowMessage("Pending quantities for document " + View.Model.Document.DocNumber + "  was received.");
                View.Model.AnyReceived = true;
            }
            catch (Exception ex)
            {
                pw.Close();
                Util.ShowError("Product could not be received. \n" + ex.Message);
            }
        }
        private void PrintParentLabel(DocumentPackage parentPack)
        {

            ProcessWindow pw = new ProcessWindow("Printing Label ... ");

            try
            {
                service.PrintLabelsFromDevice(WmsSetupValues.DEFAULT, WmsSetupValues.DefaultPalletLabelTemplate,
                    new List<WpfFront.WMSBusinessService.Label> { parentPack.PackLabel });
            }
            catch { }
            finally { pw.Close(); }

            /*
            DocumentPackage basePack = service.GetDocumentPackage(new DocumentPackage
            {
                PostingDocument = curPosted,
                ParentPackage = new DocumentPackage { PackID = -1 }
            }).First();

            //Acomoda el label del pallet para que salga en el Template de los packages.
            WpfFront.WMSBusinessService.Label parentLabel = basePack.PackLabel;

            parentLabel.LabelCode = parentLabel.Barcode = "SHPMNT " + curPosted.DocNumber;
            parentLabel.Package.Sequence = 0;
            parentLabel.Package.Weight = 0;
            parentLabel.Package.Dimension = "";
            parentLabel.Package.Pieces = 0;
            parentLabel.CurrQty = 0;
            parentLabel.StartQty = 0;
            parentLabel.LabelID = 0;
            parentLabel.Package.PackID = 0;
            */
        }
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            //If Print all selected imprime toda la lista, si no imprime el seleccionado.
            ProcessWindow pw = new ProcessWindow("Printing Labels ... ");

            try
            {

                if (ckPrintAll.IsChecked == true)
                {
                    Util.PrintShipmentPackLabels(curPosted);
                    //PrintParentLabel();
                    return;
                }

                //Definicion del Template a Imprimier
                DocumentPackage curPack = ((DocumentPackage)sourceTree.SelectedItem);

                if (curPack == null || curPack.PackLabel.LabelID == 0)
                {
                    Util.ShowError("No Pallet/Box selected.");
                    return;
                }

                if ((curPack.ParentPackage == null || curPack.ParentPackage.PackID == 0)) 
                    //&& curPack.ChildPackages != null && curPack.ChildPackages.Count > 0) //Parent label
                    PrintParentLabel(curPack);

                else
                    //Imprime solo el Label que se selecciono.
                    service.PrintLabelsFromDevice(WmsSetupValues.DEFAULT, WmsSetupValues.DefaultPackLabelTemplate,
                        new List<WpfFront.WMSBusinessService.Label> { curPack.PackLabel });

            }
            catch (Exception ex) { Util.ShowError(ex.Message); }
            finally { pw.Close(); }
        }
        private void sourceTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            if (sourceTree.SelectedItem == null)
            {
                sourceTree.Items.Refresh();
                destTree.Items.Refresh();
                return;
            }


            ProcessWindow pw = new ProcessWindow("Loading Packages ...");

            try
            {

                bool canDelete = false;

                curPack = ((DocumentPackage)sourceTree.SelectedItem);
                PackDetailsSN = new List<WpfFront.WMSBusinessService.Label>();
                PackDetails1 = new List<ProductStock>();
                stkOparations.Visibility = stkSN.Visibility = Visibility.Hidden;


                gridPack.Visibility = Visibility.Visible;
                brMove.Visibility = Visibility.Visible;
                btnNew.Visibility = Visibility.Collapsed;
                //btnNewBox.Visibility = Visibility.Collapsed;

                //COMETARIADO PORQUE DEB TRAER EL DEL ROOT CUANDO EL ID SEA CERO
                //if (curPack.PackID == 0)
                //{
                //    gridPack.Visibility = Visibility.Hidden;
                //    brMove.Visibility = Visibility.Hidden;
                //    return;
                //}


                #region cuando es el package normal

                if (curPack.PackID > 0)
                {

                    //Si es un pallet bloquear el move Package
                    btnMovePack.Visibility = Visibility.Visible;
                    if (curPack.ChildPackages != null && curPack.ChildPackages.Count > 0)
                        btnMovePack.Visibility = Visibility.Hidden;



                    PackDetails1 = service.GetLabelStock(curPack.PackLabel);

                    if (curPack.PackLabel != null && curPack.PackLabel.LabelID != 0)
                        PackDetailsSN = service.GetUniqueTrackLabels(new WpfFront.WMSBusinessService.Label
                        {
                            FatherLabel = curPack.PackLabel, //((DocumentPackage)sourceTree.SelectedItem).PackLabel,
                            LabelType = new DocumentType { DocTypeID = LabelType.UniqueTrackLabel }
                        });


                    if (PackDetailsSN.Count == 0 && PackDetails1.Count == 0 && (curPack.ChildPackages == null || curPack.ChildPackages.Count == 0))
                        canDelete = true;


                    imgDel.Visibility = Visibility.Collapsed;
                    if (canDelete)
                        imgDel.Visibility = Visibility.Visible;


                    //Si esta cerrado no deja hacer operaciones.
                    stkOparations.Visibility = stkSN.Visibility = Visibility.Visible;
                    if (curPack.IsClosed == true)
                        stkOparations.Visibility = stkSN.Visibility = Visibility.Hidden;


                    curPieces = 0;
                    curPack.Pieces = GetCurrentPieces(curPack);

                    if (curPack.IsClosed != true)
                    {
                        try { UpdatePackages(); }
                        catch { }
                    }

                    destTree.Items.Refresh();

                }

                #endregion

                #region cuando es el package root
                else {

                    //Permite pallet
                    btnNew.Visibility = Visibility.Visible;

                    //if (curPack.ChildPackages != null && curPack.ChildPackages.Count > 0)
                        btnMovePack.Visibility = Visibility.Hidden;

                        PackDetails1 = service.GetLabelStock(rootPackage.PackLabel);

                        if (rootPackage.PackLabel != null && rootPackage.PackLabel.LabelID != 0)

                        PackDetailsSN = service.GetUniqueTrackLabels(
                        new WpfFront.WMSBusinessService.Label
                        {
                            FatherLabel = rootPackage.PackLabel,
                            LabelType = new DocumentType { DocTypeID = LabelType.UniqueTrackLabel }
                        });


                    //if (PackDetailsSN.Count == 0 && PackDetails1.Count == 0 && (curPack.ChildPackages == null || curPack.ChildPackages.Count == 0))
                        //canDelete = false;


                    imgDel.Visibility = Visibility.Collapsed;
                    //if (canDelete)
                        //imgDel.Visibility = Visibility.Visible;


                    //Si esta cerrado no deja hacer operaciones.
                    stkOparations.Visibility = stkSN.Visibility = Visibility.Visible;
                    //if (curPack.IsClosed == true)
                        //stkOparations.Visibility = stkSN.Visibility = Visibility.Hidden;


                    curPieces = 0;
                    curPack.Pieces = GetCurrentPieces(rootPackage);

                    //if (curPack.IsClosed != true)
                    //{
                    //    try { UpdatePackages(); }
                    //    catch { }
                    //}

                    destTree.Items.Refresh();
                
                }


                #endregion


            }
            catch { }
            finally { pw.Close(); }
        }
        private void btnNew_Click(object sender, RoutedEventArgs e)
        {
            if (sourceTree.SelectedItem == null)
            {
                Util.ShowError("No source package selected to create the new package inside.");
                return;
            }

            curPack = sourceTree.SelectedItem as DocumentPackage;

            newPack = new DocumentPackage
            {
                ParentPackage = curPack,
                CreatedBy = App.curUser.UserName,
                CreationDate = DateTime.Now,
                Document = curPack.Document

            };

            string pkgType = "B";
            if (((Button)sender).Name == "btnNew")
                pkgType = "P";


            //Adicionar el Package a la vista original
            newPack = service.CreateNewPackage(curPack.Document, App.curUser, true, curPack, pkgType);

            newPack.PostingDocument = curPack.PostingDocument;
            newPack.PostingDate = curPack.PostingDate;
            newPack.PostingUserName = curPack.PostingUserName;
            
            //Adicionar info para el arbol en el device
            //Level -1, 0, 1, 2 //restrict level 3
            //PackagePath PLT1 # 102047
            //SubSequence
            //CurrentDesc PLT1/BOX1
            if (newPack.ParentPackage == null)
            {
                newPack.Level = 0;
                newPack.SubSequence = Packages[0].ChildPackages.Count+1;
               
                try
                {
                    if (newPack.PackageType == "P") {
                        newPack.CurrentDesc = "PLT" + newPack.SubSequence.ToString();
                        newPack.PackDescExt = "PLT" + newPack.SubSequence.ToString() + " # " + newPack.PackLabel.LabelCode;
                        
                    }
                    else if (newPack.PackageType == "B") {
                        newPack.CurrentDesc = "BOX" + newPack.SubSequence.ToString();
                        newPack.PackDescExt = "BOX" + newPack.SubSequence.ToString() + " # " + newPack.PackLabel.LabelCode;
                    }
                }
                catch { }
            }
            else
            {
                newPack.Level = newPack.ParentPackage.Level + 1;

                try { newPack.SubSequence = newPack.ParentPackage.ChildPackages.Count + 1; }
                catch { newPack.SubSequence = 1; }

                try { newPack.PackagePath = newPack.ParentPackage.CurrentDesc + " # " + newPack.PackLabel.LabelCode; }
                catch {}

                try
                {
                    if (newPack.PackageType == "B")
                    {
                        newPack.CurrentDesc = newPack.ParentPackage.CurrentDesc + "/BOX" + newPack.SubSequence;
                        newPack.PackDescExt = "BOX" + newPack.SubSequence.ToString() + " # " + newPack.PackLabel.LabelCode;
                    }
                }
                catch { }

            }
                                 

            service.UpdateDocumentPackage(newPack);

            if (curPack.ChildPackages == null)
                curPack.ChildPackages = new List<DocumentPackage>();

            curPack.ChildPackages.Add(newPack);
            sourceTree.Items.Refresh();

            destTree.ItemsSource = sourceTree.ItemsSource;
            destTree.Items.Refresh();

            //Si es una caja, Nivel 2 Inprime el label.
            if (newPack.ParentPackage != null && newPack.ParentPackage.PackID != 0)
            {
                ProcessWindow pw = new ProcessWindow("Printing Package Label ...");
                try
                {
                    service.PrintLabelsFromDevice(WmsSetupValues.DEFAULT, WmsSetupValues.DefaultPackLabelTemplate,
                            new List<WpfFront.WMSBusinessService.Label> { newPack.PackLabel });
                }
                catch { }
                finally { pw.Close(); }
            }


        }
Beispiel #35
0
        private void imgTicket_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (lvOrders.SelectedItem == null)
            {
                Util.ShowError("Please select a record.");
                return;
            }

             ProcessWindow pw = new ProcessWindow("Generating Document ... ");

            //Open the Document Ticket
            try
            {               
                UtilWindow.ShowDocument(CurDocumentType.Template , ((Document)lvOrders.SelectedItem).DocID, "", false); 
                pw.Close();
            }
            catch { pw.Close(); }
        }
Beispiel #36
0
        private void imgPrint_Click(object sender, RoutedEventArgs e)
        {
            if (this.Document == null)
                return;

            if (this.cboPrinter.SelectedItem == null)
            {
                Util.ShowError("Please select a Printer.");
                return;
            }

            ProcessWindow pw = new ProcessWindow("Sending to Print ...");

            try
            {
                PrinterControl.PrintDocumentsInBatch(new List<Document> { this.Document },
                    (Printer)this.cboPrinter.SelectedItem);

                //(new WMSServiceClient()).PrintDocumentsInBatch(new List<Document> { this.Document },
                //    ((Printer)this.cboPrinter.SelectedItem).PrinterPath, null);


                if (NewStatus != null)
                {
                    this.Document.DocStatus = NewStatus;
                    (new WMSServiceClient()).UpdateDocument(this.Document);
                }
            }

            catch { }
            finally { pw.Close(); }



        }
        private void GridDetails_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ProcessWindow pw = new ProcessWindow("Displaying File ...");

            try
            {
                //Para el selected Item despliega el archivo.
                if (GridDetails.SelectedItem == null)
                    return;

                ProcessEntityResource per = GridDetails.SelectedItem as ProcessEntityResource;
                if (per.Template != null)
                    UtilWindow.ShowDocument(per.Template, per.EntityRowID, "", false);

                else if (per.File != null)
                    UtilWindow.ShowFile(per.File);

            }
            catch (Exception ex) { Util.ShowError("Fiel could not be displayed.\n" + ex.Message); }
            finally { pw.Close(); }

        }