Exemple #1
0
        public void alteraLinhas(int quant)
        {
            if (quant == 0)
            {
                quant = 1;
            }

            int result = quant - quantidade;

            if (result > 0)
            {
                for (int x = 0; x < result; x++)
                {
                    Linha l = new Linha();
                    l.nome = string.Format("Linha produtiva {0}", x + quantidade + 1);
                    l.id   = x + quantidade;
                    Linhas.Add(l);
                }
            }
            if (result < 0)
            {
                for (int x = Linhas.Count - 1; x >= quant; x--)
                {
                    Linhas.RemoveAt(x);
                }
            }
            quantidade = Linhas.Count;
        }
 public object this[int linha, int coluna]
 {
     get
     {
         if (!_dados.ContainsKey(linha))
         {
             return(null);
         }
         if (!_dados[linha].ContainsKey(coluna))
         {
             return(null);
         }
         return(_dados[linha][coluna]);
     }
     set
     {
         if (!_dados.ContainsKey(linha))
         {
             if (!Linhas.Exists(x => x == linha))
             {
                 Linhas.Add(linha);
             }
             _dados.Add(linha, new Dictionary <int, object>());
         }
         _dados[linha][coluna] = value;
     }
 }
Exemple #3
0
 public void AdicionarLinha(List <string> linha)
 {
     if (linha.Count != Colunas.Count)
     {
         throw new ArgumentException(nameof(linha));
     }
     Linhas.Add(linha);
 }
Exemple #4
0
 public OEE(int _linhas)
 {
     for (int x = 0; x < _linhas; x++)
     {
         Linha l = new Linha();
         l.nome = string.Format("Linha produtiva {0}", x + 1);
         l.id   = x;
         Linhas.Add(l);
     }
     quantidade = _linhas;
 }
        /// <summary>
        /// Adicionar um objeto do tipo RegistroBaseSped no atributo "Linhas".
        /// Caso existe alguma falha na geração, adiciona a falha no atributo "Erros"
        /// </summary>
        protected void EscreverLinha(RegistroBaseSped registro)
        {
            string erro;
            string texto = registro.EscreverCampos(out erro, null, true);

            if (!string.IsNullOrEmpty(erro))
            {
                Erros.Add(erro);
            }

            Linhas.Add(texto);
        }
        private void AddLinha()
        {
            if (!Validate("ALL"))
            {
                return;
            }

            Linhas.Add(
                new ClasseTeste()
            {
                Id    = Codigo,
                Valor = Valor
            });
            ToJson();
        }
        private void CriaLinhasMatriz()
        {
            for (int i = 1; i <= 9; i++)
            {
                var linha = new SDLinhaModel()
                {
                    NumeroSequencial = i
                };

                for (int j = 1; j <= 9; j++)
                {
                    var celula = new SDCelulaModel()
                    {
                        PosicaoLinha = i, PosicaoColuna = j
                    };
                    linha.Celulas.Add(celula);
                }

                Linhas.Add(linha);
            }
        }