public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                for (int t = 0; t < lst.Count; ++t)
                {
                    DadosEmpresa de = new DadosEmpresa(lst[t] as DataPortable);

                    string [] full_row = new string [] { de.get_st_empresa(), de.get_st_fantasia() };

                    i_Form.LstEmpresas.Items.Add(var_util.GetListViewItem(de.get_st_empresa(), full_row));
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (i_Form.LstEmpresas.SelectedItems.Count > 0)
                {
                    var_empresa  = i_Form.LstEmpresas.SelectedItems[0].SubItems[0].Text;
                    var_fantasia = i_Form.LstEmpresas.SelectedItems[0].SubItems[1].Text;

                    i_Form.Close();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtLoja.AcquireTextBox(i_Form.TxtLoja, this, event_val_TxtLoja, 6);
                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);
                ctrl_TxtFantasia.AcquireTextBox(i_Form.TxtFantasia, this, event_val_TxtFantasia, 40, alphaTextController.ENABLE_NUMBERS);
                ctrl_TxtTaxa.AcquireTextBox(i_Form.TxtTaxa, this, event_val_TxtTaxa, 4, 2);
                ctrl_TxtRepasse.AcquireTextBox(i_Form.TxtRepasse, this, event_val_TxtRepasse, 3);

                ctrl_TxtEmpresa.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtRepasse.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                ctrl_TxtBanco.AcquireTextBox(i_Form.TxtBanco, this, event_val_TxtBanco, 3);
                ctrl_TxtAg.AcquireTextBox(i_Form.TxtAg, this, event_val_TxtAg, 5, alphaTextController.ENABLE_NUMBERS);
                ctrl_TxtConta.AcquireTextBox(i_Form.TxtConta, this, event_val_TxtBanco, 11);

                ctrl_TxtBanco.SetTextBoxText("0");
                ctrl_TxtAg.SetTextBoxText("0");
                ctrl_TxtConta.SetTextBoxText("0");
                ctrl_TxtRepasse.SetTextBoxText("0");

                ctrl_TxtTaxa.IsUserValidated = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtEmpresa.Text.Length > 0)
                    {
                        if (i_Form.TxtEmpresa.Text.Length < 6)
                        {
                            i_Form.TxtEmpresa.BackColor     = colorInvalid;
                            ctrl_TxtEmpresa.IsUserValidated = false;
                        }
                        else
                        {
                            i_Form.TxtEmpresa.BackColor = Color.White;
                        }

                        ctrl_TxtEmpresa.IsUserValidated = true;
                        ctrl_TxtEmpresa.CleanError();

                        if (ctrl_TxtEmpresa.GetEnterPressed())
                        {
                            string st_nome    = "";
                            string st_empresa = ctrl_TxtEmpresa.getTextBoxValue().PadLeft(6, '0');

                            if (var_exchange.fetch_validaEmpresa(st_empresa,
                                                                 ref header,
                                                                 ref st_nome))
                            {
                                ctrl_TxtEmpresa.SetTextBoxText(st_empresa);
                                ctrl_TxtFantasia.SetTextBoxText(st_nome);

                                i_Form.TxtFantasia.BackColor     = Color.White;
                                i_Form.TxtEmpresa.BackColor      = Color.White;
                                ctrl_TxtFantasia.IsUserValidated = true;
                                ctrl_TxtEmpresa.IsUserValidated  = true;
                            }
                            else
                            {
                                i_Form.TxtEmpresa.BackColor      = colorInvalid;
                                i_Form.TxtFantasia.BackColor     = colorInvalid;
                                ctrl_TxtFantasia.IsUserValidated = false;
                                ctrl_TxtEmpresa.IsUserValidated  = false;
                            }
                        }
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;

                        if (ctrl_TxtEmpresa.GetEnterPressed())
                        {
                            event_dlgConsultaLoja ev_call = new event_dlgConsultaLoja(var_util, var_exchange);

                            ev_call.header = header;

                            ev_call.i_Form.ShowDialog();
                        }
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtFantasia -

            case event_val_TxtFantasia:
            {
                //InitEventCode event_val_TxtFantasia

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtFantasia.getTextBoxValue().Length > 3)
                    {
                        ctrl_TxtFantasia.CleanError();

                        if (ctrl_TxtFantasia.GetEnterPressed())
                        {
                            ArrayList lst = new ArrayList();

                            if (var_exchange.fetch_nomeEmpresa(ctrl_TxtFantasia.getTextBoxValue(),
                                                               ref header,
                                                               ref lst))
                            {
                                event_dlgSelecionaEmpresa ev_call = new event_dlgSelecionaEmpresa(var_util, var_exchange);

                                ev_call.header = header;
                                ev_call.lst    = lst;

                                ev_call.i_Form.ShowDialog();

                                if (ev_call.var_empresa != "" && ev_call.var_fantasia != "")
                                {
                                    ctrl_TxtEmpresa.SetTextBoxText(ev_call.var_empresa);
                                    ctrl_TxtFantasia.SetTextBoxText(ev_call.var_fantasia);

                                    i_Form.TxtFantasia.BackColor     = Color.White;
                                    i_Form.TxtEmpresa.BackColor      = Color.White;
                                    ctrl_TxtFantasia.IsUserValidated = true;
                                    ctrl_TxtEmpresa.IsUserValidated  = true;
                                }
                                else
                                {
                                    ctrl_TxtEmpresa.SetTextBoxText("");
                                    ctrl_TxtFantasia.SetTextBoxText("");

                                    i_Form.TxtEmpresa.BackColor      = colorInvalid;
                                    i_Form.TxtFantasia.BackColor     = colorInvalid;
                                    ctrl_TxtFantasia.IsUserValidated = false;
                                    ctrl_TxtEmpresa.IsUserValidated  = false;
                                }
                            }
                        }
                    }
                    else
                    {
                        i_Form.TxtFantasia.BackColor     = colorInvalid;
                        ctrl_TxtFantasia.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Adicionar -

            case event_Adicionar:
            {
                //InitEventCode event_Adicionar

                bool IsDone = true;

                if (!ctrl_TxtEmpresa.IsUserValidated)
                {
                    ctrl_TxtEmpresa.SetErrorMessage("O código da empresa deve ser informado");   IsDone = false;
                }
                if (!ctrl_TxtRepasse.IsUserValidated)
                {
                    ctrl_TxtRepasse.SetErrorMessage("O número de dias para repasse deve ser informado"); IsDone = false;
                }

                if (!IsDone)
                {
                    return(false);
                }

                int max = i_Form.LstConvenios.Items.Count;

                for (int t = 0; t < max; ++t)
                {
                    if (i_Form.LstConvenios.Items[t].SubItems[0].Text == ctrl_TxtEmpresa.getTextBoxValue())
                    {
                        i_Form.LstConvenios.Items[t].SubItems [2].Text = ctrl_TxtTaxa.getTextBoxValue().PadLeft(4, '0').Insert(2, ",") + " %";
                        i_Form.LstConvenios.Items[t].SubItems [3].Text = ctrl_TxtRepasse.getTextBoxValue();
                        i_Form.LstConvenios.Items[t].SubItems [4].Text = i_Form.TxtBanco.Text;
                        i_Form.LstConvenios.Items[t].SubItems [5].Text = i_Form.TxtAg.Text;
                        i_Form.LstConvenios.Items[t].SubItems [6].Text = i_Form.TxtConta.Text;
                        return(false);
                    }
                }

                string [] full_row = new string [] { ctrl_TxtEmpresa.getTextBoxValue(),
                          ctrl_TxtFantasia.getTextBoxValue(),
                          ctrl_TxtTaxa.getTextBoxValue().PadLeft(4, '0').Insert(2, ",") + " %",
                                                     ctrl_TxtRepasse.getTextBoxValue(),
                                                     ctrl_TxtBanco.getTextBoxValue(),
                                                     ctrl_TxtAg.getTextBoxValue(),
                                                     ctrl_TxtConta.getTextBoxValue() };

                string emp = ctrl_TxtEmpresa.getTextBoxValue();

                i_Form.LstConvenios.Items.Add(var_util.GetListViewItem(emp, full_row));

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Remover -

            case event_Remover:
            {
                //InitEventCode event_Remover

                if (i_Form.LstConvenios.SelectedItems.Count > 0)
                {
                    string emp = i_Form.LstConvenios.SelectedItems[0].Text;

                    i_Form.LstConvenios.Items.Remove(i_Form.LstConvenios.SelectedItems[0]);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                int max = i_Form.LstConvenios.Items.Count;

                string st_csv_empresas     = "";
                string st_csv_taxas        = "";
                string st_csv_dias_repasse = "";

                string st_csv_banco_repasse = "";
                string st_csv_ag_repasse    = "";
                string st_csv_conta_repasse = "";

                for (int t = 0; t < max; ++t)
                {
                    string emp = i_Form.LstConvenios.Items[t].SubItems[0].Text;

                    st_csv_empresas     += emp;
                    st_csv_taxas        += i_Form.LstConvenios.Items[t].SubItems[2].Text.Replace(",", "").Replace(" %", "");
                    st_csv_dias_repasse += i_Form.LstConvenios.Items[t].SubItems[3].Text;

                    st_csv_banco_repasse += i_Form.LstConvenios.Items[t].SubItems[4].Text;
                    st_csv_ag_repasse    += i_Form.LstConvenios.Items[t].SubItems[5].Text;
                    st_csv_conta_repasse += i_Form.LstConvenios.Items[t].SubItems[6].Text;

                    if (t < max - 1)
                    {
                        st_csv_empresas      += ",";
                        st_csv_taxas         += ",";
                        st_csv_dias_repasse  += ",";
                        st_csv_banco_repasse += ",";
                        st_csv_ag_repasse    += ",";
                        st_csv_conta_repasse += ",";
                    }
                }

                DadosLoja dl = new DadosLoja();

                dl.set_nu_CNPJ(cnpj);

                var_exchange.exec_alteraLoja(st_csv_empresas,
                                             st_csv_taxas,
                                             st_csv_dias_repasse,
                                             st_csv_banco_repasse,
                                             st_csv_ag_repasse,
                                             st_csv_conta_repasse,
                                             ref dl,
                                             ref header);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtTaxa -

            case event_val_TxtTaxa:
            {
                //InitEventCode event_val_TxtTaxa
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtRepasse -

            case event_val_TxtRepasse:
            {
                //InitEventCode event_val_TxtRepasse

                if (i_Form.TxtRepasse.Text.Length == 0)
                {
                    i_Form.TxtRepasse.BackColor     = colorInvalid;
                    ctrl_TxtRepasse.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtRepasse.BackColor     = Color.White;
                    ctrl_TxtRepasse.IsUserValidated = true;
                    ctrl_TxtRepasse.CleanError();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJ -

            case event_val_TxtCNPJ:
            {
                //InitEventCode event_val_TxtCNPJ
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Convenio -

            case event_Convenio:
            {
                //InitEventCode event_Convenio

                if (i_Form.LstConvenios.SelectedItems.Count == 0)
                {
                    return(false);
                }

                int index = i_Form.LstConvenios.SelectedIndices[0];

                string emp   = i_Form.LstConvenios.Items [index].SubItems[0].Text;
                string ft    = i_Form.LstConvenios.Items [index].SubItems[1].Text;
                string tx    = i_Form.LstConvenios.Items [index].SubItems[2].Text;
                string rp    = i_Form.LstConvenios.Items [index].SubItems[3].Text;
                string banco = i_Form.LstConvenios.Items [index].SubItems[4].Text;
                string ag    = i_Form.LstConvenios.Items [index].SubItems[5].Text;
                string conta = i_Form.LstConvenios.Items [index].SubItems[6].Text;

                ctrl_TxtEmpresa.SetTextBoxText(emp);      i_Form.TxtEmpresa.BackColor  = Color.White;
                ctrl_TxtFantasia.SetTextBoxText(ft);      i_Form.TxtFantasia.BackColor = Color.White;
                ctrl_TxtTaxa.SetTextBoxText(tx);      i_Form.TxtTaxa.BackColor         = Color.White;
                ctrl_TxtRepasse.SetTextBoxText(rp);      i_Form.TxtRepasse.BackColor   = Color.White;

                ctrl_TxtBanco.SetTextBoxText(banco.PadLeft(1, '0'));
                ctrl_TxtAg.SetTextBoxText(ag.PadLeft(1, '0'));
                ctrl_TxtConta.SetTextBoxText(conta.PadLeft(1, '0'));

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtBanco -

            case event_val_TxtBanco:
            {
                //InitEventCode event_val_TxtBanco

                if (i_Form.TxtBanco.Text.Length == 0)
                {
                    i_Form.TxtBanco.BackColor     = colorInvalid;
                    ctrl_TxtBanco.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtBanco.BackColor     = Color.White;
                    ctrl_TxtBanco.IsUserValidated = true;
                    ctrl_TxtBanco.CleanError();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtAg -

            case event_val_TxtAg:
            {
                //InitEventCode event_val_TxtAg

                if (ctrl_TxtAg.getTextBoxValue().Length == 0)
                {
                    i_Form.TxtAg.BackColor     = colorInvalid;
                    ctrl_TxtAg.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtAg.BackColor     = Color.White;
                    ctrl_TxtAg.IsUserValidated = true;
                    ctrl_TxtAg.CleanError();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtConta -

            case event_val_TxtConta:
            {
                //InitEventCode event_val_TxtConta

                if (ctrl_TxtConta.getTextBoxValue_Long() == 0)
                {
                    i_Form.TxtConta.BackColor     = colorInvalid;
                    ctrl_TxtConta.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtConta.BackColor     = Color.White;
                    ctrl_TxtConta.IsUserValidated = true;
                    ctrl_TxtConta.CleanError();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLoja -

            case event_val_TxtLoja:
            {
                //InitEventCode event_val_TxtLoja

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtLoja.Text.Length > 0)
                    {
                        i_Form.TxtLoja.BackColor     = Color.White;
                        ctrl_TxtLoja.IsUserValidated = true;
                        ctrl_TxtLoja.CleanError();

                        if (ctrl_TxtLoja.GetEnterPressed())
                        {
                            ArrayList list = new ArrayList();

                            var_exchange.fetch_listaConveniosLoja(ctrl_TxtLoja.getTextBoxValue(),
                                                                  ref header,
                                                                  ref cnpj,
                                                                  ref list);

                            i_Form.LstConvenios.Items.Clear();

                            for (int t = 0; t < list.Count; ++t)
                            {
                                DadosEmpresa de = new DadosEmpresa(list[t] as DataPortable);

                                string emp = de.get_st_empresa();

                                string [] full_row = new string [] { emp,
                                                                     de.get_st_fantasia(),
                                                                     de.get_tx_convenio().PadLeft(4, '0').Insert(2, ",") + " %",
                                                                     de.get_nu_dias_convenio(),
                                                                     de.get_st_banco(),
                                                                     de.get_st_ag(),
                                                                     de.get_st_conta() };

                                i_Form.LstConvenios.Items.Add(var_util.GetListViewItem(emp, full_row));
                            }
                        }
                    }
                    else
                    {
                        i_Form.TxtLoja.BackColor     = colorInvalid;
                        ctrl_TxtLoja.IsUserValidated = false;
                    }
                    break;
                }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstConveniosClick -

            case event_LstConveniosClick:
            {
                //InitEventCode event_LstConveniosClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoverClick -

            case event_BtnRemoverClick:
            {
                //InitEventCode event_BtnRemoverClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAdicionarClick -

            case event_BtnAdicionarClick:
            {
                //InitEventCode event_BtnAdicionarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtCodigo.AcquireTextBox(i_Form.TxtCodigo, this, event_val_TxtCodigo, 6);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCodigo -

            case event_val_TxtCodigo:
            {
                //InitEventCode event_val_TxtCodigo

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtCodigo.Text.Length > 0)
                    {
                        i_Form.TxtCodigo.BackColor     = Color.White;
                        ctrl_TxtCodigo.IsUserValidated = true;
                        ctrl_TxtCodigo.CleanError();

                        if (ctrl_TxtCodigo.GetEnterPressed())
                        {
                            doEvent(event_buscaDados, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtCodigo.BackColor     = colorInvalid;
                        ctrl_TxtCodigo.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Cancelar -

            case event_Cancelar:
            {
                //InitEventCode event_Cancelar

                var_exchange.exec_cancelaDespesa(var_util.getSelectedListViewItemTag(i_Form.LstDespesas),
                                                 ref header);

                doEvent(event_buscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_buscaDados -

            case event_buscaDados:
            {
                //InitEventCode event_buscaDados

                if (i_Form.CboTipo.SelectedIndex != -1)
                {
                    ArrayList list = new ArrayList();

                    string nome   = "";
                    string tg_emp = Context.FALSE;

                    if (i_Form.CboTipo.SelectedIndex == 0)
                    {
                        tg_emp = Context.TRUE;
                    }

                    var_exchange.fetch_dadosDespesas(tg_emp,
                                                     ctrl_TxtCodigo.getTextBoxValue(),
                                                     ref header,
                                                     ref nome,
                                                     ref list);

                    i_Form.TxtNome.Text = nome;

                    i_Form.LstDespesas.Items.Clear();

                    for (int t = 0; t < list.Count; ++t)
                    {
                        DadosDespesas dd = new DadosDespesas(list [t] as DataPortable);

                        string [] full_row = new string [] { dd.get_st_info(),
                                                             new money().formatToMoney(dd.get_vr_cobrança()) };

                        i_Form.LstDespesas.Items.Add(var_util.GetListViewItem(dd.get_fk_faturadet(), full_row));
                    }

                    Application.DoEvents();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnCancelarClick -

            case event_BtnCancelarClick:
            {
                //InitEventCode event_BtnCancelarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtTelefone.AcquireTextBox(i_Form.TxtTelefone, this, event_val_TxtTelefone, 10);

                ctrl_TxtCartao.AcquireTextBox(i_Form.TxtCartao, this, event_val_TxtCartao, 14);
                ctrl_TxtCodLoja.AcquireTextBox(i_Form.TxtCodLoja, this, event_val_TxtCodLoja, 8);
                ctrl_TxtNSU.AcquireTextBox(i_Form.TxtNSU, this, event_val_TxtNSU, 6);
                ctrl_TxtCodEmpresa.AcquireTextBox(i_Form.TxtCodEmpresa, this, event_val_TxtCNPJEmpresa, 12);
                ctrl_TxtCNPJLoja.AcquireTextBox(i_Form.TxtCNPJLoja, this, event_val_TxtCNPJLoja);
                ctrl_TxtTerminal.AcquireTextBox(i_Form.TxtTerminal, this, event_val_TxtTerminal, 8);
                ctrl_TxtValor.AcquireTextBox(i_Form.TxtValor, this, event_val_TxtValor, "R$", 9);
                ctrl_TxtParcelas.AcquireTextBox(i_Form.TxtParcelas, this, event_val_TxtParcelas, 2);

                ctrl_TxtDataIni.AcquireTextBox(i_Form.TxtDataIni, this, event_val_TxtDataIni, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDataFim.AcquireTextBox(i_Form.TxtDataFim, this, event_val_TxtDataFim, dateTextController.FORMAT_DDMMYYYY);

                ctrl_TxtDataIni.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Year.ToString().PadLeft(2, '0'));

                ctrl_TxtDataFim.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Year.ToString().PadLeft(2, '0'));

                i_Form.CboOper.Items.Clear();
                i_Form.CboOper.Items.Add("(Todas)");
                i_Form.CboOper.Items.AddRange(new OperacaoCartaoDesc().GetArray().ToArray());

                i_Form.CboOper.SelectedIndex = 0;

                if (header.get_tg_user_type() == TipoUsuario.Administrador)
                {
                    i_Form.TxtCodEmpresa.Text     = header.get_st_empresa();
                    i_Form.TxtCodEmpresa.ReadOnly = true;
                }

                i_Form.CboStat.Items.Clear();
                i_Form.CboStat.Items.Add("(Todos)");
                i_Form.CboStat.Items.AddRange(new TipoConfirmacaoDesc().GetArray().ToArray());

                i_Form.CboStat.SelectedIndex = 0;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNSU -

            case event_val_TxtNSU:
            {
                //InitEventCode event_val_TxtNSU

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtNSU.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtNSU.BackColor     = Color.White;
                        ctrl_TxtNSU.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtNSU.BackColor     = colorInvalid;
                        ctrl_TxtNSU.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJEmpresa -

            case event_val_TxtCNPJEmpresa:
            {
                //InitEventCode event_val_TxtCNPJEmpresa
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJLoja -

            case event_val_TxtCNPJLoja:
            {
                //InitEventCode event_val_TxtCNPJLoja

                switch (arg as string)
                {
                case cnpjTextController.CNPJ_INCOMPLETE:
                case cnpjTextController.CNPJ_INVALID:
                {
                    i_Form.TxtCNPJLoja.BackColor     = colorInvalid;
                    ctrl_TxtCNPJLoja.IsUserValidated = false;
                    break;
                }

                case cnpjTextController.CNPJ_VALID:
                {
                    i_Form.TxtCNPJLoja.BackColor     = Color.White;
                    ctrl_TxtCNPJLoja.IsUserValidated = true;
                    ctrl_TxtCNPJLoja.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtTerminal -

            case event_val_TxtTerminal:
            {
                //InitEventCode event_val_TxtTerminal

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtTerminal.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtTerminal.BackColor     = Color.White;
                        ctrl_TxtTerminal.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtTerminal.BackColor     = colorInvalid;
                        ctrl_TxtTerminal.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtValor -

            case event_val_TxtValor:
            {
                //InitEventCode event_val_TxtValor

                if (arg as string == moneyTextController.MONEY_ZERO)
                {
                    i_Form.TxtValor.BackColor     = colorInvalid;
                    ctrl_TxtValor.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtValor.BackColor     = Color.White;
                    ctrl_TxtValor.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtParcelas -

            case event_val_TxtParcelas:
            {
                //InitEventCode event_val_TxtParcelas

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtParcelas.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtParcelas.BackColor     = Color.White;
                        ctrl_TxtParcelas.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtParcelas.BackColor     = colorInvalid;
                        ctrl_TxtParcelas.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                i_Form.BtnConsultar.Enabled = false;

                DadosConsultaTransacao dct = new DadosConsultaTransacao();

                dct.set_st_nsu(ctrl_TxtNSU.getTextBoxValue());
                dct.set_st_cod_empresa(ctrl_TxtCodEmpresa.getTextBoxValue());
                dct.set_st_cnpj_loja(ctrl_TxtCNPJLoja.getTextBoxValue());
                dct.set_st_cod_loja(ctrl_TxtCodLoja.getTextBoxValue());
                dct.set_st_terminal(ctrl_TxtTerminal.getTextBoxValue());
                dct.set_tg_status((i_Form.CboStat.SelectedIndex - 1).ToString());

                if (ctrl_TxtTelefone.IsUserValidated)
                {
                    dct.set_st_telefone(ctrl_TxtTelefone.getTextBoxValue());
                }

                if (ctrl_TxtCartao.IsUserValidated)
                {
                    dct.set_st_cartao(ctrl_TxtCartao.getTextBoxValue());
                }

                if (ctrl_TxtDataIni.IsUserValidated)
                {
                    dct.set_dt_ini(var_util.GetDataBaseTimeFormat(ctrl_TxtDataIni.getTextBoxValue_Date()));
                }

                if (ctrl_TxtDataFim.IsUserValidated)
                {
                    dct.set_dt_fim(var_util.GetDataBaseTimeFormat(ctrl_TxtDataFim.getTextBoxValue_Date().AddHours(23).AddMinutes(59).AddSeconds(59)));
                }

                if (ctrl_TxtValor.IsUserValidated)
                {
                    dct.set_vr_valor(ctrl_TxtValor.getTextBoxValue_NumberStr());
                }

                if (ctrl_TxtParcelas.IsUserValidated)
                {
                    dct.set_nu_parcelas(ctrl_TxtParcelas.getTextBoxValue());
                }

                if (i_Form.CboOper.SelectedIndex > 0)
                {
                    dct.set_en_oper((i_Form.CboOper.SelectedIndex - 1).ToString());
                }

                string st_csv_id = "";

                i_Form.LstTrans.Items.Clear();
                Application.DoEvents();

                ArrayList desc        = new OperacaoCartaoDesc().GetArray();
                ArrayList desc_status = new TipoConfirmacaoDesc().GetArray();

                i_Form.Cursor = Cursors.WaitCursor;

                if (var_exchange.fetch_consultaTransacao(ref dct,
                                                         ref header,
                                                         ref st_csv_id))
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_id != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_id, "400", ref st_csv_id, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosConsultaTransacao dt = new DadosConsultaTransacao(full_memory[t] as DataPortable);

                        try
                        {
                            int index = Convert.ToInt32(dt.get_en_oper());

                            string [] full_row = new string [] { dt.get_st_nsu().PadLeft(6, '0'),
                                                                 dt.get_st_cartao(),
                                                                 dt.get_st_cnpj_loja(),
                                                                 dt.get_st_terminal().PadLeft(8, '0'),
                                                                 "R$ " + new money().formatToMoney(dt.get_vr_valor()),
                                                                 dt.get_nu_parcelas(),
                                                                 dt.get_dt_transacao(),
                                                                 desc [index].ToString(),
                                                                 desc_status [Convert.ToInt32(dt.get_tg_status())].ToString(),
                                                                 dt.get_st_msg_erro() };

                            i_Form.LstTrans.Items.Add(var_util.GetListViewItem(dt.get_st_nsu(), full_row));
                        }
                        catch (System.Exception ex)
                        {
                            ex.ToString();
                            MessageBox.Show(dt.get_st_nsu() + " - " + dt.get_st_cnpj_loja());
                        }
                    }

                    Application.DoEvents();
                }

                i_Form.BtnConsultar.Enabled = true;

                i_Form.Cursor = Cursors.Default;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDataIni -

            case event_val_TxtDataIni:
            {
                //InitEventCode event_val_TxtDataIni

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDataIni.BackColor     = colorInvalid;
                    ctrl_TxtDataIni.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDataIni.BackColor     = Color.White;
                    ctrl_TxtDataIni.IsUserValidated = true;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDataFim -

            case event_val_TxtDataFim:
            {
                //InitEventCode event_val_TxtDataFim

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDataFim.BackColor     = colorInvalid;
                    ctrl_TxtDataFim.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDataFim.BackColor     = Color.White;
                    ctrl_TxtDataFim.IsUserValidated = true;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCartao -

            case event_val_TxtCartao:
            {
                //InitEventCode event_val_TxtCartao

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtCartao.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCartao.BackColor     = Color.White;
                        ctrl_TxtCartao.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCartao.BackColor     = colorInvalid;
                        ctrl_TxtCartao.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtTelefone -

            case event_val_TxtTelefone:
            {
                //InitEventCode event_val_TxtTelefone

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtTelefone.Text.Length == 10)
                    {
                        i_Form.TxtTelefone.BackColor     = Color.White;
                        ctrl_TxtTelefone.IsUserValidated = true;
                        ctrl_TxtTelefone.CleanError();
                    }
                    else
                    {
                        i_Form.TxtTelefone.BackColor     = colorInvalid;
                        ctrl_TxtTelefone.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCodEmpresa -

            case event_val_TxtCodEmpresa:
            {
                //InitEventCode event_val_TxtCodEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtCodEmpresa.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCodEmpresa.BackColor     = Color.White;
                        ctrl_TxtCodEmpresa.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCodEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtCodEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCodLoja -

            case event_val_TxtCodLoja:
            {
                //InitEventCode event_val_TxtCodLoja

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtCodLoja.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCodLoja.BackColor     = Color.White;
                        ctrl_TxtCodLoja.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCodLoja.BackColor     = colorInvalid;
                        ctrl_TxtCodLoja.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConsultarClick -

            case event_BtnConsultarClick:
            {
                //InitEventCode event_BtnConsultarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening
                ctrl_TxtDt_Ini.AcquireTextBox(i_Form.TxtDt_Ini, this, event_val_TxtDt_Ini, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDt_Fim.AcquireTextBox(i_Form.TxtDt_Fim, this, event_val_TxtDt_Fim, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDt_Ini.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtDt_Fim.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                doEvent(event_BuscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDt_Ini -

            case event_val_TxtDt_Ini:
            {
                //InitEventCode event_val_TxtDt_Ini

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDt_Ini.BackColor     = Color.Lavender;;
                    ctrl_TxtDt_Ini.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDt_Ini.BackColor     = Color.White;
                    ctrl_TxtDt_Ini.IsUserValidated = true;
                    ctrl_TxtDt_Ini.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDt_Fim -

            case event_val_TxtDt_Fim:
            {
                //InitEventCode event_val_TxtDt_Fim

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDt_Fim.BackColor     = Color.Lavender;;
                    ctrl_TxtDt_Fim.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDt_Fim.BackColor     = Color.White;
                    ctrl_TxtDt_Fim.IsUserValidated = true;
                    ctrl_TxtDt_Fim.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaDados -

            case event_BuscaDados:
            {
                //InitEventCode event_BuscaDados

                i_Form.LstMsg.Items.Clear();
                var_util.clearPortable();

                string st_csv_content = "";

                if (!var_exchange.fetch_edu_messages(ref header,
                                                     ref st_csv_content))
                {
                    return(false);
                }

                ArrayList full_memory = new ArrayList();

                while (st_csv_content != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_csv_content, "1000",
                                                  ref st_csv_content,
                                                  ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t] as DataPortable);
                        }
                    }
                }

                for (int t = 0; t < full_memory.Count; ++t)
                {
                    DadosEduMessage dem = new DadosEduMessage(full_memory[t] as DataPortable);

                    string time = var_util.getDDMMYYYY_format(dem.get_dt_start()).Replace(" 00:00:00", "") + " - " +
                                  var_util.getDDMMYYYY_format(dem.get_dt_end()).Replace(" 23:59:59", "");

                    string [] full_row = new string [] { dem.get_st_msg(), time };

                    var_util.savePortable(dem.get_id_mem(), dem);

                    i_Form.LstMsg.Items.Add(var_util.GetListViewItem(dem.get_id_mem(), full_row));
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstMsgDoubleClick -

            case event_LstMsgDoubleClick:
            {
                //InitEventCode event_LstMsgDoubleClick

                id = var_util.getSelectedListViewItemTag(i_Form.LstMsg);

                DadosEduMessage dem = new DadosEduMessage(var_util.retrievePortable(id) as DataPortable);

                i_Form.txtMsg.Text = dem.get_st_msg();

                DateTime tim = Convert.ToDateTime(dem.get_dt_start());

                ctrl_TxtDt_Ini.SetTextBoxText(tim.Day.ToString().PadLeft(2, '0') +
                                              tim.Month.ToString().PadLeft(2, '0') +
                                              tim.Year.ToString());

                DateTime tim2 = Convert.ToDateTime(dem.get_dt_end());

                ctrl_TxtDt_Fim.SetTextBoxText(tim2.Day.ToString().PadLeft(2, '0') +
                                              tim2.Month.ToString().PadLeft(2, '0') +
                                              tim2.Year.ToString());

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnNovoClick -

            case event_BtnNovoClick:
            {
                //InitEventCode event_BtnNovoClick

                dlgAutorizacao autor = new dlgAutorizacao();

                autor.ShowDialog();

                Application.DoEvents();

                if (autor.IsConfirmed)
                {
                    DadosEduMessage dem = new DadosEduMessage();

                    dem.set_dt_start(var_util.GetDataBaseTimeFormat(ctrl_TxtDt_Ini.getTextBoxValue_Date()));
                    dem.set_dt_end(var_util.GetDataBaseTimeFormat(ctrl_TxtDt_Fim.getTextBoxValue_Date().AddHours(23).AddMinutes(59).AddSeconds(59)));
                    dem.set_st_msg(i_Form.txtMsg.Text);

                    var_exchange.ins_edu_msg(ref dem, ref header);

                    doEvent(event_BuscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAtualizarClick -

            case event_BtnAtualizarClick:
            {
                //InitEventCode event_BtnAtualizarClick

                dlgAutorizacao autor = new dlgAutorizacao();

                autor.ShowDialog();

                Application.DoEvents();

                if (autor.IsConfirmed)
                {
                    DadosEduMessage dem = new DadosEduMessage();

                    dem.set_dt_start(var_util.GetDataBaseTimeFormat(ctrl_TxtDt_Ini.getTextBoxValue_Date()));
                    dem.set_dt_end(var_util.GetDataBaseTimeFormat(ctrl_TxtDt_Fim.getTextBoxValue_Date().AddHours(23).AddMinutes(59).AddSeconds(59)));
                    dem.set_st_msg(i_Form.txtMsg.Text);
                    dem.set_id_mem(id);

                    var_exchange.exec_change_edu_msg(ref dem, ref header);

                    doEvent(event_BuscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoverClick -

            case event_BtnRemoverClick:
            {
                //InitEventCode event_BtnRemoverClick

                if (MessageBox.Show("Remover mensagem?",
                                    "Aviso",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question,
                                    MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return(false);
                }

                string       tag = var_util.getSelectedListViewItemTag(i_Form.LstMsg);
                DataPortable tmp = var_util.retrievePortable(tag);

                id = "";

                DadosEduMessage dem = new DadosEduMessage(tmp);

                var_exchange.del_edu_msg(dem.get_id_mem(), ref header);

                doEvent(event_BuscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening
                ctrl_TxtNu_Empresa.AcquireTextBox(i_Form.TxtNu_Empresa, this, event_val_TxtNu_Empresa, 6);
                ctrl_TxtMoney_Vlr.AcquireTextBox(i_Form.TxtMoney_Vlr, this, event_val_TxtMoney_Vlr, "R$", 8);
                ctrl_TxtNu_Empresa.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtMoney_Vlr.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                if (header.get_tg_user_type() == TipoUsuario.Administrador)
                {
                    ctrl_TxtNu_Empresa.SetTextBoxText(header.get_st_empresa());
                    i_Form.TxtNu_Empresa.ReadOnly = true;

                    doEvent(event_buscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNu_Empresa -

            case event_val_TxtNu_Empresa:
            {
                //InitEventCode event_val_TxtNu_Empresa
                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtNu_Empresa.Text.Length > 0)
                    {
                        i_Form.TxtNu_Empresa.BackColor     = Color.White;
                        ctrl_TxtNu_Empresa.IsUserValidated = true;
                        ctrl_TxtNu_Empresa.CleanError();

                        if (ctrl_TxtNu_Empresa.GetEnterPressed())
                        {
                            doEvent(event_buscaDados, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtNu_Empresa.BackColor     = Color.Lavender;
                        ctrl_TxtNu_Empresa.IsUserValidated = false;
                        ctrl_TxtNu_Empresa.CleanError();
                    }

                    break;
                }

                default: break;
                }
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtMoney_Vlr -

            case event_val_TxtMoney_Vlr:
            {
                //InitEventCode event_val_TxtMoney_Vlr
                string myValEv = arg as string;

                if (myValEv == moneyTextController.MONEY_ZERO)
                {
                    i_Form.TxtMoney_Vlr.BackColor     = Color.Lavender;
                    ctrl_TxtMoney_Vlr.IsUserValidated = false;
                    ctrl_TxtMoney_Vlr.CleanError();
                }
                else
                {
                    i_Form.TxtMoney_Vlr.BackColor     = Color.White;
                    ctrl_TxtMoney_Vlr.IsUserValidated = true;
                    ctrl_TxtMoney_Vlr.CleanError();
                }
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAplicClick -

            case event_BtnAplicClick:
            {
                //InitEventCode event_BtnAplicClick

                for (int t = 0; t < i_Form.LstCart.Items.Count; ++t)
                {
                    i_Form.LstCart.Items[t].SubItems[2].Text = "SIM";
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoveClick -

            case event_BtnRemoveClick:
            {
                //InitEventCode event_BtnRemoveClick

                if (i_Form.LstCart.SelectedItems.Count == 0)
                {
                    return(false);
                }

                i_Form.LstCart.Items[i_Form.LstCart.SelectedIndices[0]].SubItems[2].Text = "NAO";

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfClick -

            case event_BtnConfClick:
            {
                //InitEventCode event_BtnConfClick

                string csv_block = "";

                for (int t = 0; t < i_Form.LstCart.Items.Count; ++t)
                {
                    if (i_Form.LstCart.Items[t].SubItems[2].Text == "NAO")
                    {
                        csv_block += i_Form.LstCart.Items[t].SubItems[0].Text;
                    }
                }

                var_exchange.exec_cotaExtraEmpresa(ctrl_TxtNu_Empresa.getTextBoxValue(), ctrl_TxtMoney_Vlr.getTextBoxValue_NumberStr(), csv_block, ref header);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_buscaDados -

            case event_buscaDados:
            {
                //InitEventCode event_buscaDados

                string st_csv_block = "";

                var_exchange.fetch_cotaExtra_carts(ctrl_TxtNu_Empresa.getTextBoxValue(), ref header, ref st_csv_block);

                ArrayList full_memory = new ArrayList();

                while (st_csv_block != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_csv_block, "400", ref st_csv_block, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                i_Form.LstCart.Items.Clear();

                if (i_Form.ChkAlfa.Checked)
                {
                    ArrayList lst_sort = new ArrayList();
                    Hashtable hsh_sort = new Hashtable();

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosCartao dc = new DadosCartao(full_memory[t] as DataPortable);

                        lst_sort.Add(dc.get_st_proprietario());
                        hsh_sort [dc.get_st_proprietario()] = dc;
                    }

                    lst_sort.Sort();

                    for (int t = 0; t < lst_sort.Count; ++t)
                    {
                        DadosCartao dc = hsh_sort [lst_sort[t]] as DadosCartao;

                        string [] full_row = new string [] { dc.get_st_matricula(),
                                  dc.get_st_proprietario(),
                                                             "NÃO" };

                        i_Form.LstCart.Items.Add(var_util.GetListViewItem(dc.get_st_cpf(), full_row));
                    }
                }
                else
                {
                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosCartao dc = new DadosCartao(full_memory[t] as DataPortable);

                        string [] full_row = new string [] { dc.get_st_matricula(),
                                  dc.get_st_proprietario(),
                                                             "NÃO" };

                        i_Form.LstCart.Items.Add(var_util.GetListViewItem(dc.get_st_cpf(), full_row));
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_ChkAlfaCheckedChanged -

            case event_ChkAlfaCheckedChanged:
            {
                //InitEventCode event_ChkAlfaCheckedChanged

                doEvent(event_buscaDados, null);



                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtValor.AcquireTextBox(i_Form.TxtValor, this, event_val_TxtValor, "R$", 8);
                ctrl_TxtNome.AcquireTextBox(i_Form.TxtNome, this, event_val_TxtNome, 40, alphaTextController.ENABLE_NUMBERS, alphaTextController.ENABLE_SYMBOLS);

                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);

                if (header.get_tg_user_type() == TipoUsuario.AdminGift)
                {
                    ctrl_TxtEmpresa.SetTextBoxText(header.get_st_empresa());
                    i_Form.TxtEmpresa.ReadOnly = true;

                    doEvent(event_BuscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaDados -

            case event_BuscaDados:
            {
                //InitEventCode event_BuscaDados

                ArrayList lst = new ArrayList();

                if (header.get_tg_user_type() == TipoUsuario.SuperUser)
                {
                    header.set_st_empresa(ctrl_TxtEmpresa.getTextBoxValue());
                }

                var_exchange.fetch_extraGift(ref header, ref lst);

                if (header.get_tg_user_type() == TipoUsuario.SuperUser)
                {
                    header.set_st_empresa("000000");
                }

                i_Form.LstProd.Items.Clear();
                for (int t = 0; t < lst.Count; ++t)
                {
                    DadosProdutoGift dpg = new DadosProdutoGift(lst[t] as DataPortable);

                    string [] full_row = new string [] { dpg.get_st_nome(), "R$ " + new money().formatToMoney(dpg.get_vr_valor()) };

                    i_Form.LstProd.Items.Add(var_util.GetListViewItem(dpg.get_id_produto(), full_row));
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Remover -

            case event_Remover:
            {
                //InitEventCode event_Remover

                if (i_Form.LstProd.SelectedItems.Count == 0)
                {
                    return(false);
                }

                if (MessageBox.Show("Confirma remoção de produto ?",
                                    "Aviso",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question,
                                    MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return(false);
                }

                var_exchange.del_extraGift(var_util.getSelectedListViewItemTag(i_Form.LstProd), ref header);

                doEvent(event_BuscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Adicionar -

            case event_Adicionar:
            {
                //InitEventCode event_Adicionar

                if (!ctrl_TxtValor.IsUserValidated && !ctrl_TxtNome.IsUserValidated)
                {
                    return(false);
                }

                DadosProdutoGift prod = new DadosProdutoGift();

                prod.set_st_nome(ctrl_TxtNome.getTextBoxValue());
                prod.set_vr_valor(ctrl_TxtValor.getTextBoxValue_NumberStr());

                var_exchange.ins_extraGift(ref prod, ref header);

                doEvent(event_BuscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNome -

            case event_val_TxtNome:
            {
                //InitEventCode event_val_TxtNome

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtNome.getTextBoxValue().Length > 3)
                    {
                        i_Form.TxtNome.BackColor     = Color.White;
                        ctrl_TxtNome.IsUserValidated = true;
                        ctrl_TxtNome.CleanError();
                    }
                    else
                    {
                        i_Form.TxtNome.BackColor     = colorInvalid;
                        ctrl_TxtNome.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtValor -

            case event_val_TxtValor:
            {
                //InitEventCode event_val_TxtValor

                if (ctrl_TxtValor.getTextBoxValue_Long() == 0)
                {
                    i_Form.TxtValor.BackColor     = colorInvalid;
                    ctrl_TxtValor.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtValor.BackColor     = Color.White;
                    ctrl_TxtValor.IsUserValidated = true;
                    ctrl_TxtValor.CleanError();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Selecionar -

            case event_Selecionar:
            {
                //InitEventCode event_Selecionar

                if (i_Form.LstProd.SelectedItems.Count == 0)
                {
                    return(false);
                }

                ctrl_TxtNome.SetTextBoxText(i_Form.LstProd.SelectedItems[0].SubItems[0].Text);
                ctrl_TxtValor.SetTextBoxLong(new money().getNumericValue(i_Form.LstProd.SelectedItems[0].SubItems[1].Text.Replace("R$ ", "")));

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtEmpresa.Text.Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                        ctrl_TxtEmpresa.CleanError();

                        if (ctrl_TxtEmpresa.GetEnterPressed())
                        {
                            doEvent(event_BuscaDados, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstProdClick -

            case event_LstProdClick:
            {
                //InitEventCode event_LstProdClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoverClick -

            case event_BtnRemoverClick:
            {
                //InitEventCode event_BtnRemoverClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAdicionarClick -

            case event_BtnAdicionarClick:
            {
                //InitEventCode event_BtnAdicionarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #8
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);
                ctrl_TxtMatricula.AcquireTextBox(i_Form.TxtMatricula, this, event_val_TxtMatricula, 6);

                if (header.get_tg_user_type() == TipoUsuario.VendedorGift ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift ||
                    header.get_tg_user_type() == TipoUsuario.Operador ||
                    header.get_tg_user_type() == TipoUsuario.Administrador)
                {
                    ctrl_TxtEmpresa.SetTextBoxText(header.get_st_empresa());
                    i_Form.TxtEmpresa.ReadOnly = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtEmpresa.Text.Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                        ctrl_TxtEmpresa.CleanError();

                        if (ctrl_TxtEmpresa.GetEnterPressed())
                        {
                            doEvent(event_val_TxtCartao, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtMatricula -

            case event_val_TxtMatricula:
            {
                //InitEventCode event_val_TxtMatricula

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtMatricula.Text.Length > 0)
                    {
                        i_Form.TxtMatricula.BackColor     = Color.White;
                        ctrl_TxtMatricula.IsUserValidated = true;
                        ctrl_TxtMatricula.CleanError();

                        if (ctrl_TxtMatricula.GetEnterPressed())
                        {
                            doEvent(event_val_TxtCartao, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtMatricula.BackColor     = colorInvalid;
                        ctrl_TxtMatricula.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCartao -

            case event_val_TxtCartao:
            {
                //InitEventCode event_val_TxtCartao

                if (!ctrl_TxtEmpresa.IsUserValidated &&
                    !ctrl_TxtMatricula.IsUserValidated)
                {
                    return(false);
                }

                ArrayList lstCred    = new ArrayList();
                ArrayList lstProd    = new ArrayList();
                ArrayList lstComprov = new ArrayList();

                string nome = "";
                string disp = "";
                string sit  = "";

                if (!var_exchange.fetch_consultaCartaoGift(ctrl_TxtEmpresa.getTextBoxValue(),
                                                           ctrl_TxtMatricula.getTextBoxValue(),
                                                           ref header,
                                                           ref nome,
                                                           ref disp,
                                                           ref sit,
                                                           ref lstCred,
                                                           ref lstProd,
                                                           ref lstComprov))
                {
                    return(false);
                }

                i_Form.TxtNome.Text  = nome;
                i_Form.TxtSaldo.Text = new money().formatToMoney(disp);
                i_Form.TxtSit.Text   = sit;

                i_Form.LstCred.Items.Clear();
                i_Form.LstProd.Items.Clear();

                for (int t = 0; t < lstCred.Count; ++t)
                {
                    DadosConsultaGift dcg = new DadosConsultaGift(lstCred[t] as DataPortable);

                    string [] full_row = new string [] { dcg.get_st_nome(),
                                                         "R$ " + new money().formatToMoney(dcg.get_vr_valor()),
                                                         var_util.getDDMMYYYY_format(dcg.get_dt_data()) };

                    i_Form.LstCred.Items.Add(var_util.GetListViewItem("", full_row));
                }

                for (int t = 0; t < lstProd.Count; ++t)
                {
                    DadosConsultaGift dcg = new DadosConsultaGift(lstProd[t] as DataPortable);

                    string [] full_row = new string [] { dcg.get_st_nome(),
                                                         "R$ " + new money().formatToMoney(dcg.get_vr_valor()) };

                    i_Form.LstProd.Items.Add(var_util.GetListViewItem("", full_row));
                }

                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #9
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Adicionar -

            case event_Adicionar:
            {
                //InitEventCode event_Adicionar

                event_dlgCadastroAtividade ev_call = new event_dlgCadastroAtividade(var_util, var_exchange);

                ev_call.header = header;

                ev_call.i_Form.ShowDialog();

                if (ev_call.HouveCadastro)
                {
                    doEvent(event_buscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Remover -

            case event_Remover:
            {
                //InitEventCode event_Remover

                string fk_agenda = var_util.getSelectedListViewItemTag(i_Form.LstTrans);

                if (fk_agenda != null)
                {
                    var_exchange.del_agenda(fk_agenda, ref header);

                    doEvent(event_buscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_buscaDados -

            case event_buscaDados:
            {
                //InitEventCode event_buscaDados

                Application.DoEvents();

                string st_csv_id = "";

                i_Form.LstTrans.Items.Clear();

                ArrayList desc = new TipoAtividadeDesc().GetArray();

                if (var_exchange.fetch_agenda(ref header,
                                              ref st_csv_id))
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_id != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_id, "400", ref st_csv_id, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosAgenda da = new DadosAgenda(full_memory[t] as DataPortable);

                        int index = Convert.ToInt32(da.get_en_atividade()) - 1;

                        string [] full_row = new string [] { da.get_st_empresa() + " - " + da.get_st_nome_empresa(),
                                  desc[index].ToString(),
                                  da.get_st_info() };

                        i_Form.LstTrans.Items.Add(var_util.GetListViewItem(da.get_fk_agenda(), full_row));
                    }

                    Application.DoEvents();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAdicionarClick -

            case event_BtnAdicionarClick:
            {
                //InitEventCode event_BtnAdicionarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoverClick -

            case event_BtnRemoverClick:
            {
                //InitEventCode event_BtnRemoverClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_DlgAgendamentoShown -

            case event_DlgAgendamentoShown:
            {
                //InitEventCode event_DlgAgendamentoShown
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);
                ctrl_TxtCartao.AcquireTextBox(i_Form.TxtCartao, this, event_val_TxtCartao, 6);

                if (header.get_tg_user_type() == TipoUsuario.VendedorGift ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift ||
                    header.get_tg_user_type() == TipoUsuario.Operador ||
                    header.get_tg_user_type() == TipoUsuario.Administrador)
                {
                    ctrl_TxtEmpresa.SetTextBoxText(header.get_st_empresa());
                    i_Form.TxtEmpresa.ReadOnly = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtEmpresa.Text.Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                        ctrl_TxtEmpresa.CleanError();

                        if (ctrl_TxtEmpresa.GetEnterPressed())
                        {
                            doEvent(event_BuscaDados, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCartao -

            case event_val_TxtCartao:
            {
                //InitEventCode event_val_TxtCartao

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtCartao.Text.Length > 0)
                    {
                        i_Form.TxtCartao.BackColor     = Color.White;
                        ctrl_TxtCartao.IsUserValidated = true;
                        ctrl_TxtCartao.CleanError();

                        if (ctrl_TxtCartao.GetEnterPressed())
                        {
                            doEvent(event_BuscaDados, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtCartao.BackColor     = colorInvalid;
                        ctrl_TxtCartao.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                PrintDocument pd      = new PrintDocument();
                PrintDialog   pDialog = new PrintDialog();

                pDialog.Document = pd;

                PrintPreviewDialog prevDialog = new PrintPreviewDialog();
                prevDialog.Document = pd;

                pd.PrintPage += new PrintPageEventHandler(i_Form.Inven_Report);
                prevDialog.ShowDialog();

                if (pDialog.ShowDialog() == DialogResult.OK)
                {
                    pd.Print();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaDados -

            case event_BuscaDados:
            {
                //InitEventCode event_BuscaDados

                if (!ctrl_TxtEmpresa.IsUserValidated &&
                    !ctrl_TxtCartao.IsUserValidated)
                {
                    return(false);
                }

                ArrayList lstCred    = new ArrayList();
                ArrayList lstProd    = new ArrayList();
                ArrayList lstComprov = new ArrayList();

                string nome = "";
                string disp = "";
                string sit  = "";

                if (!var_exchange.fetch_consultaCartaoGift(ctrl_TxtEmpresa.getTextBoxValue(),
                                                           ctrl_TxtCartao.getTextBoxValue(),
                                                           ref header,
                                                           ref nome,
                                                           ref disp,
                                                           ref sit,
                                                           ref lstCred,
                                                           ref lstProd,
                                                           ref lstComprov))
                {
                    return(false);
                }

                i_Form.TxtNome.Text  = nome;
                i_Form.TxtSaldo.Text = new money().formatToMoney(disp);
                i_Form.TxtSit.Text   = sit;

                for (int t = 0; t < lstComprov.Count; ++t)
                {
                    DadosComprovGift dcg = new DadosComprovGift(lstComprov[t] as DataPortable);

                    string [] full_row = new string [] { dcg.get_dt_venda(),
                                                         "R$ " + new money().formatToMoney(dcg.get_vr_valor()),
                                                         dcg.get_st_tipo() };

                    i_Form.LstComprov.Items.Add(var_util.GetListViewItem(dcg.get_id_venda(), full_row));
                }

                if (i_Form.LstComprov.Items.Count > 0)
                {
                    i_Form.LstComprov.Items[0].Selected = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Print -

            case event_Print:
            {
                //InitEventCode event_Print

                ArrayList lst = new ArrayList();

                string id_gift = var_util.getSelectedListViewItemTag(i_Form.LstComprov);

                if (id_gift == "")
                {
                    return(false);
                }

                var_exchange.fetch_comprov_Gift(id_gift, Context.TRUE, ref header, ref lst);

                PrintPageEventArgs e = arg as PrintPageEventArgs;

                Graphics g      = e.Graphics;
                int      n      = 0;
                Font     myFont = new Font("Courier New", 10);

                try
                {
                    for (int t = 0; t < lst.Count; ++t)
                    {
                        DataPortable port = lst[t] as DataPortable;

                        g.DrawString(port.getValue("linha"), myFont, Brushes.Black, 10, 10 + (n * 20)); ++n;
                    }

                    myFont.Dispose();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message.ToString());
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtDtIni.AcquireTextBox(i_Form.TxtDtIni, this, event_val_TxtDtIni, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDtFim.AcquireTextBox(i_Form.TxtDtFim, this, event_val_TxtDtFim, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);
                ctrl_TxtCodLoja.AcquireTextBox(i_Form.TxtCodLoja, this, event_val_TxtCodLoja, 6);

                ctrl_TxtDtFim.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Year.ToString().PadLeft(2, '0'));

                ctrl_TxtDtIni.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtDtFim.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtEmpresa.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtCodLoja.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                if (header.get_tg_user_type() == TipoUsuario.Administrador ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift)
                {
                    ctrl_TxtEmpresa.SetTextBoxText(header.get_st_empresa());
                    i_Form.TxtEmpresa.ReadOnly = true;

                    i_Form.tabControl1.TabPages.RemoveAt(1);
                    i_Form.tabControl1.TabPages.RemoveAt(1);
                }

                i_Form.CboTipo.SelectedIndex  = 0;
                i_Form.CboGraph.SelectedIndex = 0;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_GeraGrafico -

            case event_GeraGrafico:
            {
                //InitEventCode event_GeraGrafico

                if (i_Form.LstLines.Items.Count == 0)
                {
                    return(false);
                }

                dlgGraph graph = new dlgGraph();

                graph.Text = "Gráficos ConveyNET para desempenho financeiro";

                GraphPane myPane = graph.zed.GraphPane;

                myPane.Title.Text = "Performance financeira comparativa de lojas";

                myPane.XAxis.Title.Text = "Período requerido";
                myPane.XAxis.Type       = AxisType.Date;
                //myPane.XAxis.Scale.Format  = "d";

                myPane.YAxis.Title.Text   = "Valores de compras nas lojas";
                myPane.YAxis.Scale.Format = "c";

                myPane.CurveList.Clear();

                ArrayList lstInput = new ArrayList();

                for (int t = 0; t < i_Form.LstLines.Items.Count; ++t)
                {
                    DadosGraficoFinanceiro dgf = new DadosGraficoFinanceiro();

                    #region - format data -

                    dgf.set_st_empresa(i_Form.LstLines.Items[t].SubItems[0].Text);

                    string dt_ini = i_Form.LstLines.Items[t].SubItems[1].Text;

                    dt_ini = dt_ini.Substring(6, 4) + "-" +
                             dt_ini.Substring(3, 2) + "-" +
                             dt_ini.Substring(0, 2);

                    string dt_fim = i_Form.LstLines.Items[t].SubItems[2].Text;

                    dt_fim = dt_fim.Substring(6, 4) + "-" +
                             dt_fim.Substring(3, 2) + "-" +
                             dt_fim.Substring(0, 2);

                    dgf.set_dt_ini(dt_ini);
                    dgf.set_dt_fim(dt_fim);

                    string loja = i_Form.LstLines.Items[t].SubItems[3].Text;

                    if (loja.StartsWith("L"))
                    {
                        dgf.set_st_loja(loja.Substring(1, loja.IndexOf(" ") - 1).Trim());
                    }

                    dgf.set_nu_id(t.ToString());

                    #endregion

                    lstInput.Add(dgf);
                }

                string st_csv_contents = "";

                if (!var_exchange.graph_financeiro(i_Form.CboTipo.SelectedIndex.ToString(),
                                                   ref header,
                                                   ref lstInput,
                                                   ref st_csv_contents))
                {
                    return(false);
                }

                ArrayList full_memory = new ArrayList();

                while (st_csv_contents != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_csv_contents, "200", ref st_csv_contents, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                Color col = Color.Green;

                for (int t = 0; t < lstInput.Count; ++t)
                {
                    PointPairList list = new PointPairList();

                    switch (t)
                    {
                    case 0: col = Color.Green;      break;

                    case 1: col = Color.Red;        break;

                    case 2: col = Color.Blue;       break;

                    case 3: col = Color.Gray;       break;

                    case 4: col = Color.Orange;     break;

                    case 5: col = Color.Violet;     break;

                    default: break;
                    }

                    string name_curve = "";
                    string my_id      = t.ToString();

                    for (int g = 0; g < full_memory.Count; ++g)
                    {
                        DadosGraficoFinanceiro dgf = new DadosGraficoFinanceiro(full_memory[g] as DataPortable);

                        if (dgf.get_nu_id() != my_id)
                        {
                            continue;
                        }

                        if (name_curve == "")
                        {
                            name_curve = dgf.get_st_loja();
                        }

                        string line = dgf.get_dt_point();

                        XDate x = new XDate(Convert.ToInt32(line.Substring(0, 4)),                              // ano
                                            Convert.ToInt32(line.Substring(5, 2)),                              // mes
                                            Convert.ToInt32(line.Substring(8, 2)),                              // dia
                                            Convert.ToInt32(line.Substring(11, 2)),                             // hora
                                            Convert.ToInt32(line.Substring(14, 2)),
                                            0, 0);                                                              // minuto

                        list.Add((double)x, Convert.ToDouble(dgf.get_vr_point()) / 100);
                    }

                    if (i_Form.CboGraph.SelectedIndex == 0)
                    {
                        myPane.AddBar(name_curve, (IPointList)list, col);
                    }
                    else
                    {
                        LineItem myCurve = myPane.AddCurve(name_curve, list, col, SymbolType.None);
                        myCurve.Line.Fill = new Fill(Color.White, Color.FromArgb(60, col.R, col.G, col.B), 90F);
                    }

                    name_curve = "";
                }

                myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45F);
                myPane.Fill       = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45F);

                graph.zed.AxisChange();

                graph.ShowDialog();

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Adicionar -

            case event_Adicionar:
            {
                //InitEventCode event_Adicionar

                if (!ctrl_TxtDtIni.IsUserValidated)
                {
                    MessageBox.Show("Informe o período inicial", "Aviso");
                    return(false);
                }

                if (!ctrl_TxtDtFim.IsUserValidated)
                {
                    MessageBox.Show("Informe o período final", "Aviso");
                    return(false);
                }

                if (!ctrl_TxtEmpresa.IsUserValidated)
                {
                    MessageBox.Show("Informe a empresa", "Aviso");
                    return(false);
                }

                if (ctrl_TxtCodLoja.IsUserValidated)
                {
                    if (i_Form.TxtNome.Text == "")
                    {
                        MessageBox.Show("Confirmar a loja pressionando enter no campo de código", "Aviso");
                        return(false);
                    }
                }

                if (i_Form.LstLines.Items.Count >= 5)
                {
                    MessageBox.Show("Máximo de cinco items para gráfico", "Aviso");
                    return(false);
                }

                string nome = "";

                if (ctrl_TxtCodLoja.IsUserValidated)
                {
                    nome = "L" + ctrl_TxtCodLoja.getTextBoxValue() + " - " + i_Form.TxtNome.Text;
                }
                else
                {
                    if (ctrl_TxtEmpresa.getTextBoxValue_Long() == 0)
                    {
                        nome = "ConveyNET";
                    }
                    else
                    {
                        nome = "Todas as lojas";
                    }
                }

                string [] full_row = new string [] { ctrl_TxtEmpresa.getTextBoxValue(),
                          ctrl_TxtDtIni.getTextBoxValue(),
                          ctrl_TxtDtFim.getTextBoxValue(),
                          nome };

                i_Form.LstLines.Items.Add(var_util.GetListViewItem(null, full_row));

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtIni -

            case event_val_TxtDtIni:
            {
                //InitEventCode event_val_TxtDtIni

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtIni.BackColor     = colorInvalid;
                    ctrl_TxtDtIni.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtIni.BackColor     = Color.White;
                    ctrl_TxtDtIni.IsUserValidated = true;
                    ctrl_TxtDtIni.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtFim -

            case event_val_TxtDtFim:
            {
                //InitEventCode event_val_TxtDtFim

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtFim.BackColor     = colorInvalid;
                    ctrl_TxtDtFim.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtFim.BackColor     = Color.White;
                    ctrl_TxtDtFim.IsUserValidated = true;
                    ctrl_TxtDtIni.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCodLoja -

            case event_val_TxtCodLoja:
            {
                //InitEventCode event_val_TxtCodLoja

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtCodLoja.Text.Length > 0)
                    {
                        i_Form.TxtCodLoja.BackColor     = Color.White;
                        ctrl_TxtCodLoja.IsUserValidated = true;
                        ctrl_TxtCodLoja.CleanError();

                        if (length_cod_loja > 0)
                        {
                            if (length_cod_loja != i_Form.TxtCodLoja.Text.Length)
                            {
                                i_Form.TxtNome.Text = "";
                            }
                        }

                        length_cod_loja = i_Form.TxtCodLoja.Text.Length;

                        if (ctrl_TxtCodLoja.GetEnterPressed())
                        {
                            DadosLoja dl = new DadosLoja();

                            var_exchange.fetch_dadosLoja("", ctrl_TxtCodLoja.getTextBoxValue(), ref header, ref dl);

                            i_Form.TxtNome.Text = dl.get_st_nome();
                        }
                    }
                    else
                    {
                        i_Form.TxtCodLoja.BackColor     = colorInvalid;
                        ctrl_TxtCodLoja.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtEmpresa.Text.Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                        ctrl_TxtEmpresa.CleanError();
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Remover -

            case event_Remover:
            {
                //InitEventCode event_Remover

                if (i_Form.LstLines.SelectedItems.Count == 0)
                {
                    return(false);
                }

                i_Form.LstLines.Items.RemoveAt(i_Form.LstLines.SelectedIndices[0]);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaListaLojasTransacao -

            case event_BuscaListaLojasTransacao:
            {
                //InitEventCode event_BuscaListaLojasTransacao

                if (!ctrl_TxtDtIni.IsUserValidated)
                {
                    MessageBox.Show("Informe a data inicial", "Aviso");
                    return(false);
                }

                if (!ctrl_TxtDtFim.IsUserValidated)
                {
                    MessageBox.Show("Informe a data final", "Aviso");
                    return(false);
                }

                i_Form.BtnBuscarLista.Enabled = false;
                i_Form.LstTransLojas.Items.Clear();

                string st_csv_contents = "";

                var_exchange.fetch_listaTransacoesLojas(var_util.GetDataBaseTimeFormat(ctrl_TxtDtIni.getTextBoxValue_Date()),
                                                        var_util.GetDataBaseTimeFormat(ctrl_TxtDtFim.getTextBoxValue_Date()),
                                                        ref header,
                                                        ref st_csv_contents);

                ArrayList full_memory = new ArrayList();

                while (st_csv_contents != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_csv_contents, "200", ref st_csv_contents, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                for (int t = 0; t < full_memory.Count; ++t)
                {
                    DadosConsultaGraficoTransLojas dl = new DadosConsultaGraficoTransLojas(full_memory[t] as DataPortable);

                    string [] full_row = new string [] { dl.get_nu_trans(),
                              dl.get_nu_cod(),
                              dl.get_tg_tipo(),
                              dl.get_st_nome() };

                    i_Form.LstTransLojas.Items.Add(var_util.GetListViewItem(null, full_row));
                }

                i_Form.BtnBuscarLista.Enabled = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_GeraGraficoTransacao -

            case event_GeraGraficoTransacao:
            {
                //InitEventCode event_GeraGraficoTransacao

                dlgGraph graph = new dlgGraph();

                graph.Text = "Gráficos ConveyNET para quantidade de transações";

                GraphPane myPane = graph.zed.GraphPane;

                myPane.Title.Text = "Performance em transações de associações e lojas";

                myPane.XAxis.Title.Text = "Período requerido";
                myPane.XAxis.Type       = AxisType.Date;

                myPane.YAxis.Title.Text = "Quantidade de transações";

                myPane.CurveList.Clear();

                ArrayList lstInput = new ArrayList();

                for (int t = 0; t < i_Form.LstTransLojas.Items.Count; ++t)
                {
                    if (i_Form.LstTransLojas.Items[t].Checked)
                    {
                        DadosConsultaGraficoTransLojas dl = new DadosConsultaGraficoTransLojas();

                        dl.set_nu_cod(i_Form.LstTransLojas.Items[t].SubItems[1].Text);
                        dl.set_tg_tipo(i_Form.LstTransLojas.Items[t].SubItems[2].Text);
                        dl.set_st_nome(i_Form.LstTransLojas.Items[t].SubItems[3].Text);

                        lstInput.Add(dl);
                    }
                }

                string st_csv_contents = "";

                if (!var_exchange.graph_transacoes(var_util.GetDataBaseTimeFormat(ctrl_TxtDtIni.getTextBoxValue_Date()),
                                                   var_util.GetDataBaseTimeFormat(ctrl_TxtDtFim.getTextBoxValue_Date()),
                                                   ref header,
                                                   ref lstInput,
                                                   ref st_csv_contents))
                {
                    return(false);
                }

                ArrayList full_memory = new ArrayList();

                while (st_csv_contents != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_csv_contents, "200", ref st_csv_contents, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                Color col = Color.Green;

                for (int t = 0; t < lstInput.Count; ++t)
                {
                    DadosConsultaGraficoTransLojas dl = new DadosConsultaGraficoTransLojas(lstInput[t] as DataPortable);

                    PointPairList list = new PointPairList();

                    switch (t)
                    {
                    case 0: col = Color.Green;      break;

                    case 1: col = Color.Red;        break;

                    case 2: col = Color.Blue;       break;

                    case 3: col = Color.Gray;       break;

                    case 4: col = Color.Orange;     break;

                    case 5: col = Color.Violet;     break;

                    default: break;
                    }

                    string name_curve = dl.get_st_nome();
                    string my_id      = t.ToString();

                    for (int g = 0; g < full_memory.Count; ++g)
                    {
                        DadosConsultaGraficoTransLojas dgt = new DadosConsultaGraficoTransLojas(full_memory[g] as DataPortable);

                        if (dgt.get_nu_id() != my_id)
                        {
                            continue;
                        }

                        string line = dgt.get_dt_trans();

                        XDate x = new XDate(Convert.ToInt32(line.Substring(0, 4)),                              // ano
                                            Convert.ToInt32(line.Substring(5, 2)),                              // mes
                                            Convert.ToInt32(line.Substring(8, 2)),                              // dia
                                            Convert.ToInt32(line.Substring(11, 2)),                             // hora
                                            Convert.ToInt32(line.Substring(14, 2)),
                                            0, 0);                                                              // minuto

                        list.Add((double)x, Convert.ToDouble(dgt.get_nu_trans()));
                    }

                    LineItem myCurve = myPane.AddCurve(name_curve, list, col, SymbolType.None);
                }

                myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45F);
                myPane.Fill       = new Fill(Color.White, Color.FromArgb(220, 220, 255), 45F);

                graph.zed.AxisChange();

                graph.ShowDialog();

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Ranking -

            case event_Ranking:
            {
                //InitEventCode event_Ranking
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoverClick -

            case event_BtnRemoverClick:
            {
                //InitEventCode event_BtnRemoverClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnGraficoClick -

            case event_BtnGraficoClick:
            {
                //InitEventCode event_BtnGraficoClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAdicionarClick -

            case event_BtnAdicionarClick:
            {
                //InitEventCode event_BtnAdicionarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnBuscarListaClick -

            case event_BtnBuscarListaClick:
            {
                //InitEventCode event_BtnBuscarListaClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnGeraTransClick -

            case event_BtnGeraTransClick:
            {
                //InitEventCode event_BtnGeraTransClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRankingClick -

            case event_BtnRankingClick:
            {
                //InitEventCode event_BtnRankingClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #12
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtDataIni.AcquireTextBox(i_Form.TxtDataIni, this, event_val_TxtDataIni, dateTextController.FORMAT_DDMMYYYY);

                ctrl_TxtDataIni.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Year.ToString().PadLeft(2, '0'));

                doEvent(event_BuscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (i_Form.LstLojas.SelectedItems.Count == 0)
                {
                    return(false);
                }

                event_dlgConfFinalRepasse ev_call = new event_dlgConfFinalRepasse(var_util, var_exchange);

                ev_call.header = header;

                ev_call.st_codLoja  = var_util.getSelectedListViewItemTag(i_Form.LstLojas);
                ev_call.st_loja     = i_Form.LstLojas.SelectedItems[0].SubItems[0].Text;
                ev_call.vr_valor    = i_Form.LstLojas.SelectedItems[0].SubItems[1].Text.Replace(",", "");
                ev_call.lstParcelas = hshLojas [ev_call.st_codLoja] as ArrayList;

                ev_call.i_Form.ShowDialog();

                doEvent(event_BuscaDados, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_DetalheCheck -

            case event_DetalheCheck:
            {
                //InitEventCode event_DetalheCheck

                if (i_Form.LstLojas.SelectedItems.Count == 0)
                {
                    return(false);
                }

                string st_loja = var_util.getSelectedListViewItemTag(i_Form.LstLojas);

                ArrayList lstDets = hshLojas [st_loja] as ArrayList;

                long tot_detalhes = 0;

                for (int t = 0; t < i_Form.LstDetalhes.Items.Count; ++t)
                {
                    DadosRepasse dr = lstDets [t] as DadosRepasse;

                    if (i_Form.LstDetalhes.Items[t].Checked)
                    {
                        tot_detalhes += Convert.ToInt64(dr.get_vr_repasse());

                        dr.set_tg_confirmado(Context.TRUE);
                    }
                    else
                    {
                        dr.set_tg_confirmado(Context.FALSE);
                    }
                }

                i_Form.LstLojas.SelectedItems[0].SubItems[1].Text = new money().formatToMoney(tot_detalhes.ToString());

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDataIni -

            case event_val_TxtDataIni:
            {
                //InitEventCode event_val_TxtDataIni

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDataIni.BackColor     = colorInvalid;
                    ctrl_TxtDataIni.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDataIni.BackColor     = Color.White;
                    ctrl_TxtDataIni.IsUserValidated = true;

                    if (ctrl_TxtDataIni.GetEnterPressed())
                    {
                        doEvent(event_BuscaDados, null);
                    }
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_SelecionaLoja -

            case event_SelecionaLoja:
            {
                //InitEventCode event_SelecionaLoja

                if (i_Form.LstLojas.SelectedItems.Count == 0)
                {
                    return(false);
                }

                string st_loja = var_util.getSelectedListViewItemTag(i_Form.LstLojas);

                ArrayList lstDets = hshLojas [st_loja] as ArrayList;

                i_Form.LstDetalhes.Items.Clear();

                for (int t = 0; t < lstDets.Count; ++t)
                {
                    DadosRepasse dr = new DadosRepasse(lstDets [t] as DataPortable);

                    DateTime tim_repasse = Convert.ToDateTime(dr.get_dt_repasse());

                    string dt_rep = var_util.getDDMMYYYY_format(dr.get_dt_repasse()).Substring(0, 10);

                    if (dt_rep == ctrl_TxtDataIni.getTextBoxValue())
                    {
                        dt_rep += " [hoje]";
                    }
                    else if (tim_repasse > ctrl_TxtDataIni.getTextBoxValue_Date())
                    {
                        dt_rep += " [futuro]";
                    }

                    string [] full_row = new string [] { new money().formatToMoney(dr.get_vr_repasse()),
                                                         dr.get_st_cartao(),
                                                         dr.get_st_nsu(),
                                                         var_util.getDDMMYYYY_format(dr.get_dt_trans()),
                                                         dt_rep };



                    if (dt_rep.IndexOf("futuro") >= 0 || dt_rep.IndexOf("hoje") >= 0)
                    {
                        i_Form.LstDetalhes.Items.Add(var_util.GetListViewItem(dr.get_st_nsu(),
                                                                              full_row,
                                                                              Color.Black,
                                                                              Color.Bisque));
                    }
                    else
                    {
                        i_Form.LstDetalhes.Items.Add(var_util.GetListViewItem(dr.get_st_nsu(),
                                                                              full_row));
                    }

                    i_Form.LstDetalhes.Items[t].Checked = false;

                    if (dr.get_tg_confirmado() == Context.TRUE)
                    {
                        i_Form.LstDetalhes.Items[t].Checked = true;
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaDados -

            case event_BuscaDados:
            {
                //InitEventCode event_BuscaDados

                string block_detalhe_loja = "";
                string block_sumario_loja = "";

                i_Form.LstLojas.Items.Clear();
                i_Form.LstDetalhes.Items.Clear();

                hshLojas.Clear();

                Application.DoEvents();

                var_exchange.fetch_repasseData(ctrl_TxtDataIni.getTextBoxValue(),
                                               ref header,
                                               ref block_detalhe_loja,
                                               ref block_sumario_loja);

                while (block_detalhe_loja != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(block_detalhe_loja, "400", ref block_detalhe_loja, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            DadosRepasse dr = new DadosRepasse(tmp_memory[t] as DataPortable);

                            string cod = dr.get_st_loja();

                            if (hshLojas [cod] == null)
                            {
                                hshLojas [cod] = new ArrayList();
                            }

                            ArrayList tmp_list = hshLojas [cod] as ArrayList;

                            string dt_rep = var_util.getDDMMYYYY_format(dr.get_dt_repasse()).Substring(0, 10);

                            DateTime tim_repasse = Convert.ToDateTime(dr.get_dt_repasse());

                            if (dt_rep == ctrl_TxtDataIni.getTextBoxValue())
                            {
                                dr.set_tg_confirmado(Context.FALSE);
                            }
                            else if (tim_repasse > ctrl_TxtDataIni.getTextBoxValue_Date())
                            {
                                dr.set_tg_confirmado(Context.FALSE);
                            }

                            tmp_list.Add(dr);
                        }
                    }
                }

                long vr_repasse = 0;

                ArrayList full_memory = new ArrayList();

                while (block_sumario_loja != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(block_sumario_loja, "200", ref block_sumario_loja, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                ArrayList sorted_memory = new ArrayList();

                for (int t = 0; t < full_memory.Count; ++t)
                {
                    DadosSumarioRepasse dsr = new DadosSumarioRepasse(full_memory[t] as DataPortable);

                    sorted_memory.Add(dsr.get_vr_valor().PadLeft(20, '0') + dsr.get_st_codLoja().PadRight(20, ' '));
                }

                sorted_memory.Sort();

                for (int g = sorted_memory.Count - 1; g >= 0; --g)
                {
                    string tag = sorted_memory[g].ToString().Substring(20, 20).Trim();

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosSumarioRepasse dsr = new DadosSumarioRepasse(full_memory[t] as DataPortable);

                        if (dsr.get_st_codLoja() == tag)
                        {
                            vr_repasse += Convert.ToInt64(dsr.get_vr_valor());

                            string [] full_row = new string [] { dsr.get_st_loja(),
                                                                 new money().formatToMoney(dsr.get_vr_valor()) };

                            i_Form.LstLojas.Items.Add(var_util.GetListViewItem(dsr.get_st_codLoja(), full_row));
                        }
                    }
                }

                i_Form.TxtRepasse.Text = "R$ " + new money().formatToMoney(vr_repasse.ToString());

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstLojasClick -

            case event_LstLojasClick:
            {
                //InitEventCode event_LstLojasClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_ListView1ItemChecked -

            case event_ListView1ItemChecked:
            {
                //InitEventCode event_ListView1ItemChecked
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtCartao.AcquireTextBox(i_Form.TxtCartao, this, event_val_TxtCartao, 6);
                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);
                ctrl_TxtNome.AcquireTextBox(i_Form.TxtNome, this, event_val_TxtNome, 20);
                ctrl_TxtLimTotal.AcquireTextBox(i_Form.TxtLimTotal, this, event_val_TxtLimTotal, "R$", 6);
                ctrl_TxtLimMensal.AcquireTextBox(i_Form.TxtLimMensal, this, event_val_TxtLimMensal, "R$", 6);
                ctrl_TxtCotaExtra.AcquireTextBox(i_Form.TxtCotaExtra, this, event_val_TxtCotaExtra, "R$", 6);

                ctrl_TxtCidade.AcquireTextBox(i_Form.TxtCidade, this, event_val_TxtCidade, 20, false);
                ctrl_TxtEstado.AcquireTextBox(i_Form.TxtEstado, this, event_val_TxtEstado, 20, false);

                ctrl_TxtCpf.AcquireTextBox(i_Form.TxtCpf, this, event_val_TxtCpf);
                ctrl_TxtCNPJ.AcquireTextBox(i_Form.TxtCNPJ, this, event_val_TxtCNPJ);

                if (header.get_tg_user_type() == TipoUsuario.Administrador ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift ||
                    header.get_tg_user_type() == TipoUsuario.VendedorGift ||
                    header.get_tg_user_type() == TipoUsuario.Operador)
                {
                    ctrl_TxtEmpresa.SetTextBoxText(header.get_st_empresa());

                    i_Form.TxtEmpresa.ReadOnly = true;
                }

                if (header.get_tg_user_type() == TipoUsuario.SuperUser)
                {
                    i_Form.BtnExclui.Visible = true;
                }

                i_Form.CboSit.SelectedIndex = 3;
                i_Form.CboExp.SelectedIndex = 2;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Consultar -

            case event_Consultar:
            {
                //InitEventCode event_Consultar

                i_Form.BtnConsultar.Enabled = false;

                DadosConsultaCartoes dcc = new DadosConsultaCartoes();

                if (header.get_tg_user_type() == TipoUsuario.Administrador)
                {
                    dcc.set_st_empresa(header.get_st_empresa());
                }
                else
                {
                    dcc.set_st_cnpj(ctrl_TxtCNPJ.getTextBoxValue());
                    dcc.set_st_empresa(ctrl_TxtEmpresa.getTextBoxValue());
                }

                dcc.set_st_cpf(ctrl_TxtCpf.getTextBoxValue());
                dcc.set_st_cartao(ctrl_TxtCartao.getTextBoxValue());
                dcc.set_st_nome(ctrl_TxtNome.getTextBoxValue());
                dcc.set_vr_limTotal(ctrl_TxtLimTotal.getTextBoxValue_NumberStr());
                dcc.set_vr_limMensal(ctrl_TxtLimMensal.getTextBoxValue_NumberStr());
                dcc.set_vr_cotaExtra(ctrl_TxtCotaExtra.getTextBoxValue_NumberStr());

                dcc.set_st_cidade(ctrl_TxtCidade.getTextBoxValue());
                dcc.set_st_estado(ctrl_TxtEstado.getTextBoxValue());

                dcc.set_tg_bloqueado(i_Form.CboSit.SelectedIndex.ToString());
                dcc.set_tg_expedido(i_Form.CboExp.SelectedIndex.ToString());

                string st_csv_block = "";

                i_Form.LstCartao.Items.Clear();

                i_Form.LblCart.Text = "Processando...";
                Application.DoEvents();

                ArrayList full_memory = new ArrayList();

                if (var_exchange.fetch_consultaCartao(ref dcc,
                                                      ref header,
                                                      ref st_csv_block))
                {
                    while (st_csv_block != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_block, "400", ref st_csv_block, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    string bloq = "";

                    if (i_Form.ChkAlfa.Checked)
                    {
                        ArrayList lst_sort = new ArrayList();
                        Hashtable hsh_sort = new Hashtable();

                        for (int t = 0; t < full_memory.Count; ++t)
                        {
                            DadosCartao dc = new DadosCartao(full_memory[t] as DataPortable);

                            lst_sort.Add(dc.get_st_proprietario() + dc.get_st_matricula());

                            hsh_sort [dc.get_st_proprietario() + dc.get_st_matricula()] = dc;
                        }

                        lst_sort.Sort();

                        for (int t = 0; t < lst_sort.Count; ++t)
                        {
                            DadosCartao dc = hsh_sort [lst_sort[t]] as DadosCartao;

                            if (dc.get_tg_status() == CartaoStatus.Bloqueado)
                            {
                                bloq = "Sim";
                            }
                            else
                            {
                                bloq = "Não";
                            }

                            string [] full_row = new string [] { dc.get_st_empresa() + "." + dc.get_st_matricula() + "-" + dc.get_st_titularidade(),
                                      bloq,
                                      dc.get_st_proprietario(),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_limiteTotal()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_limiteMensal()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_extraCota()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_dispMes()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_dispTotal()) };

                            i_Form.LstCartao.Items.Add(var_util.GetListViewItem(dc.get_st_cpf(), full_row));
                        }
                    }
                    else
                    {
                        for (int t = 0; t < full_memory.Count; ++t)
                        {
                            DadosCartao dc = new DadosCartao(full_memory[t] as DataPortable);

                            if (dc.get_tg_status() == CartaoStatus.Bloqueado)
                            {
                                bloq = "Sim";
                            }
                            else
                            {
                                bloq = "Não";
                            }

                            string [] full_row = new string [] { dc.get_st_empresa() + "." + dc.get_st_matricula() + "-" + dc.get_st_titularidade(),
                                      bloq,
                                      dc.get_st_proprietario(),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_limiteTotal()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_limiteMensal()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_extraCota()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_dispMes()),
                                                                 "R$ " + new money().formatToMoney(dc.get_vr_dispTotal()) };

                            i_Form.LstCartao.Items.Add(var_util.GetListViewItem(dc.get_st_cpf(), full_row));
                        }
                    }
                }

                if (full_memory.Count != 0)
                {
                    i_Form.LblCart.Text = full_memory.Count.ToString() + " cartões encontrados";
                }
                else
                {
                    i_Form.LblCart.Text = "Nenhum cartão encontrado";
                }

                i_Form.BtnConsultar.Enabled = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtEmpresa.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJ -

            case event_val_TxtCNPJ:
            {
                //InitEventCode event_val_TxtCNPJ

                switch (arg as string)
                {
                case cnpjTextController.CNPJ_INCOMPLETE:
                case cnpjTextController.CNPJ_INVALID:
                {
                    i_Form.TxtCNPJ.BackColor     = colorInvalid;
                    ctrl_TxtCNPJ.IsUserValidated = false;
                    break;
                }

                case cnpjTextController.CNPJ_VALID:
                {
                    i_Form.TxtCNPJ.BackColor     = Color.White;
                    ctrl_TxtCNPJ.IsUserValidated = true;
                    ctrl_TxtCNPJ.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNome -

            case event_val_TxtNome:
            {
                //InitEventCode event_val_TxtNome

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtNome.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtNome.BackColor     = Color.White;
                        ctrl_TxtNome.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtNome.BackColor     = colorInvalid;
                        ctrl_TxtNome.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLimTotal -

            case event_val_TxtLimTotal:
            {
                //InitEventCode event_val_TxtLimTotal

                if (arg as string == moneyTextController.MONEY_ZERO)
                {
                    i_Form.TxtLimTotal.BackColor     = colorInvalid;
                    ctrl_TxtLimTotal.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtLimTotal.BackColor     = Color.White;
                    ctrl_TxtLimTotal.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLimMensal -

            case event_val_TxtLimMensal:
            {
                //InitEventCode event_val_TxtLimMensal

                if (arg as string == moneyTextController.MONEY_ZERO)
                {
                    i_Form.TxtLimMensal.BackColor     = colorInvalid;
                    ctrl_TxtLimMensal.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtLimMensal.BackColor     = Color.White;
                    ctrl_TxtLimMensal.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCotaExtra -

            case event_val_TxtCotaExtra:
            {
                //InitEventCode event_val_TxtCotaExtra

                if (arg as string == moneyTextController.MONEY_ZERO)
                {
                    i_Form.TxtCotaExtra.BackColor     = colorInvalid;
                    ctrl_TxtCotaExtra.IsUserValidated = false;
                }
                else
                {
                    i_Form.TxtCotaExtra.BackColor     = Color.White;
                    ctrl_TxtCotaExtra.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCidade -

            case event_val_TxtCidade:
            {
                //InitEventCode event_val_TxtCidade

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtCidade.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCidade.BackColor     = Color.White;
                        ctrl_TxtCidade.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCidade.BackColor     = colorInvalid;
                        ctrl_TxtCidade.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEstado -

            case event_val_TxtEstado:
            {
                //InitEventCode event_val_TxtEstado

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtEstado.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtEstado.BackColor     = Color.White;
                        ctrl_TxtEstado.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtEstado.BackColor     = colorInvalid;
                        ctrl_TxtEstado.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCartao -

            case event_val_TxtCartao:
            {
                //InitEventCode event_val_TxtCartao

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtCartao.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCartao.BackColor     = Color.White;
                        ctrl_TxtCartao.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCartao.BackColor     = colorInvalid;
                        ctrl_TxtCartao.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCpf -

            case event_val_TxtCpf:
            {
                //InitEventCode event_val_TxtCpf

                switch (arg as string)
                {
                case cnpjTextController.CNPJ_INCOMPLETE:
                case cnpjTextController.CNPJ_INVALID:
                case cpfTextController.CPF_INCOMPLETE:
                case cpfTextController.CPF_INVALID:
                {
                    i_Form.TxtCpf.BackColor     = colorInvalid;
                    ctrl_TxtCpf.IsUserValidated = false;
                    break;
                }

                case cpfTextController.CPF_VALID:
                case cnpjTextController.CNPJ_VALID:
                {
                    i_Form.TxtCpf.BackColor     = System.Drawing.Color.White;
                    ctrl_TxtCpf.IsUserValidated = true;
                    break;
                }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Editar -

            case event_Editar:
            {
                //InitEventCode event_Editar

                if (i_Form.LstCartao.SelectedItems.Count > 0)
                {
                    string cpf_cnpj = var_util.getSelectedListViewItemTag(i_Form.LstCartao);

                    DadosProprietario dp = new DadosProprietario();

                    if (var_exchange.fetch_proprietario(cpf_cnpj,
                                                        ref header,
                                                        ref dp))
                    {
                        if (dp.get_tg_found() == Context.TRUE)
                        {
                            event_dlgDadosCadastrais ev_call = new event_dlgDadosCadastrais(var_util, var_exchange);

                            ev_call.header   = header;
                            ev_call.dp       = dp;
                            ev_call.cpf_cnpj = cpf_cnpj;

                            ev_call.i_Form.ShowDialog();
                        }
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Print -

            case event_Print:
            {
                //InitEventCode event_Print
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Report -

            case event_Report:
            {
                //InitEventCode event_Report

                ArrayList lstReport = new ArrayList();

                lstReport.Add("RELATÓRIO DE CONSULTA DE CARTÃO");
                lstReport.Add("");
                lstReport.Add("                                                                 Limite    Limite   Cota Extra  Disponível  Disponível ");
                lstReport.Add("CARTÃO              BLOQ NOME                                    TOTAL     MENSAL               MENSAL      TOTAL");
                lstReport.Add("------------------------------------------------------------------------------------------------------------------------");
                lstReport.Add("");

                string line = "";

                for (int t = 0; t < i_Form.LstCartao.Items.Count; ++t)
                {
                    line  = i_Form.LstCartao.Items[t].SubItems[0].Text + " ";
                    line += i_Form.LstCartao.Items[t].SubItems[1].Text.PadLeft(4, ' ') + " ";
                    line += i_Form.LstCartao.Items[t].SubItems[2].Text.PadRight(38, ' ').Substring(0, 38);
                    line += i_Form.LstCartao.Items[t].SubItems[3].Text.PadLeft(14, ' ').Replace("R$ ", "");
                    line += i_Form.LstCartao.Items[t].SubItems[4].Text.PadLeft(14, ' ').Replace("R$ ", "");
                    line += i_Form.LstCartao.Items[t].SubItems[5].Text.PadLeft(14, ' ').Replace("R$ ", "");
                    line += i_Form.LstCartao.Items[t].SubItems[6].Text.PadLeft(14, ' ').Replace("R$ ", "");
                    line += i_Form.LstCartao.Items[t].SubItems[7].Text.PadLeft(14, ' ').Replace("R$ ", "");

                    lstReport.Add(line);
                }

                new ConveyPrinter("Courier New", 7, 10, ref lstReport);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConsultarClick -

            case event_BtnConsultarClick:
            {
                //InitEventCode event_BtnConsultarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstCartaoDoubleClick -

            case event_LstCartaoDoubleClick:
            {
                //InitEventCode event_LstCartaoDoubleClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRelatorioClick -

            case event_BtnRelatorioClick:
            {
                //InitEventCode event_BtnRelatorioClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_ChkAlfaCheckedChanged -

            case event_ChkAlfaCheckedChanged:
            {
                //InitEventCode event_ChkAlfaCheckedChanged

                doEvent(event_Consultar, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnExcluiClick -

            case event_BtnExcluiClick:
            {
                //InitEventCode event_BtnExcluiClick

                if (i_Form.LstCartao.SelectedItems.Count == 1)
                {
                    string emp = i_Form.LstCartao.SelectedItems[0].SubItems[0].Text.Substring(0, 6);
                    string mat = i_Form.LstCartao.SelectedItems[0].SubItems[0].Text.Substring(7, 6);
                    string tit = i_Form.LstCartao.SelectedItems[0].SubItems[0].Text.Substring(14, 2);

                    var_exchange.exec_excluiCart(emp, mat, tit, ref header);
                }

                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #14
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                string upgradePath = "Pendencias";

                if (var_util.offline)
                {
                    i_Form.BtnConfirmar.Enabled = false;
                }

                i_Form.LstPend.Items.Clear();

                if (Directory.Exists(upgradePath))
                {
                    string [] my_files = Directory.GetFiles(upgradePath);
                    int       numFiles = my_files.GetLength(0);

                    for (int t = 0; t < numFiles; ++t)
                    {
                        string fileName = my_files[t];

                        StreamReader sr = new StreamReader(fileName);

                        string cart = sr.ReadLine();
                        string valu = "R$ " + new SyCrafEngine.money().formatToMoney(sr.ReadLine());

                        string [] full_row = { cart, valu };

                        i_Form.LstPend.Items.Add(var_util.GetListViewItem(fileName, full_row));

                        i_Form.LstPend.Items[t].Selected = true;

                        sr.Close();
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRemoverClick -

            case event_BtnRemoverClick:
            {
                //InitEventCode event_BtnRemoverClick

                if (MessageBox.Show("Confirma remoção deste registro?",
                                    "Aviso",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Question,
                                    MessageBoxDefaultButton.Button2) == DialogResult.No)
                {
                    return(false);
                }

                string file = var_util.getSelectedListViewItemTag(i_Form.LstPend);

                File.Delete(file);

                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick

                if (i_Form.LstPend.SelectedItems.Count == 0)
                {
                    return(false);
                }

                int max = i_Form.LstPend.SelectedItems.Count;

                for (int t = 0; t < max; ++t)
                {
                    string st_cart  = i_Form.LstPend.SelectedItems[t].SubItems[0].Text;
                    string vr_valor = i_Form.LstPend.SelectedItems[t].SubItems[1].Text;

                    vr_valor = vr_valor.Replace("R$ ", "").Replace(".", "").Replace(",", "");

                    string fileName = i_Form.LstPend.SelectedItems[t].Tag.ToString();

                    if (var_exchange.exec_venda_pend_lojista(st_cart,
                                                             vr_valor,
                                                             ref header))
                    {
                        if (File.Exists(fileName))
                        {
                            File.Delete(fileName);
                        }
                    }
                }

                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #15
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtCodAcesso.AcquireTextBox(i_Form.TxtCodAcesso, this, event_val_TxtCodAcesso, 4);
                ctrl_TxtCarga.AcquireTextBox(i_Form.TxtCarga, this, event_val_TxtCarga, "R$", 6);

                i_Form.LstDados.Items.Add("-Nome ");
                i_Form.LstDados.Items.Add(dp.get_st_nome());
                i_Form.LstDados.Items.Add("-Cpf ");
                i_Form.LstDados.Items.Add(dp.get_st_cpf());
                i_Form.LstDados.Items.Add("-Telefone ");
                i_Form.LstDados.Items.Add(dp.get_st_telefone());
                i_Form.LstDados.Items.Add("-Endereço ");
                i_Form.LstDados.Items.Add(dp.get_st_endereco());

                ArrayList lst = new ArrayList();

                var_exchange.fetch_extraGift(ref header, ref lst);

                i_Form.LstProd.Items.Clear();
                for (int t = 0; t < lst.Count; ++t)
                {
                    DadosProdutoGift dpg = new DadosProdutoGift(lst[t] as DataPortable);

                    string [] full_row = new string [] { dpg.get_st_nome(), "R$ " + new money().formatToMoney(dpg.get_vr_valor()) };

                    i_Form.LstProd.Items.Add(var_util.GetListViewItem(dpg.get_id_produto(), full_row));

                    if (recarga)
                    {
                        if (t == 1)
                        {
                            i_Form.LstProd.Items[t].Checked = true;
                        }
                    }
                    else
                    {
                        if (t == 0)
                        {
                            i_Form.LstProd.Items[t].Checked = true;
                        }
                    }
                }

                if (recarga)
                {
                    i_Form.Text = "Confirmação para recarga de cartão Gift";
                }

                doEvent(event_CalcTotal, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (ctrl_TxtCarga.getTextBoxValue_Long() == 0)
                {
                    MessageBox.Show("Informe o valor de carga", "Aviso");
                    return(false);
                }

                string tg_recarga = Context.FALSE;

                if (recarga)
                {
                    tg_recarga = Context.TRUE;
                }

                if (!var_exchange.exec_validGift(ctrl_TxtCodAcesso.getTextBoxValue(),
                                                 dc.get_st_empresa(),
                                                 dc.get_st_matricula(),
                                                 tg_recarga,
                                                 ref header))
                {
                    return(false);
                }

                event_dlgFinalGift ev_call = new event_dlgFinalGift(var_util, var_exchange);

                ev_call.header  = header;
                ev_call.da      = da;
                ev_call.dp      = dp;
                ev_call.dc      = dc;
                ev_call.total   = total;
                ev_call.carga   = ctrl_TxtCarga.getTextBoxValue_Long();
                ev_call.recarga = recarga;

                for (int t = 0; t < i_Form.LstProd.Items.Count; ++t)
                {
                    if (i_Form.LstProd.Items[t].Checked == true)
                    {
                        ev_call.lstProdsNome.Add(i_Form.LstProd.Items[t].SubItems[0].Text);
                        ev_call.lstProdsValor.Add(new money().getNumericValue(i_Form.LstProd.Items[t].SubItems[1].Text.Replace("R$", "")).ToString());
                    }
                }

                ev_call.i_Form.ShowDialog();

                i_Form.IsTerm = ev_call.IsTerm;
                i_Form.Close();

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCarga -

            case event_val_TxtCarga:
            {
                //InitEventCode event_val_TxtCarga

                doEvent(event_CalcTotal, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_CalcTotal -

            case event_CalcTotal:
            {
                //InitEventCode event_CalcTotal

                total = ctrl_TxtCarga.getTextBoxValue_Long();

                for (int t = 0; t < i_Form.LstProd.Items.Count; ++t)
                {
                    if (recarga)
                    {
                        if (t == 1)
                        {
                            if (i_Form.LstProd.Items[t].Checked == false)
                            {
                                i_Form.LstProd.Items[t].Checked = true;
                                return(false);
                            }
                        }
                    }
                    else
                    {
                        if (t == 0)
                        {
                            if (i_Form.LstProd.Items[t].Checked == false)
                            {
                                i_Form.LstProd.Items[t].Checked = true;
                                return(false);
                            }
                        }
                    }

                    if (i_Form.LstProd.Items[t].Checked == true)
                    {
                        total += new money().getNumericValue(i_Form.LstProd.Items[t].SubItems[1].Text.Replace("R$", ""));
                    }
                }

                i_Form.LblTotal.Text = "Total: R$ " + new money().formatToMoney(total.ToString());

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsClosing -

            case event_FormIsClosing:
            {
                //InitEventCode event_FormIsClosing
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCodAcesso -

            case event_val_TxtCodAcesso:
            {
                //InitEventCode event_val_TxtCodAcesso
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstProdItemChecked -

            case event_LstProdItemChecked:
            {
                //InitEventCode event_LstProdItemChecked
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_DlgConfGiftCardFormClosing -

            case event_DlgConfGiftCardFormClosing:
            {
                //InitEventCode event_DlgConfGiftCardFormClosing
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #16
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtNome.AcquireTextBox(i_Form.TxtNome, this, event_val_TxtNome, 20, "");

                ctrl_TxtNome.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNome -

            case event_val_TxtNome:
            {
                //InitEventCode event_val_TxtNome

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtNome.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtNome.BackColor     = Color.White;
                        ctrl_TxtNome.IsUserValidated = true;
                        ctrl_TxtNome.CleanError();

                        if (ctrl_TxtNome.GetEnterPressed())
                        {
                            ArrayList lst = new ArrayList();

                            if (var_exchange.fetch_nomeLoja(ctrl_TxtNome.getTextBoxValue(),
                                                            st_cod_empresa,
                                                            ref header,
                                                            ref lst))
                            {
                                i_Form.LstLojas.Items.Clear();
                                for (int t = 0; t < lst.Count; ++t)
                                {
                                    DadosLoja dl = new DadosLoja(lst[t] as DataPortable);

                                    string [] full_row = new string [] { dl.get_st_nome(), dl.get_st_loja() };

                                    i_Form.LstLojas.Items.Add(var_util.GetListViewItem(dl.get_st_loja(), full_row));
                                }
                            }
                        }
                    }
                    else
                    {
                        i_Form.TxtNome.BackColor     = colorInvalid;
                        ctrl_TxtNome.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                i_Form.Close();

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LojaClick -

            case event_LojaClick:
            {
                //InitEventCode event_LojaClick

                if (i_Form.LstLojas.SelectedItems.Count > 0)
                {
                    string st_cod_loja = new ApplicationUtil().getSelectedListViewItemTag(i_Form.LstLojas);

                    ArrayList lst = new ArrayList();

                    if (var_exchange.fetch_termLoja(st_cod_loja, ref header, ref lst))
                    {
                        for (int t = 0; t < lst.Count; ++t)
                        {
                            DadosTerminal dt = new DadosTerminal(lst [t] as DataPortable);

                            string [] full_row = new string [] { dt.get_st_terminal(), dt.get_st_localizacao() };

                            i_Form.LstTerm.Items.Add(var_util.GetListViewItem(dt.get_st_terminal(), full_row));
                        }
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_TermClick -

            case event_TermClick:
            {
                //InitEventCode event_TermClick

                if (i_Form.LstTerm.SelectedItems.Count > 0 &&
                    i_Form.LstLojas.SelectedItems.Count > 0)
                {
                    st_cod_terminal = var_util.getSelectedListViewItemTag(i_Form.LstTerm);
                    st_nome_loja    = i_Form.LstLojas.SelectedItems[0].SubItems[0].Text;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstLojasClick -

            case event_LstLojasClick:
            {
                //InitEventCode event_LstLojasClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstTermClick -

            case event_LstTermClick:
            {
                //InitEventCode event_LstTermClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtNome.AcquireTextBox(i_Form.TxtNome, this, event_val_TxtNome, 40);
                ctrl_TxtCidade.AcquireTextBox(i_Form.TxtCidade, this, event_val_TxtCidade, 20, false);
                ctrl_TxtEstado.AcquireTextBox(i_Form.TxtEstado, this, event_val_TxtEstado, 2, false);
                ctrl_TxtQtdCartoes.AcquireTextBox(i_Form.TxtQtdCartoes, this, event_val_TxtQtdCartoes, 6);
                ctrl_TxtQtdParc.AcquireTextBox(i_Form.TxtQtdParc, this, event_val_TxtQtdParc, 6);
                ctrl_TxtQtdLojas.AcquireTextBox(i_Form.TxtQtdLojas, this, event_val_TxtQtdLojas, 6);

                ctrl_TxtVrMin.AcquireTextBox(i_Form.TxtVrMin, this, event_val_TxtVrMin, "R$", 6);
                ctrl_TxtVrMax.AcquireTextBox(i_Form.TxtVrMax, this, event_val_TxtVrMax, "R$", 6);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNome -

            case event_val_TxtNome:
            {
                //InitEventCode event_val_TxtNome

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtNome.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtNome.BackColor     = Color.White;
                        ctrl_TxtNome.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtNome.BackColor     = colorInvalid;
                        ctrl_TxtNome.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCidade -

            case event_val_TxtCidade:
            {
                //InitEventCode event_val_TxtCidade

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtCidade.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCidade.BackColor     = Color.White;
                        ctrl_TxtCidade.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCidade.BackColor     = colorInvalid;
                        ctrl_TxtCidade.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEstado -

            case event_val_TxtEstado:
            {
                //InitEventCode event_val_TxtEstado

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtEstado.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtEstado.BackColor     = Color.White;
                        ctrl_TxtEstado.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtEstado.BackColor     = colorInvalid;
                        ctrl_TxtEstado.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtQtdCartoes -

            case event_val_TxtQtdCartoes:
            {
                //InitEventCode event_val_TxtQtdCartoes

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtQtdCartoes.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtQtdCartoes.BackColor     = Color.White;
                        ctrl_TxtQtdCartoes.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtQtdCartoes.BackColor     = colorInvalid;
                        ctrl_TxtQtdCartoes.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtQtdParc -

            case event_val_TxtQtdParc:
            {
                //InitEventCode event_val_TxtQtdParc

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtQtdParc.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtQtdParc.BackColor     = Color.White;
                        ctrl_TxtQtdParc.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtQtdParc.BackColor     = colorInvalid;
                        ctrl_TxtQtdParc.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtVrMin -

            case event_val_TxtVrMin:
            {
                //InitEventCode event_val_TxtVrMin

                if (ctrl_TxtVrMin.getTextBoxValue_Long() > 0)
                {
                    i_Form.TxtVrMin.BackColor     = Color.White;
                    ctrl_TxtVrMin.IsUserValidated = true;
                }
                else
                {
                    i_Form.TxtVrMin.BackColor     = colorInvalid;
                    ctrl_TxtVrMin.IsUserValidated = false;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtVrMax -

            case event_val_TxtVrMax:
            {
                //InitEventCode event_val_TxtVrMax

                if (ctrl_TxtVrMax.getTextBoxValue_Long() > 0)
                {
                    i_Form.TxtVrMax.BackColor     = Color.White;
                    ctrl_TxtVrMax.IsUserValidated = true;
                }
                else
                {
                    i_Form.TxtVrMax.BackColor     = colorInvalid;
                    ctrl_TxtVrMax.IsUserValidated = false;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Consultar -

            case event_Consultar:
            {
                //InitEventCode event_Consultar

                i_Form.BtnConsultar.Enabled = false;

                DadosConsultaEmpresa dce = new DadosConsultaEmpresa();

                dce.set_st_nome(ctrl_TxtNome.getTextBoxValue());
                dce.set_st_cidade(ctrl_TxtCidade.getTextBoxValue());
                dce.set_st_estado(ctrl_TxtEstado.getTextBoxValue());
                dce.set_nu_cartoes(ctrl_TxtQtdCartoes.getTextBoxValue());
                dce.set_nu_parcelas(ctrl_TxtQtdParc.getTextBoxValue());
                dce.set_vr_taxa_min(ctrl_TxtVrMin.getTextBoxValue_NumberStr());
                dce.set_vr_taxa_max(ctrl_TxtVrMax.getTextBoxValue_NumberStr());
                dce.set_nu_lojas(ctrl_TxtQtdLojas.getTextBoxValue());

                string st_csv_id = "";

                i_Form.LstEmpresas.Items.Clear();
                Application.DoEvents();

                if (var_exchange.fetch_consultaEmpresa(ref dce,
                                                       ref header,
                                                       ref st_csv_id))
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_id != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_id, "400", ref st_csv_id, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosEmpresa de = new DadosEmpresa(full_memory[t] as DataPortable);

                        string [] full_row = new string [] { de.get_st_empresa(),
                                  de.get_st_fantasia(),
                                  de.get_st_cidade(),
                                  de.get_st_estado(),
                                  de.get_nu_cartoes(),
                                  de.get_nu_parcelas(),
                                                             "R$ " + new money().formatToMoney(de.get_vr_mensalidade()),
                                                             de.get_nu_lojas(),
                                                             de.get_nu_CNPJ() };

                        i_Form.LstEmpresas.Items.Add(var_util.GetListViewItem(de.get_st_empresa(), full_row));
                    }
                }

                i_Form.BtnConsultar.Enabled = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Editar -

            case event_Editar:
            {
                //InitEventCode event_Editar

                if (i_Form.LstEmpresas.SelectedItems.Count > 0)
                {
                    event_dlgNovaEmpresa ev_call = new event_dlgNovaEmpresa(var_util, var_exchange);

                    ev_call.header        = header;
                    ev_call.IsMaintenance = true;
                    ev_call.par_code      = var_util.getSelectedListViewItemTag(i_Form.LstEmpresas);

                    ev_call.i_Form.ShowDialog();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtQtdLojas -

            case event_val_TxtQtdLojas:
            {
                //InitEventCode event_val_TxtQtdLojas

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtQtdLojas.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtQtdLojas.BackColor     = Color.White;
                        ctrl_TxtQtdLojas.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtQtdLojas.BackColor     = colorInvalid;
                        ctrl_TxtQtdLojas.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Cancelar -

            case event_Cancelar:
            {
                //InitEventCode event_Cancelar

                if (i_Form.LstEmpresas.SelectedItems.Count > 0)
                {
                    dlgAutorizacao autor = new dlgAutorizacao();

                    autor.ShowDialog();

                    Application.DoEvents();

                    var_exchange.exec_cancelaEmpresa(var_util.getMd5Hash(autor.senha),
                                                     new ApplicationUtil().getSelectedListViewItemTag(i_Form.LstEmpresas),
                                                     ref header);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConsultarClick -

            case event_BtnConsultarClick:
            {
                //InitEventCode event_BtnConsultarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstEmpresasDoubleClick -

            case event_LstEmpresasDoubleClick:
            {
                //InitEventCode event_LstEmpresasDoubleClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnCancelarClick -

            case event_BtnCancelarClick:
            {
                //InitEventCode event_BtnCancelarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #18
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                i_Form.CboOper.Items.AddRange(new TipoOperacaoDesc().GetArray().ToArray());

                ctrl_TxtDtIni.AcquireTextBox(i_Form.TxtDtIni, this, event_val_TxtDtIni, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDtFim.AcquireTextBox(i_Form.TxtDtFim, this, event_val_TxtDtFim, dateTextController.FORMAT_DDMMYYYY);

                ctrl_TxtDtIni.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Year.ToString().PadLeft(2, '0'));

                ctrl_TxtDtFim.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                             DateTime.Now.Year.ToString().PadLeft(2, '0'));

                ctrl_TxtNome.AcquireTextBox(i_Form.TxtNome, this, event_val_TxtNome, 20);
                ctrl_TxtObs.AcquireTextBox(i_Form.TxtObs, this, event_val_TxtObs, 30, alphaTextController.ENABLE_NUMBERS);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Consultar -

            case event_Consultar:
            {
                //InitEventCode event_Consultar

                i_Form.BtnConsultar.Enabled = false;

                DadosConsultaAuditoria dca = new DadosConsultaAuditoria();

                if (i_Form.CboOper.SelectedIndex > 0)
                {
                    dca.set_nu_oper((i_Form.CboOper.SelectedIndex + 1).ToString());
                }

                dca.set_st_user(ctrl_TxtNome.getTextBoxValue());
                dca.set_st_obs(ctrl_TxtObs.getTextBoxValue());

                if (ctrl_TxtDtIni.getTextBoxValue().Length > 0)
                {
                    dca.set_dt_ini(var_util.GetDataBaseTimeFormat(ctrl_TxtDtIni.getTextBoxValue_Date()));
                }

                if (ctrl_TxtDtFim.getTextBoxValue().Length > 0)
                {
                    dca.set_dt_fim(var_util.GetDataBaseTimeFormat(ctrl_TxtDtFim.getTextBoxValue_Date().AddHours(23).AddMinutes(59)));
                }

                string st_csv_id = "";

                i_Form.LstAuditoria.Items.Clear();

                if (var_exchange.fetch_consultaAuditoria(ref dca,
                                                         ref header,
                                                         ref st_csv_id))
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_id != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_id, "400", ref st_csv_id, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    ArrayList desc = new TipoOperacaoDesc().GetArray();

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosAuditoria da = new DadosAuditoria(full_memory[t] as DataPortable);

                        int index = Convert.ToInt32(da.get_nu_oper()) - 1;

                        string [] full_row = new string [] { da.get_dt_operacao(),
                                  da.get_st_usuario(),
                                  desc[index].ToString(),
                                  da.get_st_obs(),
                                  da.get_id_link() };

                        i_Form.LstAuditoria.Items.Add(var_util.GetListViewItem("", full_row));
                    }

                    Application.DoEvents();
                }

                i_Form.BtnConsultar.Enabled = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtIni -

            case event_val_TxtDtIni:
            {
                //InitEventCode event_val_TxtDtIni

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtIni.BackColor     = colorInvalid;
                    ctrl_TxtDtIni.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtIni.BackColor     = Color.White;
                    ctrl_TxtDtIni.IsUserValidated = true;
                    ctrl_TxtDtIni.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtFim -

            case event_val_TxtDtFim:
            {
                //InitEventCode event_val_TxtDtFim

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtFim.BackColor     = colorInvalid;
                    ctrl_TxtDtFim.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtFim.BackColor     = Color.White;
                    ctrl_TxtDtFim.IsUserValidated = true;
                    ctrl_TxtDtFim.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNome -

            case event_val_TxtNome:
            {
                //InitEventCode event_val_TxtNome

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtNome.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtNome.BackColor     = Color.White;
                        ctrl_TxtNome.IsUserValidated = true;
                        ctrl_TxtNome.CleanError();
                    }
                    else
                    {
                        i_Form.TxtNome.BackColor     = colorInvalid;
                        ctrl_TxtNome.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtObs -

            case event_val_TxtObs:
            {
                //InitEventCode event_val_TxtObs

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtObs.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtObs.BackColor     = Color.White;
                        ctrl_TxtObs.IsUserValidated = true;
                        ctrl_TxtObs.CleanError();
                    }
                    else
                    {
                        i_Form.TxtObs.BackColor     = colorInvalid;
                        ctrl_TxtObs.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConsultarClick -

            case event_BtnConsultarClick:
            {
                //InitEventCode event_BtnConsultarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);

                if (header.get_tg_user_type() == TipoUsuario.Administrador ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift)
                {
                    ctrl_TxtEmpresa.SetTextBoxText(header.get_st_empresa());
                    i_Form.TxtEmpresa.ReadOnly = true;

                    doEvent(event_BuscaDados, ctrl_TxtEmpresa.getTextBoxValue());
                }
                else                         // root
                {
                    ctrl_TxtEmpresa.SetTextBoxText("0");

                    doEvent(event_BuscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (i_Form.CboAcao.SelectedItem != null)
                {
                    if (i_Form.LstUsuarios.SelectedItems.Count > 0)
                    {
                        var_exchange.exec_alteraUsuario(i_Form.CboAcao.SelectedIndex.ToString(),
                                                        var_util.getSelectedListViewItemTag(i_Form.LstUsuarios),
                                                        ref header);

                        doEvent(event_BuscaDados, ctrl_TxtEmpresa.getTextBoxValue());
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Detalhes -

            case event_Detalhes:
            {
                //InitEventCode event_Detalhes
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtEmpresa.Text.Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                        ctrl_TxtEmpresa.CleanError();

                        if (ctrl_TxtEmpresa.GetEnterPressed())
                        {
                            doEvent(event_BuscaDados, ctrl_TxtEmpresa.getTextBoxValue());
                        }
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaDados -

            case event_BuscaDados:
            {
                //InitEventCode event_BuscaDados

                i_Form.LstUsuarios.Items.Clear();

                ArrayList list = new ArrayList();

                string st_csv_id = "";

                var_util.clearPortable();

                // customiza header!
                CNetHeader head = new CNetHeader(header as DataPortable);

                head.set_st_empresa(arg as string);

                i_Form.LstUsuarios.Items.Clear();

                if (var_exchange.fetch_listaUsuarios(ref head, ref st_csv_id))
                {
                    ArrayList full_memory = new ArrayList();

                    while (st_csv_id != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_id, "200", ref st_csv_id, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }
                        }
                    }

                    ArrayList desc = new TipoUsuarioDesc().GetArray();

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosUsuario info = new DadosUsuario(full_memory[t] as DataPortable);

                        string id      = info.get_id_usuario();
                        string nome    = info.get_st_nome();
                        string bloq    = info.get_tg_bloqueio();
                        string nivel   = desc [Convert.ToInt32(info.get_tg_nivel())].ToString();
                        string empresa = info.get_st_empresa();

                        if (bloq == Context.TRUE)
                        {
                            bloq = "Sim";
                        }
                        else
                        {
                            bloq = "Não";
                        }

                        if (empresa == "000000")
                        {
                            empresa = "";
                        }

                        switch (nivel)
                        {
                        case TipoUsuario.SuperUser:             nivel = "Super Usuário";        break;

                        case TipoUsuario.Administrador: nivel = "Administrador";        break;

                        case TipoUsuario.Operador:              nivel = "Operador";                     break;

                        default: break;
                        }

                        string [] full_row = new string [] { nome, bloq, nivel, empresa };

                        i_Form.LstUsuarios.Items.Add(var_util.GetListViewItem(id, full_row));
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtLimMensal.AcquireTextBox(i_Form.TxtLimMensal, this, event_val_TxtLimMensal, "R$", 8);
                ctrl_TxtLimTotal.AcquireTextBox(i_Form.TxtLimTotal, this, event_val_TxtLimTotal, "R$", 8);
                ctrl_TxtLimRotativo.AcquireTextBox(i_Form.TxtLimRotativo, this, event_val_TxtLimRotativo, "R$", 8);
                ctrl_TxtCotaExtra.AcquireTextBox(i_Form.TxtCotaExtra, this, event_val_TxtCotaExtra, "R$", 8);

                ctrl_TxtCpf.AcquireTextBox(i_Form.TxtCpf, this, event_val_TxtCpf, 11);

                ctrl_TxtLimMensal.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtLimTotal.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtLimRotativo.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);
                ctrl_TxtCotaExtra.SetupErrorProvider(ErrorIconAlignment.MiddleRight, false);

                ctrl_TxtLimTotal.IsUserValidated    = false;
                ctrl_TxtLimMensal.IsUserValidated   = false;
                ctrl_TxtLimRotativo.IsUserValidated = false;
                ctrl_TxtCotaExtra.IsUserValidated   = false;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Confirmar -

            case event_Confirmar:
            {
                //InitEventCode event_Confirmar

                if (i_Form.LstCartoes.SelectedItems.Count > 0)
                {
                    bool IsDone = true;

                    if (!ctrl_TxtLimTotal.IsUserValidated)
                    {
                        ctrl_TxtLimTotal.SetErrorMessage("Valor deve estar preenchido");      IsDone = false;
                    }
                    if (!ctrl_TxtLimMensal.IsUserValidated)
                    {
                        ctrl_TxtLimMensal.SetErrorMessage("Valor deve estar preenchido");      IsDone = false;
                    }
                    if (!ctrl_TxtLimRotativo.IsUserValidated)
                    {
                        ctrl_TxtLimRotativo.SetErrorMessage("Valor deve estar preenchido");      IsDone = false;
                    }
                    if (!ctrl_TxtCotaExtra.IsUserValidated)
                    {
                        ctrl_TxtCotaExtra.SetErrorMessage("Valor deve estar preenchido");      IsDone = false;
                    }

                    if (!IsDone)
                    {
                        return(false);
                    }

                    if (ctrl_TxtLimMensal.getTextBoxValue_Long() > ctrl_TxtLimTotal.getTextBoxValue_Long())
                    {
                        ctrl_TxtLimMensal.SetErrorMessage("Valor mensal deve ser menor que o valor total");
                        return(false);
                    }

                    string       tag = var_util.getSelectedListViewItemTag(i_Form.LstCartoes);
                    DataPortable tmp = var_util.retrievePortable(tag);

                    DadosCartao dc = new DadosCartao(tmp);

                    dc.set_vr_limiteTotal(ctrl_TxtLimTotal.getTextBoxValue_NumberStr());
                    dc.set_vr_limiteMensal(ctrl_TxtLimMensal.getTextBoxValue_NumberStr());
                    dc.set_vr_limiteRotativo(ctrl_TxtLimRotativo.getTextBoxValue_NumberStr());
                    dc.set_vr_extraCota(ctrl_TxtCotaExtra.getTextBoxValue_NumberStr());

                    var_exchange.exec_alteraCartao(ref dc, ref header);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCpf -

            case event_val_TxtCpf:
            {
                //InitEventCode event_val_TxtCpf

                if (ctrl_TxtCpf.getTextBoxValue().Length < 11)
                {
                    i_Form.TxtCpf.BackColor     = colorInvalid;
                    ctrl_TxtCpf.IsUserValidated = false;

                    i_Form.LstCartoes.Items.Clear();
                    i_Form.LblNome.Text = "";
                }
                else
                {
                    i_Form.TxtCpf.BackColor = Color.White;

                    if (ctrl_TxtCpf.IsUserValidated == false)
                    {
                        string st_csv_id = "";

                        i_Form.LstCartoes.Items.Clear();

                        if (var_exchange.fetch_limitesCartao(ctrl_TxtCpf.getTextBoxValue(),
                                                             ref header,
                                                             ref st_csv_id))
                        {
                            ArrayList full_memory = new ArrayList();

                            while (st_csv_id != "")
                            {
                                ArrayList tmp_memory = new ArrayList();

                                if (var_exchange.fetch_memory(st_csv_id, "400", ref st_csv_id, ref tmp_memory))
                                {
                                    for (int t = 0; t < tmp_memory.Count; ++t)
                                    {
                                        full_memory.Add(tmp_memory[t]);
                                    }
                                }
                            }

                            ArrayList desc = new CartaoStatusDesc().GetArray();

                            for (int t = 0; t < full_memory.Count; ++t)
                            {
                                DadosCartao dc = new DadosCartao(full_memory[t] as DataPortable);

                                string nu_cartao = dc.get_st_empresa() + dc.get_st_matricula();

                                int index = Convert.ToInt32(dc.get_tg_status());

                                string status = desc [index].ToString();
                                string venc   = dc.get_st_vencimento().Substring(0, 2) +
                                                "/" +
                                                dc.get_st_vencimento().Substring(2, 2);

                                string [] full_row = new string [] { nu_cartao,
                                                                     status,
                                                                     venc };

                                var_util.savePortable(nu_cartao, dc);

                                i_Form.LstCartoes.Items.Add(var_util.GetListViewItem(nu_cartao, full_row));

                                i_Form.LblNome.Text = dc.get_st_proprietario();
                            }

                            if (full_memory.Count > 0)
                            {
                                i_Form.LstCartoes.Items[0].Selected = true;
                                doEvent(event_Click, null);
                            }
                        }
                    }

                    ctrl_TxtCpf.IsUserValidated = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLimTotal -

            case event_val_TxtLimTotal:
            {
                //InitEventCode event_val_TxtLimTotal
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLimMensal -

            case event_val_TxtLimMensal:
            {
                //InitEventCode event_val_TxtLimMensal
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLimRotativo -

            case event_val_TxtLimRotativo:
            {
                //InitEventCode event_val_TxtLimRotativo
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCotaExtra -

            case event_val_TxtCotaExtra:
            {
                //InitEventCode event_val_TxtCotaExtra
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Click -

            case event_Click:
            {
                //InitEventCode event_Click

                if (i_Form.LstCartoes.SelectedItems.Count > 0)
                {
                    string       tag = var_util.getSelectedListViewItemTag(i_Form.LstCartoes);
                    DataPortable tmp = var_util.retrievePortable(tag);

                    DadosCartao dc = new DadosCartao(tmp);

                    ctrl_TxtLimTotal.SetTextBoxString(dc.get_vr_limiteTotal());
                    ctrl_TxtLimMensal.SetTextBoxString(dc.get_vr_limiteMensal());
                    ctrl_TxtLimRotativo.SetTextBoxString(dc.get_vr_limiteRotativo());
                    ctrl_TxtCotaExtra.SetTextBoxString(dc.get_vr_extraCota());

                    ctrl_TxtLimTotal.IsUserValidated    = true;
                    ctrl_TxtLimMensal.IsUserValidated   = true;
                    ctrl_TxtLimRotativo.IsUserValidated = true;
                    ctrl_TxtCotaExtra.IsUserValidated   = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstCartoesClick -

            case event_LstCartoesClick:
            {
                //InitEventCode event_LstCartoesClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConfirmarClick -

            case event_BtnConfirmarClick:
            {
                //InitEventCode event_BtnConfirmarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #21
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtLoja.AcquireTextBox(i_Form.TxtLoja, this, event_val_TxtLoja, 6);
                ctrl_TxtCNPJ.AcquireTextBox(i_Form.TxtCNPJ, this, event_val_TxtCNPJ);

                ctrl_TxtDtAbIni.AcquireTextBox(i_Form.TxtDtAbIni, this, event_val_TxtDtAbIni, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDtAbFim.AcquireTextBox(i_Form.TxtDtAbFim, this, event_val_TxtDtAbFim, dateTextController.FORMAT_DDMMYYYY);

                ctrl_TxtDtFechIni.AcquireTextBox(i_Form.TxtDtFechIni, this, event_val_TxtDtFechIni, dateTextController.FORMAT_DDMMYYYY);
                ctrl_TxtDtFechFim.AcquireTextBox(i_Form.TxtDtFechFim, this, event_val_TxtDtFechFim, dateTextController.FORMAT_DDMMYYYY);

                ctrl_TxtDtAbIni.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Year.ToString().PadLeft(2, '0'));

                ctrl_TxtDtAbFim.SetTextBoxText(DateTime.Now.Day.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Month.ToString().PadLeft(2, '0') +
                                               DateTime.Now.Year.ToString().PadLeft(2, '0'));

                ArrayList lst = new ArrayList();

                var_exchange.fetch_conveyUsuarios(ref header, ref lst);

                i_Form.CboOpers.Items.Clear();
                i_Form.CboOpers.Items.Add("(Todos)");
                i_Form.CboResp.Items.Add("(Todos)");

                for (int t = 0; t < lst.Count; ++t)
                {
                    DadosUsuario us = new DadosUsuario(lst[t] as DataPortable);

                    i_Form.CboOpers.Items.Add(us.get_st_nome());
                    i_Form.CboResp.Items.Add(us.get_st_nome());
                }

                i_Form.CboOpers.SelectedIndex      = 0;
                i_Form.CboResp.SelectedIndex       = 0;
                i_Form.CboCateg.SelectedIndex      = 0;
                i_Form.CboPrioridade.SelectedIndex = 0;
                i_Form.CboSit.SelectedIndex        = 0;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Procurar -

            case event_Procurar:
            {
                //InitEventCode event_Procurar

                string nu_categ      = (i_Form.CboCateg.SelectedIndex - 1).ToString();
                string nu_prioridade = (i_Form.CboPrioridade.SelectedIndex - 1).ToString();
                string st_operador   = "";
                string st_resp       = "";
                string tg_closed     = i_Form.CboSit.SelectedIndex.ToString();
                string dt_ini_ab     = "";
                string dt_fim_ab     = "";
                string dt_ini_fech   = "";
                string dt_fim_fech   = "";
                string tg_tecnico    = Context.FALSE;
                string st_loja       = "";

                if (i_Form.CboOpers.SelectedIndex > 0)
                {
                    st_operador = i_Form.CboOpers.SelectedItem.ToString();
                }

                if (i_Form.CboResp.SelectedIndex > 0)
                {
                    st_resp = i_Form.CboResp.SelectedItem.ToString();
                }

                if (ctrl_TxtLoja.IsUserValidated)
                {
                    st_loja = ctrl_TxtLoja.getTextBoxValue();
                }

                if (i_Form.ChkTecnico.Checked)
                {
                    tg_tecnico = Context.TRUE;
                }

                if (ctrl_TxtDtAbIni.IsUserValidated)
                {
                    dt_ini_ab = var_util.GetDataBaseTimeFormat(ctrl_TxtDtAbIni.getTextBoxValue_Date());
                }

                if (ctrl_TxtDtAbFim.IsUserValidated)
                {
                    dt_fim_ab = var_util.GetDataBaseTimeFormat(ctrl_TxtDtAbFim.getTextBoxValue_Date().AddDays(1));
                }

                if (ctrl_TxtDtFechIni.IsUserValidated)
                {
                    dt_ini_fech = var_util.GetDataBaseTimeFormat(ctrl_TxtDtFechIni.getTextBoxValue_Date());
                }

                if (ctrl_TxtDtFechFim.IsUserValidated)
                {
                    dt_fim_fech = var_util.GetDataBaseTimeFormat(ctrl_TxtDtFechFim.getTextBoxValue_Date().AddDays(1));
                }

                string st_block = "";

                var_exchange.fetch_chamados(nu_categ,
                                            nu_prioridade,
                                            st_operador,
                                            tg_closed,
                                            dt_ini_ab,
                                            dt_fim_ab,
                                            dt_ini_fech,
                                            dt_fim_fech,
                                            tg_tecnico,
                                            st_loja,
                                            st_resp,
                                            ref header,
                                            ref st_block);

                ArrayList full_memory = new ArrayList();

                while (st_block != "")
                {
                    ArrayList tmp_memory = new ArrayList();

                    if (var_exchange.fetch_memory(st_block, "400", ref st_block, ref tmp_memory))
                    {
                        for (int t = 0; t < tmp_memory.Count; ++t)
                        {
                            full_memory.Add(tmp_memory[t]);
                        }
                    }
                }

                i_Form.LstChamados.Items.Clear();

                for (int t = 0; t < full_memory.Count; ++t)
                {
                    DadosChamado dc = new DadosChamado(full_memory[t] as DataPortable);

                    string dt_ab   = var_util.getDDMMYYYY_format(dc.get_dt_ab());
                    string dt_fech = dc.get_dt_fech();

                    if (dt_fech.Length > 0)
                    {
                        dt_fech = var_util.getDDMMYYYY_format(dt_fech);
                    }

                    string [] full_row = new string [] { dt_ab,
                                                         dt_fech,
                                                         dc.get_st_oper() + " (" + dc.get_st_resp() + ")",
                                                         dc.get_st_motivo() };

                    i_Form.LstChamados.Items.Add(var_util.GetListViewItem(dc.get_id_chamado(), full_row));
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLoja -

            case event_val_TxtLoja:
            {
                //InitEventCode event_val_TxtLoja

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtLoja.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtLoja.BackColor     = Color.White;
                        ctrl_TxtLoja.IsUserValidated = true;

                        if (ctrl_TxtLoja.GetEnterPressed())
                        {
                            DadosLoja dl = new DadosLoja();

                            var_exchange.fetch_dadosLoja("", ctrl_TxtLoja.getTextBoxValue(), ref header, ref dl);

                            i_Form.TxtNome.Text = dl.get_st_nome();
                            ctrl_TxtCNPJ.SetTextBoxText(dl.get_nu_CNPJ());
                        }
                    }
                    else
                    {
                        i_Form.TxtLoja.BackColor     = colorInvalid;
                        ctrl_TxtLoja.IsUserValidated = false;

                        if (ctrl_TxtLoja.GetEnterPressed())
                        {
                            event_dlgConsultaLoja ev_call = new event_dlgConsultaLoja(var_util, var_exchange);

                            ev_call.header = header;

                            ev_call.i_Form.Show();
                        }
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtAbIni -

            case event_val_TxtDtAbIni:
            {
                //InitEventCode event_val_TxtDtAbIni

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtAbIni.BackColor     = colorInvalid;
                    ctrl_TxtDtAbIni.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtAbIni.BackColor     = Color.White;
                    ctrl_TxtDtAbIni.IsUserValidated = true;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtAbFim -

            case event_val_TxtDtAbFim:
            {
                //InitEventCode event_val_TxtDtAbFim

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtAbFim.BackColor     = colorInvalid;
                    ctrl_TxtDtAbFim.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtAbFim.BackColor     = Color.White;
                    ctrl_TxtDtAbFim.IsUserValidated = true;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtFechIni -

            case event_val_TxtDtFechIni:
            {
                //InitEventCode event_val_TxtDtFechIni

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtFechIni.BackColor     = colorInvalid;
                    ctrl_TxtDtFechIni.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtFechIni.BackColor     = Color.White;
                    ctrl_TxtDtFechIni.IsUserValidated = true;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtDtFechFim -

            case event_val_TxtDtFechFim:
            {
                //InitEventCode event_val_TxtDtFechFim

                switch (arg as string)
                {
                case dateTextController.DATE_INVALID:
                {
                    i_Form.TxtDtFechFim.BackColor     = colorInvalid;
                    ctrl_TxtDtFechFim.IsUserValidated = false;
                    break;
                }

                case dateTextController.DATE_VALID:
                {
                    i_Form.TxtDtFechFim.BackColor     = Color.White;
                    ctrl_TxtDtFechFim.IsUserValidated = true;
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJ -

            case event_val_TxtCNPJ:
            {
                //InitEventCode event_val_TxtCNPJ

                switch (arg as string)
                {
                case cnpjTextController.CNPJ_INCOMPLETE:
                case cnpjTextController.CNPJ_INVALID:
                {
                    i_Form.TxtCNPJ.BackColor     = colorInvalid;
                    ctrl_TxtCNPJ.IsUserValidated = false;

                    if (ctrl_TxtCNPJ.GetEnterPressed())
                    {
                        event_dlgConsultaLoja ev_call = new event_dlgConsultaLoja(var_util, var_exchange);

                        ev_call.header = header;

                        ev_call.i_Form.Show();
                    }

                    break;
                }

                case cnpjTextController.CNPJ_VALID:
                {
                    i_Form.TxtCNPJ.BackColor     = Color.White;
                    ctrl_TxtCNPJ.IsUserValidated = true;
                    ctrl_TxtCNPJ.CleanError();

                    if (ctrl_TxtLoja.GetEnterPressed())
                    {
                        DadosLoja dl = new DadosLoja();

                        var_exchange.fetch_dadosLoja(ctrl_TxtCNPJ.getTextBoxValue(), "", ref header, ref dl);

                        ctrl_TxtLoja.SetTextBoxText(dl.get_st_loja());

                        i_Form.TxtNome.Text = dl.get_st_nome();
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Editar -

            case event_Editar:
            {
                //InitEventCode event_Editar

                if (i_Form.LstChamados.SelectedItems.Count > 0)
                {
                    event_dlgEditaChamado ev_call = new event_dlgEditaChamado(var_util, var_exchange);

                    ev_call.header     = header;
                    ev_call.id_chamado = var_util.getSelectedListViewItemTag(i_Form.LstChamados);

                    ev_call.i_Form.ShowDialog();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Relatorio -

            case event_Relatorio:
            {
                //InitEventCode event_Relatorio

                ArrayList lstReport = new ArrayList();

                lstReport.Add("RELATÓRIO DE CHAMADOS");
                lstReport.Add("");
                lstReport.Add("DT. ABERTURA                  DT. FECHAMENTO                OPER (RESP)");
                lstReport.Add("DESCRIÇÃO");
                lstReport.Add("-------------------------------------------------------------------------------------------------------");
                lstReport.Add("");

                string line = "";

                for (int t = 0; t < i_Form.LstChamados.Items.Count; ++t)
                {
                    line  = i_Form.LstChamados.Items[t].SubItems[0].Text.PadRight(29, ' ') + " ";
                    line += i_Form.LstChamados.Items[t].SubItems[1].Text.PadRight(29, ' ') + " ";
                    line += i_Form.LstChamados.Items[t].SubItems[2].Text.PadRight(32, ' ') + " ";

                    lstReport.Add(line);

                    line = i_Form.LstChamados.Items[t].SubItems[3].Text.PadRight(100, ' ').Substring(0, 100);

                    lstReport.Add(line);
                    lstReport.Add("");
                }

                new ConveyPrinter("Courier New", 7, 10, ref lstReport);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Print -

            case event_Print:
            {
                //InitEventCode event_Print
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstChamadosDoubleClick -

            case event_LstChamadosDoubleClick:
            {
                //InitEventCode event_LstChamadosDoubleClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnProcurarClick -

            case event_BtnProcurarClick:
            {
                //InitEventCode event_BtnProcurarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnReportClick -

            case event_BtnReportClick:
            {
                //InitEventCode event_BtnReportClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #22
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                string st_content = "";

                if (var_exchange.fetch_canc_dia_lojista(ref header, ref st_content))
                {
                    while (st_content != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_content, "200",
                                                      ref st_content,
                                                      ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                DadosConsultaTransacao dct = new DadosConsultaTransacao(tmp_memory [t] as DataPortable);

                                string [] full_row = new string [] { dct.get_st_cartao(),
                                                                     "R$ " + new money().formatToMoney(dct.get_vr_valor()),
                                                                     var_util.getDDMMYYYY_format(dct.get_dt_transacao()),
                                                                     dct.get_st_nsu() };

                                i_Form.LstVendas.Items.Add(var_util.GetListViewItem(null, full_row));
                            }
                        }
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnCancelarClick -

            case event_BtnCancelarClick:
            {
                //InitEventCode event_BtnCancelarClick

                if (i_Form.LstVendas.SelectedItems.Count == 0)
                {
                    return(false);
                }

                string dtax = i_Form.LstVendas.SelectedItems[0].SubItems[2].Text;
                string nsu  = i_Form.LstVendas.SelectedItems[0].SubItems[3].Text;

                string dta = var_util.GetDataBaseTimeFormat(
                    new DateTime(Convert.ToInt32(dtax.Substring(6, 4)),
                                 Convert.ToInt32(dtax.Substring(3, 2)),
                                 Convert.ToInt32(dtax.Substring(0, 2))));

                if (!var_exchange.fetch_dadosNSU(nsu,
                                                 dta,
                                                 TipoConfirmacao.Confirmada,
                                                 ref header,
                                                 ref dn))
                {
                    return(false);
                }

                POS_Entrada  pe = new POS_Entrada();
                POS_Resposta pr = new POS_Resposta();

                pe.set_st_terminal(dn.get_st_terminal());
                pe.set_st_empresa(dn.get_st_empresa());
                pe.set_st_matricula(dn.get_st_matricula());
                pe.set_st_titularidade(dn.get_st_titularidade());
                pe.set_nu_parcelas("0");

                string st_msg = "";

                var_exchange.m_Client.QuietMode = true;

                if (var_exchange.exec_pos_cancelaVendaEmpresarial(nsu,
                                                                  dta,
                                                                  header.get_st_user_id(),
                                                                  ref pe,
                                                                  ref st_msg,
                                                                  ref pr))
                {
                    MessageBox.Show("Sucesso no cancelamento", "Aviso");
                }
                else
                {
                    MessageBox.Show(st_msg, "Erro");
                }

                var_exchange.m_Client.QuietMode = false;

                doEvent(event_FormIsOpening, null);

                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #23
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtEmpresa.AcquireTextBox(i_Form.TxtEmpresa, this, event_val_TxtEmpresa, 6);

                ctrl_TxtLoja.AcquireTextBox(i_Form.TxtLoja, this, event_val_TxtLoja, 6);
                ctrl_TxtCNPJ.AcquireTextBox(i_Form.TxtCNPJ, this, event_val_TxtCNPJ);

                ctrl_TxtNome.AcquireTextBox(i_Form.TxtNome, this, event_val_TxtNome, 40);
                ctrl_TxtCidade.AcquireTextBox(i_Form.TxtCidade, this, event_val_TxtCidade, 20, false);
                ctrl_TxtEstado.AcquireTextBox(i_Form.TxtEstado, this, event_val_TxtEstado, 2, false);

                ctrl_TxtQtdTerm.AcquireTextBox(i_Form.TxtQtdTerm, this, event_val_TxtQtdTerm, 2);

                if (header.get_tg_user_type() == TipoUsuario.Administrador ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift)
                {
                    i_Form.TxtEmpresa.Text     = header.get_st_empresa();
                    i_Form.TxtEmpresa.ReadOnly = true;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Consultar -

            case event_Consultar:
            {
                //InitEventCode event_Consultar

                i_Form.BtnConsultar.Enabled = false;

                DadosConsultaLoja dcl = new DadosConsultaLoja();

                dcl.set_st_empresa(ctrl_TxtEmpresa.getTextBoxValue());
                dcl.set_st_nome(ctrl_TxtNome.getTextBoxValue());
                dcl.set_st_cidade(ctrl_TxtCidade.getTextBoxValue());
                dcl.set_st_estado(ctrl_TxtEstado.getTextBoxValue());
                dcl.set_nu_qtd_term(ctrl_TxtQtdTerm.getTextBoxValue());
                dcl.set_st_loja(ctrl_TxtLoja.getTextBoxValue());
                dcl.set_st_cnpj(ctrl_TxtCNPJ.getTextBoxValue());

                string st_csv_id = "";

                i_Form.LstLojas.Items.Clear();

                i_Form.LblQtd.Text = "Processando...";

                Application.DoEvents();

                if (var_exchange.fetch_consultaLoja(ref dcl,
                                                    ref header,
                                                    ref st_csv_id))
                {
                    full_memory.Clear();

                    while (st_csv_id != "")
                    {
                        ArrayList tmp_memory = new ArrayList();

                        if (var_exchange.fetch_memory(st_csv_id, "400", ref st_csv_id, ref tmp_memory))
                        {
                            for (int t = 0; t < tmp_memory.Count; ++t)
                            {
                                full_memory.Add(tmp_memory[t]);
                            }

                            i_Form.LblQtd.Text = "Buscando " + full_memory.ToString() + " registros";
                            Application.DoEvents();
                        }
                    }

                    for (int t = 0; t < full_memory.Count; ++t)
                    {
                        DadosLoja dl = new DadosLoja(full_memory[t] as DataPortable);

                        string [] full_row = new string [] { dl.get_st_loja(),
                                  dl.get_st_nome(),
                                  dl.get_st_cidade(),
                                  dl.get_st_estado(),
                                  dl.get_st_obs(),
                                  dl.get_nu_CNPJ(),
                                  dl.get_nu_diasRep(),
                                  dl.get_nu_pctRep(),
                                  dl.get_st_convenios() };

                        i_Form.LstLojas.Items.Add(var_util.GetListViewItem(dl.get_nu_CNPJ(), full_row));
                    }

                    i_Form.LblQtd.Text = full_memory.Count.ToString() + " registros encontrados";
                }
                else
                {
                    i_Form.LblQtd.Text = "";
                }

                i_Form.BtnConsultar.Enabled = true;

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Editar -

            case event_Editar:
            {
                //InitEventCode event_Editar

                if (i_Form.LstLojas.SelectedItems.Count > 0)
                {
                    if (header.get_tg_user_type() == TipoUsuario.SuperUser ||
                        header.get_tg_user_type() == TipoUsuario.Administrador ||
                        header.get_tg_user_type() == TipoUsuario.AdminGift)
                    {
                        event_dlgNovaLoja ev_call = new event_dlgNovaLoja(var_util, var_exchange);

                        ev_call.header        = header;
                        ev_call.IsMaintenance = true;
                        ev_call.par_code      = var_util.getSelectedListViewItemTag(i_Form.LstLojas);

                        ev_call.i_Form.ShowDialog();
                    }
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Remover -

            case event_Remover:
            {
                //InitEventCode event_Remover
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtNome -

            case event_val_TxtNome:
            {
                //InitEventCode event_val_TxtNome

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtNome.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtNome.BackColor     = Color.White;
                        ctrl_TxtNome.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtNome.BackColor     = colorInvalid;
                        ctrl_TxtNome.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCidade -

            case event_val_TxtCidade:
            {
                //InitEventCode event_val_TxtCidade

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtCidade.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtCidade.BackColor     = Color.White;
                        ctrl_TxtCidade.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtCidade.BackColor     = colorInvalid;
                        ctrl_TxtCidade.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEstado -

            case event_val_TxtEstado:
            {
                //InitEventCode event_val_TxtEstado

                switch (arg as string)
                {
                case alphaTextController.ALPHA_COMPLETE:
                case alphaTextController.ALPHA_INCOMPLETE:
                {
                    if (ctrl_TxtEstado.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtEstado.BackColor     = Color.White;
                        ctrl_TxtEstado.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtEstado.BackColor     = colorInvalid;
                        ctrl_TxtEstado.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtRamo -

            case event_val_TxtRamo:
            {
                //InitEventCode event_val_TxtRamo
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtQtdTerm -

            case event_val_TxtQtdTerm:
            {
                //InitEventCode event_val_TxtQtdTerm

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtQtdTerm.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtQtdTerm.BackColor     = Color.White;
                        ctrl_TxtQtdTerm.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtQtdTerm.BackColor     = colorInvalid;
                        ctrl_TxtQtdTerm.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtEmpresa -

            case event_val_TxtEmpresa:
            {
                //InitEventCode event_val_TxtEmpresa

                if (header.get_tg_user_type() == TipoUsuario.Administrador ||
                    header.get_tg_user_type() == TipoUsuario.AdminGift)
                {
                    return(false);
                }

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtEmpresa.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtEmpresa.BackColor     = Color.White;
                        ctrl_TxtEmpresa.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtEmpresa.BackColor     = colorInvalid;
                        ctrl_TxtEmpresa.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtLoja -

            case event_val_TxtLoja:
            {
                //InitEventCode event_val_TxtLoja

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (ctrl_TxtLoja.getTextBoxValue().Length > 0)
                    {
                        i_Form.TxtLoja.BackColor     = Color.White;
                        ctrl_TxtLoja.IsUserValidated = true;
                    }
                    else
                    {
                        i_Form.TxtLoja.BackColor     = colorInvalid;
                        ctrl_TxtLoja.IsUserValidated = false;
                    }

                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJ -

            case event_val_TxtCNPJ:
            {
                //InitEventCode event_val_TxtCNPJ

                switch (arg as string)
                {
                case cnpjTextController.CNPJ_INCOMPLETE:
                case cnpjTextController.CNPJ_INVALID:
                {
                    i_Form.TxtCNPJ.BackColor     = colorInvalid;
                    ctrl_TxtCNPJ.IsUserValidated = false;
                    break;
                }

                case cnpjTextController.CNPJ_VALID:
                {
                    i_Form.TxtCNPJ.BackColor     = Color.White;
                    ctrl_TxtCNPJ.IsUserValidated = true;
                    ctrl_TxtCNPJ.CleanError();
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Print -

            case event_Print:
            {
                //InitEventCode event_Print
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Report -

            case event_Report:
            {
                //InitEventCode event_Report

                ArrayList lstReport = new ArrayList();

                lstReport.Add("RELATÓRIO COMPLETO DE LOJAS");
                lstReport.Add("");
                lstReport.Add("COD.     NOME                                                   CIDADE       CNPJ             DIAS REP.   PCT. REPASSE");
                lstReport.Add("TELEFONE E ENDEREÇO");
                lstReport.Add("CONVENIOS");
                lstReport.Add("------------------------------------------------------------------------------------------------------------------------");
                lstReport.Add("");

                string line = "";

                for (int t = 0; t < i_Form.LstLojas.Items.Count; ++t)
                {
                    line  = i_Form.LstLojas.Items[t].SubItems[0].Text.PadRight(8, ' ') + " ";
                    line += i_Form.LstLojas.Items[t].SubItems[1].Text.PadRight(48, ' ').Substring(0, 48) + " ";
                    line += i_Form.LstLojas.Items[t].SubItems[2].Text.Trim().PadLeft(18, ' ') + " ";
                    line += i_Form.LstLojas.Items[t].SubItems[5].Text.PadLeft(14, ' ') + " ";
                    line += i_Form.LstLojas.Items[t].SubItems[6].Text.PadLeft(11, ' ') + " ";
                    line += i_Form.LstLojas.Items[t].SubItems[7].Text.PadLeft(11, ' ') + " ";

                    lstReport.Add(line);

                    for (int h = 0; h < full_memory.Count; ++h)
                    {
                        DadosLoja dl = new DadosLoja(full_memory[h] as DataPortable);

                        if (dl.get_st_nome() != i_Form.LstLojas.Items[t].SubItems[1].Text)
                        {
                            continue;
                        }

                        lstReport.Add(dl.get_st_endereco());
                        break;
                    }

                    lstReport.Add("Convênios: " + i_Form.LstLojas.Items[t].SubItems[8].Text);
                    lstReport.Add("");
                }

                new ConveyPrinter("Courier New", 7, 10, ref lstReport);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnConsultarClick -

            case event_BtnConsultarClick:
            {
                //InitEventCode event_BtnConsultarClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_LstLojasDoubleClick -

            case event_LstLojasDoubleClick:
            {
                //InitEventCode event_LstLojasDoubleClick
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnRelatorioClick -

            case event_BtnRelatorioClick:
            {
                //InitEventCode event_BtnRelatorioClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }
Example #24
0
        public override bool doEvent(int event_number, object arg)
        {
            switch (event_number)
            {
                #region - event_Load -

            case event_Load:
            {
                //InitEventCode event_Load

                                        #if ROBOT
                var_util.execDefinedRobot(this, var_alias);
                                        #else
                doEvent(event_Translate, null);
                doEvent(event_FormIsOpening, null);
                                        #endif

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Translate -

            case event_Translate:
            {
                //InitEventCode event_Translate
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_FormIsOpening -

            case event_FormIsOpening:
            {
                //InitEventCode event_FormIsOpening

                ctrl_TxtCNPJ.AcquireTextBox(i_Form.TxtCNPJ, this, event_val_TxtCNPJ, 8);

                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_ShowDialog -

            case robot_ShowDialog:
            {
                //InitEventCode robot_ShowDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - robot_CloseDialog -

            case robot_CloseDialog:
            {
                //InitEventCode robot_CloseDialog
                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BuscaDados -

            case event_BuscaDados:
            {
                //InitEventCode event_BuscaDados

                i_Form.LstTerminais.Items.Clear();

                ArrayList list = new ArrayList();

                if (var_exchange.fetch_terminalLoja(ctrl_TxtCNPJ.getTextBoxValue(),
                                                    ref header,
                                                    ref list))
                {
                    for (int t = 0; t < list.Count; ++t)
                    {
                        DadosTerminal dt = new DadosTerminal(list[t] as DataPortable);

                        string [] full_row = new string [] { dt.get_st_terminal(),
                                  dt.get_st_localizacao() };

                        i_Form.LstTerminais.Items.Add(var_util.GetListViewItem(dt.get_st_terminal(), full_row));
                    }
                }
                else
                {
                    i_Form.LstTerminais.Items.Clear();
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_val_TxtCNPJ -

            case event_val_TxtCNPJ:
            {
                //InitEventCode event_val_TxtCNPJ

                switch (arg as string)
                {
                case numberTextController.NUMBER_INCOMPLETE:
                case numberTextController.NUMBER_COMPLETE:
                {
                    if (i_Form.TxtCNPJ.Text.Length > 0)
                    {
                        i_Form.TxtCNPJ.BackColor     = Color.White;
                        ctrl_TxtCNPJ.IsUserValidated = true;
                        ctrl_TxtCNPJ.CleanError();

                        if (ctrl_TxtCNPJ.GetEnterPressed())
                        {
                            doEvent(event_BuscaDados, null);
                        }
                    }
                    else
                    {
                        i_Form.TxtCNPJ.BackColor     = colorInvalid;
                        ctrl_TxtCNPJ.IsUserValidated = false;
                    }
                    break;
                }

                default: break;
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Remover -

            case event_Remover:
            {
                //InitEventCode event_Remover

                if (i_Form.LstTerminais.SelectedItems.Count > 0)
                {
                    var_exchange.del_Terminal(ctrl_TxtCNPJ.getTextBoxValue(),
                                              i_Form.LstTerminais.SelectedItems[0].SubItems[0].Text,
                                              ref header);

                    doEvent(event_BuscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_Alterar -

            case event_Alterar:
            {
                //InitEventCode event_Alterar

                if (i_Form.LstTerminais.SelectedItems.Count > 0)
                {
                    event_dlgLocalizacao ev_call = new event_dlgLocalizacao(var_util, var_exchange);

                    ev_call.header             = header;
                    ev_call.var_TxtTerminal    = i_Form.LstTerminais.SelectedItems[0].SubItems[0].Text;
                    ev_call.var_TxtLocalizacao = i_Form.LstTerminais.SelectedItems[0].SubItems[1].Text;

                    ev_call.i_Form.ShowDialog();

                    doEvent(event_BuscaDados, null);
                }

                //EndEventCode
                return(true);
            }

                #endregion

                #region - event_BtnAlterarClick -

            case event_BtnAlterarClick:
            {
                //InitEventCode event_BtnAlterarClick
                //EndEventCode
                return(true);
            }

                #endregion

            default: break;
            }

            return(false);
        }