Exemplo n.º 1
0
        /// <summary>
        /// Verify if O.S informations in List<>WaitList are done already
        /// </summary>
        public static void CheckList()
        {
            LogWriteLine("-------------------Executing unfinished O.S vector-------------------");
            Conection.DeskOpen();
            MySqlCommand sqlcommand = new MySqlCommand("", Conection.DeskConection);

            //This method is basically the same thing than the SatisfactionSenderSeeker(). the only difference is that this method already have the os number.
            for (int i = 0; i < WaitList.Count; i++)
            {
                sqlcommand.CommandText = "SELECT stc_os1 FROM v11_mafra.OpOrdensServicoCabecalhos where cod_os1 = " + WaitList[i].Cod;
                try
                {
                    int getstate = Convert.ToInt32(sqlcommand.ExecuteScalar());
                    if (getstate == 83)
                    {
                        InformationOS aux = WaitList[i];
                        WaitList.Remove(WaitList[i]);
                        GreenSignal(aux, i);
                        System.Threading.Thread.Sleep(1000);
                    }
                }
                catch (Exception e)
                {
                    LogWriteLine("CODE 168 FAIL TO GET THE STATE OF O.S " + WaitList[i].Cod + " ERROR: " + e.Message);
                }
            }
            sqlcommand.Cancel();
            Conection.DeskConection.Close();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Execute when a storaged O.S information are now, finished
        /// </summary>
        /// <param name="info"></param>
        private static void GreenSignal(InformationOS info, int indexToRemove)
        {
            Customer custotemp = new Customer(info.Clientcode);
            Employee emptemp   = new Employee(info.Codfun);

            if (GreenSignalBody(custotemp, emptemp))
            {
                WaitList.RemoveAt(indexToRemove);
            }
        }