예제 #1
0
        void Submit_estabelecimento_cargoEspecialidade_inserir(object sender, EventArgs e)
        {
            Buscar.Editor.IsTrue = (sender as Control).Name.Contains("cargo");

            textBox   = Buscar.Editor.IsTrue ? cargo_input : especialidade_input;
            resultado = false;

            if (Validar.Formulario(textBox.Parent as Panel))
            {
                item  = textBox.Text.ToLower().Trim();
                table = Buscar.Editor.IsTrue ? Listar.Cargos.Todos : Listar.Especialidades.Todos;

                Preencher.List(list = new List <object>(), table, 0, "titulo");

                if (!list.Contains(item))
                {
                    resultado = Buscar.Editor.IsTrue ? Inserir.Cargo(item) : Inserir.Especialidade(item);
                    textBox.Clear();
                    titulo.Focus();
                }
            }

            Preencher_cargos_especialidades();

            Msg.Response(resultado, Msg.PreechimentoIncorreto);
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Buscar.Usuario.ID     = 0;
            Buscar.Usuario.Classe = "cliente";

            if (Request.HttpMethod.Equals("POST"))
            {
                Preencher.List(list = new List <object>(), Request.Form, 3);

                counter = 0;
                Buscar.Usuario.Login(list[counter++], list[counter++]);

                if (Buscar.Usuario.ID.Equals(0))
                {
                    Criar.HelpLink(page_content, "&laquo; Tentar novamente", "Default.aspx", Msg.CpfSenhaNaoCoincide);
                }
                else
                {
                    Response.Redirect("Agendamentos.aspx");
                }
            }
            else
            {
                Criar.HtmlForm(page_content, Etiquetas.Default.Labels, Etiquetas.Default.Widths, Etiquetas.Default.Lengths, "login", Etiquetas.Default.Types);
                Criar.HelpLink(page_content, "Esqueceu sua senha?", "recuperarSenha", null, true);
            }
        }
예제 #3
0
        void Submit_estabelecimento(object sender, EventArgs e)
        {
            resultado = false;

            if (Validar.Formulario(editor))
            {
                Preencher.List(list = new List <object>(), editor);

                habilitar_edicao.Checked = false;
                resultado = Buscar.Estabelecimento.Info.Rows.Count.Equals(0) ? Inserir.Estabelecimento(list) : Alterar.Estabelecimento.Info(list);
                Preencher_cargos_especialidades();
            }

            Msg.Response(resultado, Msg.PreechimentoIncorreto);
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Buscar.Usuario.ID.Equals(0))
            {
                Response.Redirect("/App/Logout.aspx");
            }

            if (Request.HttpMethod.Equals("POST"))
            {
                Preencher.List(list = new List <object>(), Request.Form, 3);

                msg = Alterar.Cliente.Login(list) ? Msg.AcaoRealizada : Msg.SenhaNaoCoincide;
                page_content.InnerHtml = Criar.Output("<p class='col label'>" + msg + "</p>");
            }

            Criar.HtmlForm(page_content, Etiquetas.Configuracoes.Senha.Fields, Etiquetas.Configuracoes.Senha.Widths, Etiquetas.Configuracoes.Senha.Lengths, "mudarSenha", Etiquetas.Configuracoes.Senha.Types);
        }
예제 #5
0
        void Submit_estabelecimento_cargoEspecialidade(object sender, EventArgs e)
        {
            resultado = false;

            if (!Buscar.Estabelecimento.Info.Rows.Count.Equals(0))
            {
                if (Validar.Formulario(cargoEspecialidade_padrao))
                {
                    Preencher.List(list = new List <object>(), cargoEspecialidade_padrao);

                    resultado = Alterar.Estabelecimento.CargoEspecialidade(list);
                    Preencher_cargos_especialidades();
                }
            }

            Msg.Response(resultado, Msg.PreechimentoIncorreto);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Buscar.Usuario.ID.Equals(0))
            {
                Response.Redirect("Logout.aspx");
            }

            if (Request.HttpMethod.Equals("POST"))
            {
                Buscar.Editor.ID    = 0;
                Preencher.List(list = new List <object>(), Request.Form, 3);

                msg = "<p class='col label'>{m}</p>";
                msg = msg.Replace("{m}", Alterar.Cliente.Endereco(list) ? Msg.AcaoRealizada : Msg.SenhaNaoCoincide);

                page_content.InnerHtml = Criar.Output(msg);
            }

            Criar.HtmlForm(page_content, Etiquetas.Endereco.Fields, Etiquetas.Endereco.Widths, Etiquetas.Endereco.Lengths, "atualizarEndereco");
            Preencher.HtmlForm(page_content, Buscar.Usuario.Info, 5);
        }
예제 #7
0
파일: Login.cs 프로젝트: attmf/nheengatu
 void Submit_Login(object sender, EventArgs e)
 {
     load_pb.Visible     = true;
     AsAdmin             = modoAdministrador.Checked;
     Preencher.List(list = new List <object>(), editor);
     if (Validar.Formulario(editor))
     {
         Buscar.Usuario.Classe = AsAdmin ? "administrador" : "funcionario";
         try{
             this.backgroundWorker1.RunWorkerAsync();
         }catch (Exception ex) {
         }
     }
     else
     {
         MessageBox.Show(Msg.PreechimentoIncorreto, Msg.Title.Atencao);
         load_pb.Visible = false;
     }
     cpf_input.Focus();
     cpf_input.SelectAll();
 }
예제 #8
0
파일: Cadastro.cs 프로젝트: attmf/nheengatu
        void Submit_Cadastro(object sender, EventArgs e)
        {
            resultado = false;

            if (Validar.Formulario(comum_inputs))
            {
                Preencher.List(list = new List <object>(), comum_inputs);

                switch (Buscar.Editor.Type)
                {
                case "funcionario":
                    if (Validar.Formulario(funcionarios_inputs))
                    {
                        Preencher.List(list, funcionarios_inputs);

                        if (Buscar.Editor.ID.Equals(0))
                        {
                            if (Buscar.Editor.IsCadastrado(cpf_input.Text))
                            {
                                Msg.Response(resultado, Msg.JaExisteCadastro);
                                cpf_input.Focus();
                            }
                            else
                            {
                                resultado = Inserir.Funcionario(list);
                            }
                        }
                        else
                        {
                            resultado = Alterar.Funcionario.Info(list);
                        }
                    }
                    break;

                case "cliente":
                    if (Buscar.Editor.ID.Equals(0))
                    {
                        if (Buscar.Editor.IsCadastrado(list[1]))
                        {
                            Msg.Response(resultado, Msg.JaExisteCadastro);
                            cpf_input.Focus();
                        }
                        else
                        {
                            resultado = Inserir.Cliente(list);

                            if (resultado)
                            {
                                Buscar.Editor.CPF = list[1].ToString();

                                list = new List <object>
                                {
                                    Buscar.Editor.CPF,
                                    Buscar.Usuario.ID,
                                    Buscar.Usuario.Classe,
                                    Msg.BoasVindas
                                };

                                Inserir.Mensagem(list);
                            }
                        }
                    }
                    else
                    {
                        resultado = Alterar.Cliente.Info(list);
                    }
                    break;
                }

                Msg.Response(resultado, Msg.AcaoNaoRealizada);
            }
            else
            {
                Msg.Response(resultado, Msg.PreechimentoIncorreto);
            }

            if (resultado)
            {
                Dispose();
                Close();
            }
        }