Пример #1
0
 private void cbb_id_process_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbb_id_process.SelectedIndex != -1)
     {
         TransactionProcess processSelecionado = _listaNovaProcessos.Find(x => x.SEQ_FLOW == cbb_seq_flow.SelectedItem.ToString());
         if (processSelecionado != null)
         {
             processSelecionado.ID_PROCESS = cbb_id_process.SelectedItem.ToString();
         }
         //_listaNovaProcessos[_listaNovaProcessos.FindIndex(x => x == processSelecionado)].ID_PROCESS = cbb_id_process.SelectedItem.ToString();
     }
 }
Пример #2
0
        private void btnRemoveSeqFlow_Click(object sender, EventArgs e)
        {
            if (cbb_SEQ_FLOW.Items.Count > 1)
            {
                EntradaSaida seqFlowSelecionado = _entradas.Find(x => x.SEQ_FLOW == cbb_SEQ_FLOW.SelectedItem.ToString());

                if (seqFlowSelecionado.ID_PROCESS != "")
                {
                    TransactionProcess processSelecionado = _processos.Find(x => x.SEQ_FLOW == seqFlowSelecionado.SEQ_FLOW);
                    _processos.Remove(processSelecionado);
                }

                _entradas.Remove(seqFlowSelecionado);

                cbb_SEQ_FLOW.Items.Remove(seqFlowSelecionado.SEQ_FLOW);
                cbb_SEQ_FLOW.SelectedIndex = cbb_SEQ_FLOW.Items.Count - 1;

                CarregaEntradas();
            }
        }
Пример #3
0
        private void cbb_ID_PROCESS_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbb_ID_PROCESS.SelectedIndex != -1)
            {
                EntradaSaida       seqFlowSelecionado = _entradas.Find(x => x.SEQ_FLOW == cbb_SEQ_FLOW.SelectedItem.ToString());
                TransactionProcess processSelecionado = _processos.Find(x => x.SEQ_FLOW == seqFlowSelecionado.SEQ_FLOW);

                if (processSelecionado != null)
                {
                    if (cbb_ID_PROCESS.SelectedIndex == 0)
                    {
                        seqFlowSelecionado.ID_PROCESS = "";

                        if (processSelecionado != null)
                        {
                            _processos.Remove(processSelecionado);
                        }
                    }
                    else
                    {
                        processSelecionado.ID_PROCESS = cbb_ID_PROCESS.SelectedItem.ToString();
                        processSelecionado.SEQ_FLOW   = cbb_SEQ_FLOW.SelectedItem.ToString();
                    }
                }
                else
                {
                    if (cbb_ID_PROCESS.SelectedIndex != 0 && seqFlowSelecionado != null)
                    {
                        seqFlowSelecionado.ID_PROCESS = cbb_ID_PROCESS.SelectedItem.ToString();

                        TransactionProcess tprocess = new TransactionProcess();

                        tprocess.ID_PROCESS = cbb_ID_PROCESS.SelectedItem.ToString();
                        tprocess.SEQ_FLOW   = cbb_SEQ_FLOW.SelectedItem.ToString();

                        _processos.Add(tprocess);
                    }
                }
                //if (cbb_ID_PROCESS.SelectedIndex == 0)
                //{
                //    if(cbb_SEQ_FLOW.SelectedIndex > 0 && _processos.Count > cbb_SEQ_FLOW.SelectedIndex)
                //    {
                //        _processos.RemoveAt(cbb_SEQ_FLOW.SelectedIndex);

                //        foreach(EntradaSaida es in _listaSelecionada)
                //        {
                //            es.ID_PROCESS = "";
                //        }
                //    }
                //}
                //else
                //{
                //    if (cbb_SEQ_FLOW.SelectedIndex >= _processos.Count)
                //    {
                //        TransactionProcess tprocess = new TransactionProcess();

                //        tprocess.ID_PROCESS = cbb_ID_PROCESS.SelectedItem.ToString();
                //        tprocess.SEQ_FLOW = cbb_SEQ_FLOW.SelectedItem.ToString();

                //        _processos.Add(tprocess);

                //        foreach(EntradaSaida es in _listaSelecionada)
                //        {
                //            es.ID_PROCESS = tprocess.ID_PROCESS;
                //        }
                //    }
                //    else
                //    {
                //        _processos[cbb_SEQ_FLOW.SelectedIndex].ID_PROCESS = cbb_ID_PROCESS.SelectedItem.ToString();
                //    }
                //}
            }
        }