Exemple #1
0
        public async Task <EndRoll> instanciaEndRoll(InputData inputData, Genealogy g)
        {
            EndRoll e = new EndRoll();

            e.endDate           = DateTime.Now.Ticks;
            e.productionOrderId = inputData.productionOrderId;
            e.startDate         = _context.EndRoll.Where(x => x.productionOrderId == g.orderId).Max(p => (long?)p.endDate);
            if (e.startDate == null)
            {
                e.startDate = g.startDate;
            }
            e.quantity = inputData.quantity.ToString();
            return(e);
        }
Exemple #2
0
        public async Task <string> addEndRoll(InputData inputData)
        {
            try{
                List <Genealogy> gs = await getByOp(inputData.productionOrderId.ToString());

                Console.WriteLine("Passou pela instancia de g");
                Genealogy g; bool v = false;
                //Verifica se existe genealogy cadastrada na base de dados !
                if (gs.Count <= 0)
                {
                    v = true;
                    g = await instanciaG(inputData);

                    Console.WriteLine("Add");
                }
                else
                {
                    Console.WriteLine("Update");
                    g = gs[0];
                }
                EndRoll e = await instanciaEndRoll(inputData, g);

                List <ProductTraceability> productsInput = await geraListas((int)g.orderId);

                List <ProductTraceability> productsInputLiga = productsInput.Where(c => c.productType == "liga").ToList();
                List <ProductTraceability> productsInputRolo = productsInput.Where(c => c.productType == "aco").ToList();
                productsInputLiga = await getProducts(e.startDate, e.endDate, productsInputLiga);

                productsInputRolo = await getProducts(e.startDate, e.endDate, productsInputRolo);

                var(listaRolo, listaLiga) = await criaListas(productsInputLiga, productsInputRolo);

                e.ligas     = listaLiga; e.inputRolls = listaRolo;
                e.startDate = e.startDate == null ? g.startDate : e.startDate;
                e.tools     = await getTools((long)e.startDate, e.endDate); g.outputRolls.Add(e);
                if (v)
                {
                    _context.Genealogy.Add(g);
                }
                else
                {
                    _context.Genealogy.Update(g);
                }
                _context.SaveChanges();
                sendRollPLC(g.orderId);
                return("true");
            }catch (ArgumentException e) {
                return(e.Message + "\n " + e.ParamName);
            }
        }
Exemple #3
0
 // Update is called once per frame
 void Update()
 {
     if (isResultEnd && !isEntered && Input.GetKeyDown(KeyCode.Return))
     {
         EndRoll endRoll = GameObject.Find("EndrollManager").GetComponent <EndRoll>();
         endRoll.pushEnter = GameObject.Find("PushEnter");
         endRoll.isStart   = true;
         isEntered         = true;
         pushEnter.SetActive(false);
     }
     if (!audioSource.isPlaying && isResultEnd)
     {
         audioSource.PlayOneShot(bgm);
     }
     //resultTimeText.text = timerText.text;
 }