Example #1
0
        public RondasLector(XmlTextReader reader, Rondas ronda)
        {
            this.close  = false;
            this.reader = reader;
            reader.MoveToContent();
            reader.WhitespaceHandling = WhitespaceHandling.None;
            //Asignar la ronda al lector
            this.current        = ronda;
            this.current.Lector = this;
            this.usuario        = ronda.Usuario;
            //Mover el lector al paso deonde quedó suspendida la ronda
            bool encontrado = false;

            if (ronda.Current != null)
            {
                Object currentNode = ronda.Current;
                if (currentNode is Steps)
                {
                    encontrado = this.GoToStep(((Steps)currentNode).Orden.ToString());
                }
                else
                {
                    encontrado = this.GoToStep(((Work)currentNode).Step.Orden.ToString());
                }
            }
            if (!encontrado)
            {
                this.Close();
            }
        }
Example #2
0
        public static void deleteSuspend(object MessageID)
        {
            Rondas rondas = getSuspendRound(MessageID);

            if (rondas != null)
            {
                rondas.Lector.Close();
                suspendRounds.Remove(MessageID);
                //Actualizar el archivo de la cache
                SaveSuspends();
            }
        }
Example #3
0
        // Methods
        public Steps(Rondas round, string[] row)
        {
            this.id            = null;
            this.type          = null;
            this.referencia    = null;
            this.orden         = 0;
            this.states        = null;
            this.selectedValue = -1;
            this.works         = new ArrayList();
            this.fecha         = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            this.round         = round;
            this.id            = row[0];
            this.type          = row[1];
            this.referencia    = row[2];
            this.orden         = Convert.ToInt32(row[3]);
            char[] chArray1 = new char[1] {
                ','
            };
            this.states        = row[4].Trim().Split(chArray1);
            this.alias         = row[5].Trim();
            this.valid_states  = row[6].Trim().Split(chArray1);
            this.selectedValue = (row[7].ToString().Length == 0) ? -1 : Convert.ToInt32(row[5].ToString());
            this.fecha         = row[8].ToString();
            this.direccion     = row[9] == null ? "" : row[9].ToString();
            if (this.fecha != null && this.fecha.Length == 0)
            {
                Rondas ronda = round;
                this.fecha = DateTime.ParseExact(ronda.Fecha + " " + ronda.Hora, "dd/MM/yyyy HH:mm:ss", null).ToString("yyyy-MM-dd HH:mm:ss");
            }
            commentary = row[10];

            if (commentary != null && commentary.Equals("nothing"))
            {
                commentary = "";
            }

            string oldValue = row[11];

            if (oldValue != null)
            {
                for (int i = 0; i < states.Length; i++)
                {
                    if (oldValue.Equals(states[i]))
                    {
                        this.selectedValue = i;
                        break;
                    }
                }
            }
            isfather = row[12] == null || row[12].Equals("0");
            change   = false;
        }
Example #4
0
 public static void addSuspendRound(Rondas ronda)
 {
     if (suspendRounds == null)
     {
         suspendRounds = new Hashtable();
     }
     if (!suspendRounds.ContainsKey(ronda.MessageID))
     {
         suspendRounds.Add(ronda.MessageID, ronda);
         //Actualizar el archivo de la cache
         SaveSuspends();
     }
 }
Example #5
0
        // Methods
        public Work(Steps step, string[] row)
        {
            this.workname    = null;
            this.actividad   = null;
            this.orden       = 0;
            this.nombre      = null;
            this.id          = null;
            this.tipo        = null;
            this.step        = null;
            this.values      = null;
            this.valor       = "";
            this.descripcion = "";
            this.obligatorio = false;
            this.fecha       = "";
            this.oldValue1   = "";
            this.oldValue2   = "";
            this.workname    = row[0];
            this.actividad   = row[1];
            this.orden       = Convert.ToInt32(row[2]);
            this.nombre      = row[3];
            this.id          = row[4];
            this.tipo        = row[5];
            this.step        = step;
            this.causa       = "";
            char[] chArray1 = new char[1] {
                ','
            };
            if (row[6].Equals("@"))
            {
                this.values = new string[0] {
                };
            }
            else
            {
                this.values = row[6].Trim().Split(chArray1);
            }
            this.obligatorio = row[9].Equals("SI");
            this.descripcion = row[8];
            this.valor       = row[7];
            this.fecha       = row[10];
            this.oldValue1   = row[11];
            this.oldValue2   = row[12];
            this.um          = row[14];
            string _states = row[15];

            if (_states != null)
            {
                _states = _states.Trim();
                if (_states.IndexOf(',') == -1)
                {
                    this.states = new string[] { _states };
                }
                else
                {
                    this.states = _states.Trim().Split(chArray1);
                }
            }
            if (this.fecha.Length == 0)
            {
                Rondas ronda = step.Round;
                this.fecha = DateTime.ParseExact(ronda.Fecha + " " + ronda.Hora, "dd/MM/yyyy HH:mm:ss", null).ToString("yyyy-MM-dd HH:mm:ss");
            }
            chArray1 = new char[1] {
                '@'
            };
            string[] actions = row[13].Split(chArray1);
            for (int i = 0; i < actions.Length; i++)
            {
                actions[i] = actions[i].Replace(',', '\n');
            }
            this.actions = actions;

            chArray1[0]      = ',';
            this.ncrChars    = row[16] != null ? row[16].Split(chArray1) : null;
            this.incChars    = row[17] != null ? row[17].Split(chArray1) : null;
            this.Description = row[18];
        }