Beispiel #1
0
        private Boolean VerificaPlanos()
        {
            Boolean result = true;

            try
            {
                if (BmsSoftware.ConfigSistema1.Default.FlagPlanos.Trim() == "S")
                {
                    USUARIOCollection USUARIOColl_Total = new USUARIOCollection();
                    USUARIOColl_Total = USUARIOP.ReadCollectionByParameter(null);

                    RECURSOSPLANOProvider RECURSOSPLANOP  = new RECURSOSPLANOProvider();
                    PLANOSProvider        PLANOSP         = new PLANOSProvider();
                    RECURSOSPLANOEntity   RECURSOSPLANOTy = new RECURSOSPLANOEntity();
                    RECURSOSPLANOTy = RECURSOSPLANOP.Read(Convert.ToInt32(BmsSoftware.ConfigSistema1.Default.IdPlanos));

                    if (RECURSOSPLANOTy != null)
                    {
                        int QuantUsuarios = Convert.ToInt32(RECURSOSPLANOTy.USUARIOS);

                        if (USUARIOColl_Total.Count < QuantUsuarios)
                        {
                            result = true;
                        }
                        else
                        {
                            MessageBox.Show("Limite de usuários atingido pelo plano: " + PLANOSP.Read(Convert.ToInt32(RECURSOSPLANOTy.IDPLANO)).NOME,
                                            ConfigSistema1.Default.NomeEmpresa,
                                            MessageBoxButtons.OK,
                                            MessageBoxIcon.Error,
                                            MessageBoxDefaultButton.Button1);

                            result = false;
                        }
                    }
                }

                return(result);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
                return(result);
            }
        }
Beispiel #2
0
        private void FrmEmpresa_Load(object sender, EventArgs e)
        {
            try
            {
                CreaterCursor Cr = new CreaterCursor();
                this.Cursor = Cr.CreateCursor(Cr.btmap, 0, 0);

                this.MinimizeBox     = false;
                this.FormBorderStyle = FormBorderStyle.FixedDialog;

                btnSalva.Image = Util.GetAddressImage(15);
                btnSair.Image  = Util.GetAddressImage(21);

                EMPRESAProvider EMPRESAP  = new EMPRESAProvider();
                EMPRESAEntity   EMPRESATy = EMPRESAP.Read(1);

                txtRazaoSocial.Text   = EMPRESATy.NOMECLIENTE;
                txtNomeFantasita.Text = EMPRESATy.NOMEFANTASIA;
                txtEndereco.Text      = EMPRESATy.ENDERECO;
                txtBairro.Text        = EMPRESATy.BAIRRO;
                txtCep.Text           = EMPRESATy.CEP;
                txtCidade.Text        = EMPRESATy.CIDADE;
                txtUF.Text            = EMPRESATy.UF;
                txtTelefone.Text      = EMPRESATy.TELEFONE;
                txtEmail.Text         = EMPRESATy.EMAIL;
                txtCNPJCPF.Text       = EMPRESATy.CNPJCPF;
                txtIERG.Text          = EMPRESATy.IE;
                //txtPlano.Text = EMPRESATy.REGISTRO;
                txtComplemento.Text = EMPRESATy.COMPLEMENTO;
                txtNUmero.Text      = EMPRESATy.NUMERO;

                txtNumLicenca.Text = GetVolumeSerial("c");

                this.Cursor = Cursors.Default;

                //Plano
                if (BmsSoftware.ConfigSistema1.Default.FlagPlanos.Trim() == "S" && BmsSoftware.ConfigSistema1.Default.IdPlanos.Trim() == "5")//5 Plano Gratis
                {
                    txtRazaoSocial.ReadOnly   = false;
                    txtNomeFantasita.ReadOnly = false;
                    txtEndereco.ReadOnly      = false;
                    txtBairro.ReadOnly        = false;
                    txtCep.ReadOnly           = false;
                    txtCidade.ReadOnly        = false;
                    txtUF.ReadOnly            = false;
                    txtTelefone.ReadOnly      = false;
                    txtEmail.ReadOnly         = false;
                    txtCNPJCPF.ReadOnly       = false;
                    txtIERG.ReadOnly          = false;
                    txtComplemento.ReadOnly   = false;
                    txtNUmero.ReadOnly        = false;
                    btnSalva.Visible          = true;
                    //linkLabel1.Visible = false;

                    if (BmsSoftware.ConfigSistema1.Default.IdPlanos.Trim() != string.Empty)
                    {
                        PLANOSProvider PLANOSP = new PLANOSProvider();
                        txtPlano.Text = PLANOSP.Read(Convert.ToInt32(BmsSoftware.ConfigSistema1.Default.IdPlanos)).NOME;
                    }
                }

                if (BmsSoftware.ConfigSistema1.Default.FlagMsgSuporte == "S")
                {
                    btnComprarSuporte.Visible = false;
                }
            }
            catch (Exception ex)
            {
                this.Cursor = Cursors.Default;
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }