示例#1
0
        public void atribuir(string Plano)
        {
            frmPlanoInternacinal PlanInt  = new frmPlanoInternacinal();
            frmPlanoNacional     PlanNac  = new frmPlanoNacional();
            frmPlanoEsporte      PlanEsp  = new frmPlanoEsporte();
            frmPlanoCorporativo  PlanCorp = new frmPlanoCorporativo();
            frmPlanoMaritímo     PlanMari = new frmPlanoMaritímo();
            frmPlanoReceptivo    PlanRece = new frmPlanoReceptivo();
            frmPlanoStudent      PlanEst  = new frmPlanoStudent();


            if (Plano == "BRONZE")
            {
                PlanInt.Controls["gbBronze"].Visible = true;
                PlanInt.ShowDialog();
            }
            else if (Plano == "RUBI")
            {
                PlanInt.Controls["gbRubi"].Visible = true;
                PlanInt.ShowDialog();
            }

            else if (Plano == "PLUS")
            {
                PlanNac.Controls["gbPlus"].Visible = true;
                PlanNac.ShowDialog();
            }
            else if (Plano == "VIP")
            {
                PlanNac.Controls["gbVip"].Visible = true;
                PlanNac.ShowDialog();
            }
            else if (Plano == "BRONZE MARITIMO")
            {
                PlanMari.Controls["gbBronze"].Visible = true;
                PlanMari.ShowDialog();
            }
            else if (Plano == "MERCOSUL MARITIMO")
            {
                PlanMari.Controls["gbMercosul"].Visible = true;
                PlanMari.ShowDialog();
            }
            else if (Plano == "BRONZE NEVE")
            {
                PlanEsp.Controls["gbBronzeNeve"].Visible = true;
                PlanEsp.ShowDialog();
            }
            else if (Plano == "ALL SPORTS")
            {
                PlanEsp.Controls["gbAllSport"].Visible = true;
                PlanEsp.ShowDialog();
            }
            else if (Plano == "STUDENT FULL")
            {
                PlanEst.Controls["gbStudentFull"].Visible = true;
                PlanEst.ShowDialog();
            }
            else if (Plano == "STUDENT GLOBAL")
            {
                PlanEst.Controls["gbStudentGlobal"].Visible = true;
                PlanEst.ShowDialog();
            }
            else if (Plano == "TITANIUM")
            {
                PlanCorp.Controls["gbTitanium"].Visible = true;
                PlanCorp.ShowDialog();
            }

            else if (Plano == "EURO BUSINESS")
            {
                PlanCorp.Controls["gbEuroBusiness"].Visible = true;
                PlanCorp.ShowDialog();
            }


            else if (Plano == "RECEPTIVO BRONZE")
            {
                PlanRece.Controls["gbBronze"].Visible = true;
                PlanRece.ShowDialog();
            }

            else if (Plano == "RECEPTIVO UNION")
            {
                PlanRece.Controls["gbUnion"].Visible = true;
                PlanRece.ShowDialog();
            }
        }
示例#2
0
        private void tsbtnOk_Click(object sender, EventArgs e)
        {
            if (tstxtLogin.Text.Trim() == "")
            {
                MessageBox.Show("Informar o Login");
                return;
            }

            else if (tstxtLogin.Text.IndexOf("@") < 2 || tstxtLogin.Text.IndexOf(".COM") < 0)
            {
                MessageBox.Show("Login Invalido");
                return;
            }
            else if (tstxtSenha.Text.Trim() == "")
            {
                MessageBox.Show("Informar a Senha");
                return;
            }
            else if (tstcmbMod.Text.Trim() == "" || (tstcmbMod.Text.Trim() != "Cliente" && tstcmbMod.Text.Trim() != "Agência"))
            {
                MessageBox.Show("Modo de acesso incorreto, verifique ");

                return;
            }

            if (tstcmbMod.Text == "Cliente")
            {
                if (usuario.logarcli(tstxtLogin.Text, tstxtSenha.Text))
                {
                    frmCadastroCliente   frmcli        = new frmCadastroCliente();
                    ClienteBLL           cliente       = new ClienteBLL();
                    frmPlanoInternacinal internacional = new frmPlanoInternacinal();
                    usuario.inserir_controle_log(tstxtLogin.Text, tstxtSenha.Text);
                    StatusStripIni.Visible   = true;
                    btnLogOff.Enabled        = true;
                    Cadastro.Enabled         = false;
                    expandablePanel2.Visible = false;
                    Variaveis.logado         = "sim";
                    Variaveis.login          = tstxtLogin.Text;
                    Variaveis.senha          = tstxtSenha.Text;
                    Variaveis.modacesso      = tstcmbMod.Text;
                    btnAlterar.Enabled       = true;
                    btnAltCli.Enabled        = true;
                    MessageBox.Show("Logado com Sucesso");
                }
                else
                {
                    MessageBox.Show("Login / Senha Invalidos , ou modo de acesso errado");
                }
            }
            else if (tstcmbMod.Text == "Agência")
            {
                if (usuario.logar_agen(tstxtLogin.Text, tstxtSenha.Text))
                {
                    frmCadastroCliente frmcli = new frmCadastroCliente();
                    usuario.inserir_controle_log(tstxtLogin.Text, tstxtSenha.Text);
                    Variaveis.login          = tstxtLogin.Text;
                    Variaveis.senha          = tstxtSenha.Text;
                    Variaveis.modacesso      = tstcmbMod.Text;
                    Variaveis.logado         = "sim";
                    StatusStripIni.Visible   = true;
                    btnLogOff.Enabled        = true;
                    btnAlterar.Enabled       = true;
                    btnAltAgen.Enabled       = true;
                    Cadastro.Enabled         = false;
                    expandablePanel2.Visible = false;
                    MessageBox.Show("Logado com Sucesso");
                }
                else
                {
                    MessageBox.Show("Login / Senha Invalidos, ou modo de acesso errado");
                }
            }
        }