private static bool IsProcessMatchOnly( Dictionary <string, string> config, ProcessWindow window) { return(config.TryGetValue(Keys.EXECUTABLE, out var exe) && window.ProcessName.Equals(exe, StringComparison.CurrentCultureIgnoreCase)); }
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); } }
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 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(); }
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); } }
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; } }
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 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(); } }
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(); }
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); } }
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 void Resize(int w, int h) { if (Working.Height == h && Working.Width == w) { ProcessWindow.WriteLine("<-->"); return; } ProcessWindow.WriteLine("Resizing..."); Working.SetResolution(w, h); Bitmap newImage = new Bitmap(Convert.ToInt32(w), Convert.ToInt32(h)); using (Graphics gr = Graphics.FromImage(newImage)) { gr.CompositingMode = CompositingMode.SourceCopy; gr.CompositingQuality = CompositingQuality.HighQuality; gr.SmoothingMode = SmoothingMode.HighQuality; gr.InterpolationMode = InterpolationMode.HighQualityBicubic; gr.PixelOffsetMode = PixelOffsetMode.HighQuality; gr.DrawImage(_Original, new Rectangle(0, 0, Convert.ToInt32(w), Convert.ToInt32(h))); } Working = new Bitmap(newImage); Width = Convert.ToInt32(w); Height = Convert.ToInt32(h); PixelList = ConvertToList(Working, Width, Height); Pixel2DArray = ConvertTo2DArray(PixelList, Width, Height); }
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(); }
public static bool ShowProperties(IWin32Window window, int pid, string name) { ElevationAction result; // If we're viewing System, don't prompt for elevation since we can view // thread and module information without it. if (pid != 4) { result = PromptForElevation( window, new int[] { pid }, new string[] { name }, Program.MinProcessQueryRights, "restart Process Hacker elevated", "show properties for" ); } else { result = ElevationAction.NotRequired; } if (result == ElevationAction.Elevate) { Program.StartProcessHackerAdmin("-v -ip " + pid.ToString(), () => { Program.HackerWindow.Exit(); }, window.Handle); return(false); } else if (result == ElevationAction.Cancel) { return(false); } if (Program.ProcessProvider.Dictionary.ContainsKey(pid)) { try { ProcessWindow pForm = Program.GetProcessWindow(Program.ProcessProvider.Dictionary[pid], new Program.PWindowInvokeAction(delegate(ProcessWindow f) { Program.FocusWindow(f); })); } catch (Exception ex) { PhUtils.ShowException("Unable to inspect the process", ex); return(false); } } else { PhUtils.ShowError("Unable to inspect the process because it does not exist."); } return(true); }
void ViewRepPack_FilterByBin(object sender, DataEventArgs <String> e) { ProcessWindow pw = new ProcessWindow("Loading Records ... "); FilterData(); pw.Close(); }
private static bool IsCaseInsensitiveMatch( Dictionary <string, string> config, ProcessWindow window) { var(title, executable) = GetTitleAndExecutableFrom(config); return(window.WindowTitle.Equals(title, StringComparison.CurrentCultureIgnoreCase) && window.ProcessName.Equals(executable, StringComparison.CurrentCultureIgnoreCase)); }
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(); }
//03 - Marzo 2009 - Ventana de proceso private void ProcessWindow(string msg, bool closeBefore) { if (closeBefore) { pw.Close(); } pw = new ProcessWindow(msg); }
private static bool IsProcessAndPartialWindowMatch( Dictionary <string, string> config, ProcessWindow window) { var(title, executable) = GetTitleAndExecutableFrom(config); title = title.Split('-').Last(); // windows which include a document / project / extra title return(window.ProcessName.Equals(executable, StringComparison.CurrentCultureIgnoreCase) && window.WindowTitle.Split('-').Last().IsSimilarTo(title)); }
private void OpenProcessesWindow(object sender, RoutedEventArgs e) { if (!OpenProcWnd) { OpenProcWnd = true; var wnd = new ProcessWindow(_monitor.ProcessManager, _currentTheme, _currentLang); wnd.Owner = this; wnd.Show(); } }
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(); }
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(); } }
void ProcessWindow_WindowHosted(HostedProcessWindow obj) { if (ProcessWindow.HasMenubar()) { HasMenubar = true; //var dockingManager = this.GetDependencyResolver().Resolve<DockingManager>(); //var menuI = new MenuItem() { Header = "Show Menu" }; //menuI.Click += menuI_Click; //dockingManager.DocumentContextMenu.Items.Add(menuI); } }
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(); } }
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; }
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; }
/// <summary> /// Start dialog box interception for the specified owner window /// </summary> /// <param name="owner_window">owner window, if it is IntPtr.Zero then any windows will be intercepted</param> /// <param name="process_window">custom delegate to process intercepted window. It should be a fast code in order to have no message stack overflow.</param> public WindowInterceptor(IntPtr owner_window, ProcessWindow process_window) { if (process_window == null) throw new Exception("process_window cannot be null!"); this.process_window = process_window; this.owner_window = owner_window; cbf = new Win32.Functions.HookProc(dlg_box_hook_proc); //notice that win32 callback function must be a global variable within class to avoid disposing it! hook_id = Win32.Functions.SetWindowsHookEx(Win32.HookType.WH_CALLWNDPROCRET, cbf, IntPtr.Zero, Win32.Functions.GetCurrentThreadId()); }
protected override void OnIsFloatingChanged(bool isFloating) { base.OnIsFloatingChanged(isFloating); if (isFloating) { ProcessWindow.Float(); } else { ProcessWindow.Dock(); } }
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(); } }
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(); }
private static void RunRansack(string search, string fileNames, bool insideEditor = true) { if (insideEditor) { RansackQuery ransackQuery = new RansackQuery(search, fileNames); ProcessWindow.Show(ransackQuery); } else { RansackQuery.OpenRansackExternal(search, fileNames); } }
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(); } } }
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 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(); } }
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 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 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(); } }