예제 #1
0
        /// <summary>
        /// Inicializando os componentes do formulario loja
        /// </summary>
        public FormLoja()
        {
            InitializeComponent();

            //inicializando os objetos
            dao            = new LojaDAO();
            daoFuncionario = new FuncionarioDAO();
            daoEndereco    = new EnderecoDAO();

            //eventos de destaque de campos de texto
            mk_nomeFantasia.Enter += new EventHandler(ClassFuncoes.CampoEventoEnter);
            mk_cnpj.Enter         += new EventHandler(ClassFuncoes.CampoEventoEnter);
            mk_telefone.Enter     += new EventHandler(ClassFuncoes.CampoEventoEnter);
            mk_email.Enter        += new EventHandler(ClassFuncoes.CampoEventoEnter);
            mk_razaoSocial.Enter  += new EventHandler(ClassFuncoes.CampoEventoEnter);
            mk_IE.Enter           += new EventHandler(ClassFuncoes.CampoEventoEnter);
            //leave
            mk_nomeFantasia.Leave += new EventHandler(ClassFuncoes.CampoEventoLeave);
            mk_cnpj.Leave         += new EventHandler(ClassFuncoes.CampoEventoLeave);
            mk_telefone.Leave     += new EventHandler(ClassFuncoes.CampoEventoLeave);
            mk_email.Leave        += new EventHandler(ClassFuncoes.CampoEventoLeave);
            mk_razaoSocial.Leave  += new EventHandler(ClassFuncoes.CampoEventoLeave);
            mk_IE.Leave           += new EventHandler(ClassFuncoes.CampoEventoLeave);

            //tradução
            this.textoCnpj.Text         = Properties.Resources.ResourceManager.GetString("titulo_cnpj");
            this.textoEmail.Text        = Properties.Resources.ResourceManager.GetString("titulo_email");
            this.textoNomeFantasia.Text = Properties.Resources.ResourceManager.GetString("titulo_nomeFantasia");
            this.textoRazaoSocial.Text  = Properties.Resources.ResourceManager.GetString("titulo_social");
            this.textoTelefone.Text     = Properties.Resources.ResourceManager.GetString("titulo_telefone");
            this.textoTipo.Text         = Properties.Resources.ResourceManager.GetString("titulo_tipo");
            this.Text = Properties.Resources.ResourceManager.GetString("titulo_loja1");
            this.radioButtonFilial.Text = Properties.Resources.ResourceManager.GetString("radio_filial");
            this.radioButtonMatriz.Text = Properties.Resources.ResourceManager.GetString("radio_matriz");

            //evento de teclado para tab no enter e Esc
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(ClassFuncoes.FormEventoKeyDown);

            //controle de botoes
            userControl      = new ControleUsBTN();
            userControl.Dock = DockStyle.Bottom;
            panelFormulario.Controls.Add(userControl);
            //eventos do user control
            userControl.btnAdicionar.Click += BtnAdicionar_Click;
            userControl.btnRemover.Click   += BtnRemover_Click;
            userControl.btnSalvar.Click    += BtnSalvar_Click;


            AtualizarTela();
        }