예제 #1
0
        public CrossDockPresenter(IUnityContainer container, ICrossDockView view, IShellPresenter region)
        {
            View = view;
            this.container = container;
            this.service = new WMSServiceClient();
            this.region = region;
            View.Model = this.container.Resolve<CrossDockModel>();

            //Event Delegate
            View.ProcessPending += new EventHandler<DataEventArgs<int>>(OnProcessPending);
            View.RemoveFromList += new EventHandler<EventArgs>(this.OnRemoveFromList);
            View.AddDocumentToAssigned += new EventHandler<EventArgs>(OnAddDocumentToAssigned);
            View.SearchDocument += new EventHandler<DataEventArgs<string>>(this.OnSearchDocument);
            View.CrossDockPreview += new EventHandler<EventArgs>(OnCrossDockPreview);
            View.ConfirmCrossDock += new EventHandler<EventArgs>(OnConfirmCrossDock);
            View.SearchHistDocument += new EventHandler<DataEventArgs<string>>(this.OnSearchHistDocument);
            View.LoadDetails += new EventHandler<DataEventArgs<Document>>(OnLoadDetails);
            View.ShowTicket += new EventHandler<EventArgs>(OnShowTicket);
            View.ShowCrossDockDocuments += new EventHandler<EventArgs>(OnShowCrossDockDocuments);

            View.Model.AnyReceived = false;

            PutAway = service.GetBinLocation("", true);


            //Si  hay conexion a ERP se habilita el panel de posting
            //if (App.IsConnectedToErpReceving)
                View.Model.Node = service.GetNode(new Node { NodeID = Common.NodeType.Received }).First();
            //else
                //View.Model.Node = service.GetNode(new Node { NodeID = Common.NodeType.Stored }).First();


            //ShowProcessPanel();
         }
예제 #2
0
        public void TestAccess()
        {
            var agent = new Agent().Face<ITestAgent>();
            agent["Access"] = new Bin<bool>();

            agent.Init("stream", typeof(Stream), false);
            try
            {
                var f = agent["stream"].First;
            }
            catch (Exception e)
            {
                Assert.Inconclusive(e.ToString());
            }

            Assert.AreEqual(false, agent["Access"].First);

            Assert.AreEqual(1, agent["Access"].Count);

            agent.Init("Secure", true);
            agent["Secure"].Add(true);

            Assert.AreEqual(true, agent["Secure"][1]);
            Assert.AreEqual(2, agent["Secure"].Count);
        }
예제 #3
0
  public void TestLinkNoPads() {
    Element src = new Bin ("src");
    Element sink = new Bin ("sink");

    Assert.IsFalse (src.Link (sink));
    Assert.IsFalse (Element.Link (src, sink));
  }
예제 #4
0
        public void TimeBinToString()
        {
            var current = Time.Time.CurrentTime();
            var bin = new Bin<Time.Time>(current);

            Assert.AreEqual(current, bin.First);

            Assert.AreEqual("Bin<Time> ["+ current.ToString() +"]", bin.ToString());
        }
 public WriteCommand(Cluster cluster, WritePolicy policy, Key key, Bin[] bins, Operation.Type operation)
 {
     this.cluster = cluster;
     this.policy = policy;
     this.key = key;
     this.partition = new Partition(key);
     this.bins = bins;
     this.operation = operation;
 }
 public AsyncWrite(AsyncCluster cluster, WritePolicy policy, WriteListener listener, Key key, Bin[] bins, Operation.Type operation)
     : base(cluster)
 {
     this.policy = policy;
     this.listener = listener;
     this.key = key;
     this.partition = new Partition(key);
     this.bins = bins;
     this.operation = operation;
 }
예제 #7
0
파일: BinTest.cs 프로젝트: jwzl/ossbuild
  public void TestGetByName() {
    Bin bin = new Bin ("test-bin");
    Element e1 = ElementFactory.Make ("fakesrc", "element-name");
    bin.Add (e1);

    e1 = bin.GetByName ("element-name");

    Assert.IsNotNull (e1);
    Assert.AreEqual (e1.Name, "element-name");
  }
예제 #8
0
		/// <summary>
		/// Create an event counter
		/// </summary>
		/// <param name="InAvePeriod">The period over which events are counter. The time we keep them and calculate the average rate.</param>
		/// <param name="InResolution">The number of bins in which events are kept in the given period.</param>
		public EventCounter(TimeSpan InAvePeriod, int InResolution)
		{
			Period = InAvePeriod;
			Resolution = InResolution;
			Bins = new Queue<Bin>(Resolution);
			BinPeriod = TimeSpan.FromTicks(Period.Ticks/Resolution);
			ActiveBin = new Bin();
			Bins.Enqueue(ActiveBin);
			Count = 0;
			Timestamp = DateTime.UtcNow;
		}
예제 #9
0
        public IList<Bin> Select(Bin data)
        {

                IList<Bin> datos = new List<Bin>();

                datos = GetHsql(data).List<Bin>();

                if (!Factory.IsTransactional)
                    Factory.Commit();

                return datos;
            
        }
예제 #10
0
파일: BinTest.cs 프로젝트: jwzl/ossbuild
  public void TestAdd() {
    Bin bin = new Bin ("test-bin");
    Element e1 = new FakeSrc ("fakesrc");
    Element e2 = new FakeSink ("fakesink");

    Assert.IsNotNull (bin, "Could not create bin");
    Assert.IsNotNull (e1, "Could not create fakesrc");
    Assert.IsNotNull (e2, "Could not create fakesink");

    bin.Add (e1, e2);

    Assert.AreEqual (bin.ChildrenCount, 2);
  }
예제 #11
0
        public void TimeBinToStream()
        {
            var current = Time.Time.CurrentTime();
            var bin = new Bin<Time.Time>(current);

            var stream = bin.Serialize();
            var newBin = stream.DeSerializeBin();

            Assert.IsInstanceOfType(newBin, typeof(Bin<Time.Time>));
            Assert.AreEqual(current.ToString(), newBin[0].ToString());


        }
예제 #12
0
        static void Main(string[] args)
        {
            if (args.Length < 4)
            {
                Console.Error.WriteLine("Error: No se han especificado parámetros.");
                Console.Error.WriteLine("El formato es: EliminaCodigoDeArchivoBin.exe [tabla de códigos] [archivo de entrada] [archivo de salida] [código a eliminar]");
                Console.Error.WriteLine("Ejemplo: EliminaCodigoDeArchivoBin.exe digiBCA.Tab.xml 29091711.bin salida.bin 201");
                return;
            }

            try
            {
                DigiTab dt = DigiTab.Load(args[0]);
                using (Bin archivoEntrada = new Bin(dt, args[1], 2, new Point3D(0.0, 0.0, 0.0), true, false))
                {
                    using (Bin archivoSalida = new Bin(dt, args[2], 2, new Point3D(0.0, 0.0, 0.0), false, true))
                    {
                        foreach (Entity entidad in archivoEntrada)
                        {
                            Entity clonada = entidad.Clone();

                            // Eliminamos todos los códigos de la entidad clonada
                            clonada.Codes.Clear();

                            // Añadimos únicamente los códigos cuyo nombre no coincida con el pasado por parámetros
                            foreach (var código in entidad.Codes)
                            {
                                if (código.Name == args[3])
                                    continue;

                                clonada.Codes.Add(código);
                            }

                            if (entidad.Codes.Count == 0)
                                continue; // No almacenamos la entidad, pues al quitarle el código indicado por parámetros se ha quedado sin códigos. Era el único que tenía.

                            archivoSalida.Add(clonada);
                            Console.Write("*");
                        }
                    }
                }
            }
            catch (Exception excepción)
            {
                Console.Error.WriteLine("Se localizó el siguiente error:");
                Console.Error.WriteLine(excepción.Message);
                return;
            }
        }
예제 #13
0
        public void TestClone()
        {
            var agent = new Agent();
            agent["Access"] = new Bin<bool>(true, false);

            agent.Init("Test", new Vector3D());
            agent["Test"].Add(new Vector3D(1.0,1.0,1.0));

            var copy = (Agent)agent.Clone();

            Assert.AreEqual(true, copy["Access"].First);
            Assert.AreEqual(false, copy["Access"][1]);

            Assert.AreEqual(0.0, ((Vector3D)copy["Test"].First).x);
            Assert.AreEqual(1.0, ((Vector3D)copy["Test"][1]).x);
        }
예제 #14
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map = world.Map;
            influence = new CellLayer<InfluenceNode>(world.Map);

            cols = CellCoordToBinIndex(world.Map.MapSize.X) + 1;
            rows = CellCoordToBinIndex(world.Map.MapSize.Y) + 1;
            bins = new Bin[rows * cols];
            for (var row = 0; row < rows; row++)
                for (var col = 0; col < cols; col++)
                    bins[row * cols + col] = new Bin();

            // Cache this delegate so it does not have to be allocated repeatedly.
            actorShouldBeRemoved = removeActorPosition.Contains;
        }
예제 #15
0
        public ActorMap(World world, ActorMapInfo info)
        {
            this.info = info;
            map = world.Map;
            influence = new CellLayer<InfluenceNode>(world.Map);

            cols = world.Map.MapSize.X / info.BinSize + 1;
            rows = world.Map.MapSize.Y / info.BinSize + 1;
            bins = new Bin[rows * cols];
            for (var j = 0; j < rows; j++)
                for (var i = 0; i < cols; i++)
                    bins[j * cols + i] = new Bin();

            // Cache this delegate so it does not have to be allocated repeatedly.
            actorShouldBeRemoved = removeActorPosition.Contains;
        }
예제 #16
0
파일: Program.cs 프로젝트: digi21/Binselec
        static void Main(string[] args)
        {
            if (args.Length < 3)
            {
                Console.Error.WriteLine("Error, no has indicado suficientes parámetros.");
                Console.Error.WriteLine("El formato es el siguiente: ExtraerEntidadesDeArchivos [archivo .bin a generar] [Digi.tab] [codigo 1]...[código n].");
                return;
            }

            DirectoryInfo di = new DirectoryInfo(Directory.GetCurrentDirectory());
            FileInfo[] archivos = di.GetFiles("*.bin");

            DigiTab dt;

            try {
                dt = DigiTab.Load(args[1]);
            }
            catch(Exception excepción)
            {
                Console.Error.WriteLine("Se ha localizado un error al cargar la tabla de códigos.");
                Console.Error.WriteLine(excepción.Message);
                return;
            }

            using (Bin archivoSalida = new Bin(dt, args[0], 2, new Point3D(0,0,0), false, true) )
            {
                foreach (var archivo in archivos)
                {
                    using (Bin archivoEntrada = new Bin(dt, archivo.Name, 2, new Point3D(0, 0, 0), true, false))
                    {
                        Console.WriteLine(string.Format("Analizando el archivo: {0}", archivo.Name));

                        var entidades = from entidad in archivoEntrada
                                        where entidad.TieneAlgúnCódigo(args.Skip(2))
                                        select entidad;

                        foreach (var entidad in entidades)
                        {
                            Entity clonada = entidad.Clone();
                            archivoSalida.Add(clonada);
                        }
                    }
                }
            }
        }
예제 #17
0
 public Bin[] createBinsFromHistogram(int spaceDimension, int histogramResolution, Array array)
 {
     int cellNO = (int)Math.Pow(histogramResolution, spaceDimension);
     Bin[] bins = new Bin[cellNO];
     int heft;
     for (int cellIdx = 0; cellIdx < cellNO; cellIdx++)
     {
         int[] indicesArray = new int[spaceDimension];
         transformator.transformCellIdxToIndicesArray(histogramResolution, indicesArray, cellIdx);
         heft = (int)array.GetValue(indicesArray);
         bins[cellIdx] = new Bin
         {
             IndicesArray = indicesArray,
             Heft = heft
         };
     }
     return bins;
 }
예제 #18
0
        public void TimeBinToJson()
        {
            var current = Time.Time.CurrentTime();
            var bin = new Bin<Time.Time>(current);

            var settings = new JsonSerializerSettings { Formatting = Formatting.None, TypeNameHandling = TypeNameHandling.None };


            string json = JsonConvert.SerializeObject(bin, settings);


            var newBin = (Bin)JsonConvert.DeserializeObject(json, typeof(Bin));

            Assert.IsInstanceOfType(newBin, typeof(Bin<Time.Time>));
            Assert.AreEqual(current.ToString(), newBin[0].ToString());

            
        }
예제 #19
0
        public string createNewBin(InventoryBin bin)
        {
            NetSuiteService service = new NetSuiteService();
            service.CookieContainer = new CookieContainer();
            NetsuiteUser user = new NetsuiteUser("3451682", "*****@*****.**", "1026", "tridenT168");
            Passport passport = user.prepare(user);
            Status status = service.login(passport).status;

            LocationSearch locationSearch = new LocationSearch();
            LocationSearchBasic locationSearchBasic = new LocationSearchBasic();
            SearchStringField locationName = new SearchStringField();
            locationName.searchValue = bin.LocationName;
            locationName.@operator = SearchStringFieldOperator.@is;
            locationName.operatorSpecified = true;
            locationSearchBasic.name = locationName;
            locationSearch.basic = locationSearchBasic;

            SearchResult sr = new SearchResult();
            sr = service.search(locationSearch);
            if (sr.status.isSuccess != true) Console.WriteLine(sr.status.statusDetail[0].message);

            Bin newBin = new Bin();
            RecordRef newLocation = new RecordRef();
            newLocation.type = RecordType.location;
            newLocation.typeSpecified = true;
            newLocation.internalId = ((com.netsuite.webservices.Location)sr.recordList[0]).internalId;
            newBin.binNumber = bin.BinNumber;
            newBin.location = newLocation;

            WriteResponse writeResponse = service.add(newBin);
            if (writeResponse.status.isSuccess == true)
            {

                Console.WriteLine("Bin: "+ newBin.binNumber +" has been created.");
                return "Bin: " + newBin.binNumber + " has been created.";

            }
            if (writeResponse.status.isSuccess == false)
            {
                Console.WriteLine(writeResponse.status.statusDetail[0].message);
                return writeResponse.status.statusDetail[0].message;
            }
            return string.Empty;
        }
예제 #20
0
    void Awake()
    {
        if (partiSystem == null)
            partiSystem = this.GetComponent<ParticleSystem> ();
        ps = new ParticleSystem.Particle[0];
        particlePositions = new Vector3[0];

        bins = new Bin[binXResolution][][];
        for(int i = 0; i < binXResolution; ++i){
            bins[i] = new Bin[binYResolution][];
            for(int j = 0; j < binYResolution; ++j){
                bins[i][j] = new Bin[binZResolution];
                for(int k = 0; k < binZResolution; ++k){
        #if TESTCOLORS
                    bins[i][j][k].color  = new Color(Random.value,Random.value,Random.value); //TODO: Remove For build
        #endif
                }
            }
        }
    }
예제 #21
0
파일: BinTest.cs 프로젝트: jwzl/ossbuild
  public void TestGetChildByIndex() {
    Bin bin = new Bin ("test-bin");

    Element [] elements = new Element [] {
      ElementFactory.Make ("fakesrc", "fakesrc"),
      ElementFactory.Make ("audioconvert", "audioconvert"),
      ElementFactory.Make ("wavenc", "wavenc"),
      ElementFactory.Make ("fakesink", "fakesink")
    };

    foreach (Element element in elements) {
      bin.Add (element);
    }

    Assert.AreEqual (elements.Length, bin.ChildrenCount);

    for (uint i = 0; i < elements.Length; i++) {
      Assert.AreEqual (elements[elements.Length - i - 1], bin.GetChildByIndex (i));
    }
  }
예제 #22
0
        private void OnLoadSearch(object sender, DataEventArgs<string> e)
        {
            // CAA [2010/07/13] Busq. adicional por status
            if (string.IsNullOrEmpty(e.Value) && (View.CboStatusSearch.SelectedIndex == -1 || View.CboStatusSearch.SelectedValue.ToString().Equals("-1")))
                {
                    View.Model.EntityList = service.GetBin(new Bin { Location = App.curLocation });
                    return;
                }

            //if (e.Value.Length < WmsSetupValues.SearchLength)
            //    return;

            Bin tmpSearch = new Bin { Location = App.curLocation };
            if (!string.IsNullOrEmpty(e.Value))
                tmpSearch.BinCode = e.Value;
            if (View.CboStatusSearch.SelectedIndex != -1 && !View.CboStatusSearch.SelectedValue.ToString().Equals("-1"))
                tmpSearch.Status = new Status { StatusID = int.Parse(View.CboStatusSearch.SelectedValue.ToString()) };

            //Busca por Nombre y/o status
            View.Model.EntityList = service.GetBin(tmpSearch);

        }
예제 #23
0
		/// <summary>
		/// Adds events to the counter. Keeps track of internal bins and updates them keeping only those in our Period.
		/// </summary>
		/// <param name="InCount">The number of events to add</param>
		public void AddEvent(int InCount = 1)
		{
			lock (ThisLock)
			{
				TotalCount += InCount;
				DateTime EventTime = DateTime.UtcNow;

				while (EventTime - Timestamp > BinPeriod)
				{
					ActiveBin = new Bin();
					Bins.Enqueue(ActiveBin);
					Timestamp += BinPeriod;
				}

				Count += InCount;
				ActiveBin.Count += InCount;

				while (Bins.Count > Resolution)
				{
					Count -= Bins.Dequeue().Count;
				}
			}
		}
예제 #24
0
 private void GetCastSound(MultiBuffClass buff) => Bin.Add("CastSound", CastSound = buff.CastSound);
예제 #25
0
 private void GetName(MultiBuffClass buff) => Bin.Add("Name", Name = buff.Name);
예제 #26
0
 private void GetId(MultiBuffClass buff) => Bin.Add("Id", Id = buff.Id);
예제 #27
0
 public RecordHandler(TestAsyncPutGet parent, Key key, Bin bin)
 {
     this.parent = parent;
     this.key    = key;
     this.bin    = bin;
 }
예제 #28
0
 private void GetUnderground(PlayerInfo pInfo) => Bin.Add("Underground", Underground = pInfo.EP != null ? (int)pInfo.EP.position.y - GameManager.Instance.World.GetHeight((int)pInfo.EP.position.x, (int)pInfo.EP.position.z) - 1 : 0);
예제 #29
0
 private void GetIcon(MultiBuffClass buff) => Bin.Add("Icon", Icon = buff.Icon);
예제 #30
0
 private void GetDescription(MultiBuffClass buff) => Bin.Add("Description", Description = buff.Description);
예제 #31
0
 private void GetFriends(PlayerInfo pInfo) => Bin.Add("Friends", Friends = pInfo.PPD?.ACL?.ToList());
예제 #32
0
 private void GetCritOnly(MultiBuffClass buff) => Bin.Add("CritOnly", CritOnly = buff.CriticalHitOnly);
예제 #33
0
 private void GetRotation(PlayerInfo pInfo) => Bin.Add("Rotation", Rotation = pInfo.EP != null ? pInfo.EP.rotation : pInfo.PDF.ecd.rot);
예제 #34
0
 private void GetSessionPlaytime(PlayerInfo pInfo) => Bin.Add("SessionPlayTime", pInfo.EP != null ? SessionPlayTime = Math.Round((Time.timeSinceLevelLoad - pInfo.EP.CreationTimeSinceLevelLoad) / 60, 2) : 0);
예제 #35
0
 private void GetLastOnline(PlayerInfo pInfo) => Bin.Add("LastOnline", pInfo.EP == null ? LastOnline = pInfo.PCP != null ? pInfo.PCP.LastOnline.ToUtcStr() : "" : null);
예제 #36
0
 private void GetLastSaveSecs(PlayerInfo pInfo) => Bin.Add("LastSaveSecs", LastSaveSecs = pInfo.EP != null ? pInfo.PCP != null && pInfo.PCP.LastSaveUtc.Ticks != 0 ? (DateTime.UtcNow - pInfo.PCP.LastSaveUtc).TotalMilliseconds / 1000 : (double?)null : null);
예제 #37
0
 private void GetDebuffSound(MultiBuffClass buff) => Bin.Add("DebuffSound", DebuffSound = buff.DebuffSound);
예제 #38
0
 private void GetLpBlocks(PlayerInfo pInfo) => Bin.Add("LPBlocks", LPBlocks = pInfo.PPD?.LPBlocks?.Select(lpb => lpb.ToVector3()).ToList());
예제 #39
0
 private void GetTooltip(MultiBuffClass buff) => Bin.Add("Tooltip", Tooltip = buff.Tooltip);
예제 #40
0
 private void GetDebuffBuff(MultiBuffClass buff) => Bin.Add("DebuffBuff", DebuffBuff = buff.DebuffBuff);
예제 #41
0
 private void GetTotalPlaytime(PlayerInfo pInfo) => Bin.Add("TotalPlayTime", TotalPlayTime = Math.Round((pInfo.PCP != null ? pInfo.PCP.TotalPlayTime : 0) / 60f, 2));
예제 #42
0
 private void GetPosition(PlayerInfo pInfo) => Bin.Add("Position", Position = pInfo.EP != null ? pInfo.EP.position : pInfo.PDF.ecd.pos);
예제 #43
0
 private void GetExpirySound(MultiBuffClass buff) => Bin.Add("ExpiredSound", ExpiredSound = buff.ExpiredSound);
예제 #44
0
        //Dec 04 2009 para recibir seriales de una vez en proceos One By One
        public IList<Label> CreateProductUniqueTrackLabels(DocumentLine data, Node node, Bin destLocation, 
            string printingLot, string comment, DateTime receivingDate)
        {            

            //Label Type
            DocumentType labelType = Factory.DaoDocumentType().Select(new DocumentType { DocTypeID = LabelType.UniqueTrackLabel }).First();

            //Status
            Status status = Factory.DaoStatus().Select(new Status { StatusID = EntityStatus.Active }).First();

            IList<Label> labelResult = new List<Label>();

            string notes = (data.Document != null && data.Document.DocID > 0) ? "Doc# " + data.Document.DocNumber : "";
            notes = notes + " " + data.Unit.Name;

            //double labelBalance = data.Quantity;
            int numLabels = (int)data.Quantity;

            if (numLabels <= 0)
                throw new Exception("No valid amount of labels to print.");


            Label fatherLabel = null;

             for (int i = 0; i < numLabels; i++)
            {
                fatherLabel = new Label();
                fatherLabel.Node = node;
                fatherLabel.Bin = destLocation;
                fatherLabel.Product = data.Product;
                fatherLabel.CreatedBy = data.CreatedBy;
                fatherLabel.Status = status;
                fatherLabel.LabelType = labelType;
                fatherLabel.CreationDate = DateTime.Now;
                fatherLabel.Printed = true; 

                fatherLabel.Unit = data.Unit; //La unidad que tiene ese Label //logisticUnit; L
                fatherLabel.IsLogistic = false;
                fatherLabel.FatherLabel = null;
                fatherLabel.LabelCode = Guid.NewGuid().ToString();
                fatherLabel.CurrQty = 1; //*data.Unit.BaseAmount;
                fatherLabel.StartQty = 1; //*data.Unit.BaseAmount;

                fatherLabel.Notes = notes;
                fatherLabel.PrintingLot = printingLot; //data.Note;
                fatherLabel.ReceivingDate = receivingDate == null ? DateTime.Now : receivingDate;
                fatherLabel.ReceivingDocument = data.Document.DocID > 0 ? data.Document : null;

                 //Guarda y Actualiza para poder obtener su serial
                fatherLabel = Factory.DaoLabel().Save(fatherLabel);
                fatherLabel.LabelCode = '1' + fatherLabel.LabelID.ToString().PadLeft(WmsSetupValues.LabelLength-1, '0');
                Factory.DaoLabel().Update(fatherLabel);

                labelResult.Add(fatherLabel);


                //Registra el movimiento del nodo

                SaveNodeTrace(
                    new NodeTrace
                    {
                        Node = node,
                        Document = data.Document.DocID > 0 ? data.Document : null,
                        Label = fatherLabel,
                        Quantity = fatherLabel.CurrQty,
                        IsDebit = false,
                        CreatedBy = data.CreatedBy,
                        Comment = comment
                    }
                );

            }

            return labelResult;
        }
예제 #45
0
 private void GetSmell(MultiBuffClass buff) => Bin.Add("Smell", Smell = buff.SmellName);
예제 #46
0
파일: Rules.cs 프로젝트: erwin-hamid/LogPro
        public Boolean ValidateBinStatus(Bin bin, bool autoThrow)
        {
            if (bin.Status.StatusID == EntityStatus.Active)
                return true;

            if (autoThrow)
            {
                Factory.Rollback();
                throw new Exception("Bin affected: " + bin.BinCode + " is currently " + bin.Status.Name + ".");
            }
            else
                return false;
        }
예제 #47
0
 private void GetFFCheck(MultiBuffClass buff) => Bin.Add("FFCheck", FFCheck = buff.FriendlyFireCheck);
예제 #48
0
        private void LoadDetails(Document document)
        {
            
            View.BinLocation.Text = "";

            //Reseting UControl of Product
            View.TxtProduct.Text = "";
            View.TxtProduct.Product = null;
            View.TxtProduct.DefaultList = null;
            View.TxtProduct.DataList = null;
            View.TxtProduct.ProductDesc = "";


            //if (!View.Model.PutAwayDirect)
                //View.ChkPutAway.IsChecked = false;
            View.Model.PutAwayDirect = false;
            if (Util.GetConfigOption("PUTAWAYDIRECT").Equals("T"))
                View.Model.PutAwayDirect = true;


            View.BtnCrossDock.Visibility = Visibility.Visible;
            //View.BtnCreateReceipt.Content = "Create Purchase Receipt";
            View.BtnCreateReceipt.Content = Util.GetResourceLanguage("CREATE_RECEIPT");

            if (document.DocType.DocTypeID != SDocType.PurchaseOrder)
            {
                View.BtnCreateReceipt.Content = Util.GetResourceLanguage("CONFIRM_DOCUMENT");
                View.BtnCrossDock.Visibility = Visibility.Collapsed;
            }

            //Comportamiento Especial de Return- 26 Mayo 2009
            View.BinLocation.IsEnabled = true;
            View.BinLocation.Text = "";
            
            View.ChkPutAway.IsEnabled = true;
            View.ChkPutAway.IsChecked = View.Model.PutAwayDirect;


            View.GridManual.Visibility = Visibility.Visible;
            View.GridReturn.Visibility = Visibility.Collapsed;


            if (document.DocType.DocTypeID == SDocType.Return)
            {
                View.BinLocation.IsEnabled = false;
                View.BinLocation.Text = DefaultBin.RETURN;
                View.ChkPutAway.IsChecked = false;
                View.ChkPutAway.IsEnabled = false;

                //Habilitando el Expander de Return
                View.GridManual.Visibility = Visibility.Collapsed;
                View.GridReturn.Visibility = Visibility.Visible;

                try
                {
                    damageBin = service.GetBin(new Bin { BinCode = DefaultBin.DAMAGE, Location = App.curLocation }).First();
                }
                catch { }
            }

            //SI EL DOCUMENT ES RECEIVING TASK -- MIRA si tiene configurado un BIN Especifico para las TASKS
            //Si no USA MAIN
            if (document.DocType.DocTypeID == SDocType.ReceivingTask && !string.IsNullOrEmpty(Util.GetConfigOption("RCTASKBIN")))
            {
                View.BinLocation.IsEnabled = false;
                View.BinLocation.Text = Util.GetConfigOption("RCTASKBIN"); //Sale del Config
                View.ChkPutAway.IsChecked = false;
                View.ChkPutAway.IsEnabled = false;
            }



            //Actualizando datos del Documento requeridos para posibles transacciones
            document.ModifiedBy = View.Model.User.UserName;
            //document.Location = App.curLocation;
            
            View.Model.ProductUnits = null;            
            View.Model.PackingUnits = null;
            View.Model.PackUnit = null;
            View.Model.CurQtyPending = 0;


            //No product Selected
            View.Model.Product = null;
            View.Model.VendorItem = "";
            View.TabProductInfo.Visibility = Visibility.Collapsed;

            View.Model.Document = document;

            View.ProcessResult.Text = "";

            View.TxtPostResult.Text = "";

            View.TabDocDetails.Visibility = Visibility.Visible;

            View.Model.DocumentData = Util.ToShowData(document);


            //DIRECT PRINT 30oct2009
            View.DirectPrint.Document = View.Model.Document;
            if (View.Model.Document.DocStatus.StatusID == DocStatus.New)
                View.DirectPrint.NewStatus = App.DocStatusList.Where(f => f.StatusID == DocStatus.InProcess).First();


            //Check If CrossDock 7 Marzo 09
            CheckIfCrossDock();

            View.Model.DocumentLines = service.GetDocumentLine(new DocumentLine { Document = document });

            View.ExpDocLines.IsExpanded = true;
            View.BtnRecTkt.Visibility = Visibility.Visible;

            IsDirectReceipt = false;
            if (View.Model.DocumentLines == null || View.Model.DocumentLines.Count == 0)
            {
                IsDirectReceipt = true;
                View.ExpDocLines.IsExpanded = false;
                //Receiving Ticket
                View.BtnRecTkt.Visibility = Visibility.Collapsed;
            }
            
            //Select Status
            //View.ComboStatus.SelectedValue = View.Model.Document.DocStatus.StatusID;


            RefreshBalance(document);            


            //Cargue del tab de recibo, solo si el documento es new or in process   
            View.TabItemReceive.Visibility = Visibility.Collapsed;

            //Si no esta en receiving vuelve al tab de detalles
            View.TabDocDetails.SelectedIndex = View.TabDocDetails.SelectedIndex > 1 ? 0 : View.TabDocDetails.SelectedIndex;  

            if (document.DocStatus.StatusID == DocStatus.InProcess || document.DocStatus.StatusID == DocStatus.New
                || document.DocStatus.StatusID == DocStatus.Completed)
            {
                View.TabItemReceive.Visibility = Visibility.Visible;
                
                View.Model.VendorItem = "";

                //View.Model.DocProducts = service.GetDocumentProductFromLines(View.Model.DocumentLines);
                View.Model.DocProducts = View.Model.DocumentBalance.Where(f => f.QtyPending > 0)
                    .Select(f=>f.Product).ToList();

                //Setea para que el Control de producto solo muestre el balance.
                if (View.Model.Document.IsFromErp == true)
                    View.TxtProduct.DefaultList = View.Model.DocProducts;

                //si encuentra un resultado lo carga
                //SelectOneProduct();

                //Solo muestra los labels si hay saldos en el documento
                if (AllReceived == false)
                    ShowLabelsAvailable(document);

                View.BtnReceiveLabel.Visibility = Visibility.Collapsed;

                if (View.Model.LabelsAvailable != null && View.Model.LabelsAvailable.Count > 0)
                    View.BtnReceiveLabel.Visibility = Visibility.Visible;

                //Reset the manual receiving
                View.Model.ReceivingQuantity = 0;
            }

          

            //Reset Posted Receipts
            View.DgReceiptLines.Visibility = View.BtnReversePosted.Visibility = Visibility.Collapsed;
            View.StkReceiptData.Visibility = Visibility.Collapsed;


            if (View.TabItemReceive.Visibility != Visibility.Visible && View.TabDocDetails.SelectedIndex > 0 )
                View.TabDocDetails.SelectedIndex = 0;          

          

            //Receiving Expande
            View.ExpManual.IsEnabled = true;            
            if (document.DocType.DocTypeID == SDocType.WarehouseTransferReceipt)
            {
                View.ExpManual.IsEnabled = false;
                View.ExpManual.IsExpanded = false;
            }

        }
예제 #49
0
 private void GetDuration(MultiBuffClass buff) => Bin.Add("Duration", Duration = Math.Round(buff.FDuration, 6));
예제 #50
0
 private void GetStackMax(MultiBuffClass buff) => Bin.Add("StackMax", StackMax = buff.StackMax);
예제 #51
0
 private void GetPing(PlayerInfo pInfo) => Bin.Add("Ping", Ping = pInfo.CI != null ? pInfo.CI.ping.ToString() : "Offline");
예제 #52
0
 private void GetExpiryBuff(MultiBuffClass buff) => Bin.Add("ExpiryBuff", ExpiryBuff = buff.ExpiryBuff);
예제 #53
0
        /// <summary>
        /// Cra nuevos labels en el sistema para determinados productos, al imprimir o al recibir pro app o device.
        /// </summary>
        /// <param name="logisticUnit"></param>
        /// <param name="data">Document Line con los datos de los labels a crear</param>
        /// <param name="node"></param>
        /// <param name="destLocation"></param>
        /// <param name="logisticFactor"></param>
        /// <param name="printingLot"></param>
        /// <returns></returns>
        public IList<Label> CreateProductLabels(Unit logisticUnit, DocumentLine data, Node node, Bin destLocation,
            double logisticFactor, string printingLot, string comment, DateTime receivingDate)
        {

            //Label Type
            DocumentType labelType = Factory.DaoDocumentType().Select(new DocumentType { DocTypeID = LabelType.ProductLabel }).First();

            //Status
            Status status = Factory.DaoStatus().Select(new Status { StatusID = EntityStatus.Active }).First();

            bool isTransactional = Factory.IsTransactional;

            if (!isTransactional)
                Factory.IsTransactional = true;


            //Funcion para obtener siguiente Label
            //DocumentTypeSequence initSequence = GetNextDocSequence(data.Document.Company, labelType);
            //long numSeqLabel = initSequence.NumSequence - 1;

            IList<Label> labelResult = new List<Label>();


            Label fatherLabel = null;
            string notes = (data.Document != null && data.Document.DocID > 0) ? "Doc# " + data.Document.DocNumber : "";
            notes = notes + " " + data.Unit.Name;

            //double labelBalance = data.Quantity;
            int numLabels =(int)(data.Quantity/logisticFactor);

            if (numLabels <= 0)
                throw new Exception("No valid amount of labels to print.");


            for (int i = 0; i < numLabels; i++)
            {
                    fatherLabel = new Label();
                    fatherLabel.Node = node;
                    fatherLabel.Bin = destLocation;
                    fatherLabel.Product = data.Product;
                    fatherLabel.CreatedBy = data.CreatedBy;
                    fatherLabel.Status = status;
                    fatherLabel.LabelType = labelType;
                    fatherLabel.CreationDate = DateTime.Now;
                    fatherLabel.Printed = false; //string.IsNullOrEmpty(printingLot) ? false : true;


                    if (data.Product.IsUniqueTrack)
                    {
                        fatherLabel.Unit = data.Product.BaseUnit; //La unidad que tiene ese Label //logisticUnit; 
                        fatherLabel.StartQty = logisticFactor * data.Unit.BaseAmount; //*data.Unit.BaseAmount;
                        fatherLabel.CurrQty = logisticFactor * data.Unit.BaseAmount; //*data.Unit.BaseAmount;
                    }
                    else
                    {
                        fatherLabel.Unit = data.Unit; //La unidad que tiene ese Label //logisticUnit; 
                        fatherLabel.StartQty = logisticFactor; //*data.Unit.BaseAmount;
                        fatherLabel.CurrQty = logisticFactor; //*data.Unit.BaseAmount; 
                    }


                    //fatherLabel.UnitBaseFactor = logisticUnit.BaseAmount;  //Siempres es 1
                    fatherLabel.IsLogistic = false;
                    fatherLabel.FatherLabel = null;
                    fatherLabel.LabelCode = ""; // (numSeqLabel + i).ToString() + GetRandomHex(data.CreatedBy, numSeqLabel + i); // (initSequence.NumSequence + i).ToString();
                    
 
                    fatherLabel.Notes = notes;
                    fatherLabel.PrintingLot = printingLot; //data.Note;
                    fatherLabel.ReceivingDate = receivingDate == null ? DateTime.Now : receivingDate;
                    fatherLabel.ReceivingDocument = data.Document.DocID > 0 ? data.Document : null;

                    fatherLabel = Factory.DaoLabel().Save(fatherLabel);

                    fatherLabel.LabelCode = fatherLabel.LabelID.ToString(); //Added for indentityUSE
                    labelResult.Add(fatherLabel);

                    //Registra el movimiento del nodo

                    SaveNodeTrace(
                        new NodeTrace
                        {
                            Node = node,
                            Document = data.Document.DocID > 0 ? data.Document : null,
                            Label = fatherLabel,
                            Quantity = fatherLabel.CurrQty,
                            IsDebit = false,
                            CreatedBy = data.CreatedBy,
                            Comment = comment
                        }
                    );

            }

            //Ajustando la sequencia
            //initSequence.NumSequence += numLabels;

            //Factory.DaoDocumentTypeSequence().Update(initSequence);

            if (!isTransactional)
                Factory.Commit();

            return labelResult;
        }
예제 #54
0
 private void GetIp(PlayerInfo pInfo) => Bin.Add("IP", Ip = pInfo.CI != null ? pInfo.CI.ip : pInfo.PCP != null ? pInfo.PCP.Ip : string.Empty);
예제 #55
0
        public string GetAssignedProducts(Bin bin)
        {

            string result = "";

            if (bin == null)
                return result;

            IList<ZoneBinRelation> zoneList = Factory.DaoZoneBinRelation().Select(new ZoneBinRelation { Bin = bin });


            if (zoneList == null || zoneList.Count == 0)
                return result;

            IList<ZoneEntityRelation> zer = null;

            foreach (ZoneBinRelation ze in zoneList)
            {
                zer = Factory.DaoZoneEntityRelation().Select(
                    new ZoneEntityRelation
                    {
                        Zone = ze.Zone,
                        Entity = new ClassEntity { ClassEntityID = EntityID.Product }
                    });

                if (zer == null || zer.Count == 0)
                    continue;

                foreach (ZoneEntityRelation r in zer)
                {
                    try { result += Factory.DaoProduct().SelectById(new Product { ProductID = r.EntityRowID }).ProductCode + ", "; }
                    catch { }
                }
            }
            return result;

        }
예제 #56
0
 private void GetEntityId(PlayerInfo pInfo) => Bin.Add("EntityId", EntityId = pInfo.EP != null ? pInfo.EP.entityId : pInfo.PDF.id);
예제 #57
0
파일: Rules.cs 프로젝트: erwin-hamid/LogPro
        internal Boolean ValidateRestrictedProductInBin(Product product, Bin destBin, bool autoThrow)
        {
            if (product.IsBinRestricted != true)
                return true;

            //Allow if dest is a Special Bin
            if (destBin.IsArea == true)
                return true;

            //Validate product is restricted.
            IList<ZoneEntityRelation> list = Factory.DaoZoneEntityRelation().Select(
                new ZoneEntityRelation
                {
                    Entity = new ClassEntity { ClassEntityID = EntityID.Product },
                    EntityRowID = product.ProductID
                });

            if (list == null || list.Count == 0)
                return true;

            //Validate is dest in one of the allowed Bins
            foreach (ZoneEntityRelation zer in list)
                if (zer.Zone.Bins != null && zer.Zone.Bins.Any(f => f.Bin.BinID == destBin.BinID))
                    return true;


            if (autoThrow)
            {
                Factory.Rollback();
                throw new Exception("Product " + product.FullDesc + " is not allowed in bin " + destBin.BinCode);
            }
            else
                return false;
        }
예제 #58
0
 private void GetName(PlayerInfo pInfo) => Bin.Add("Name", Name = pInfo.CI != null ? pInfo.CI.playerName : pInfo.PCP != null ? pInfo.PCP.Name : string.Empty);
예제 #59
0
        private void ProcessReceivingProduct(Bin destLocation, int numberOfPackages)
        {
            //Lote de Session Actual - Manejado para imprimir los ultimos labels
            if (string.IsNullOrEmpty(PrintSessionLot))
                PrintSessionLot = "PR" + DateTime.Now.ToString("yyMMddHHmmss");

            //Define Document, Product, Unit and Qty to send to receiving transaction
            DocumentLine receivingLine = new DocumentLine
            {
                Document = View.Model.Document,
                Product = (Product)View.TxtProduct.Product, //View.ComboProduct.SelectedItem,
                Unit = (Unit)View.ComboUnit.SelectedItem,
                Quantity = numberOfPackages * double.Parse(View.TxtQtyPerPack.Text),
                QtyPending = (double.Parse(View.TxtQtyPerPack.Text) > 0) ? double.Parse(View.TxtQtyPerPack.Text) : 1,
                QtyAllocated = numberOfPackages,
                CreatedBy = App.curUser.UserName,
                Note = PrintSessionLot
            };


            Unit logisticUnit = View.Model.PackUnit;
            if (logisticUnit == null && int.Parse(View.TxtQtyPerPack.Text) > 1)
            {
                try { logisticUnit = service.GetUnit(new Unit { Company = App.curCompany, Name = WmsSetupValues.CustomUnit }).First(); }
                catch
                {
                    Util.ShowError(Util.GetResourceLanguage("UNIT_CUSTOM_NOT_DEFINED"));
                    return;
                }
                logisticUnit.BaseAmount = double.Parse(View.TxtQtyPerPack.Text);
            }
            

            service.ReceiveProduct(receivingLine, logisticUnit, destLocation, View.Model.Node);


            //If Update product info at receiving is enabled - Update Product
            if (Util.GetConfigOption("ALLUPPRO").Equals("T"))
            {
                View.Model.Product.ModifiedBy = App.curUser.UserName;
                View.Model.Product.ModDate = DateTime.Now;
                service.UpdateProduct(View.Model.Product);
            }


            //Refresh el Balance
            RefreshBalance(receivingLine.Document);

            //After Process
            AfterReceiving();


            View.ProcessResult.Text = Util.GetResourceLanguage("PRODUCT_RECEIVED");
            //Util.ShowMessage(View.ProcessResult.Text);
            if (showNextTime)
            {
                pw.Close();
                showNextTime = UtilWindow.ConfirmResult(View.ProcessResult.Text);
            }

        }
예제 #60
0
 private void GetDurMode(MultiBuffClass buff) => Bin.Add("DurMode", DurMode = buff.DurationMode.ToString());