Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 3
0
        void Preencher_dgv_clientes(object sender, EventArgs e)
        {
            Preencher.GridView(dgv_clientes, Listar.Clientes.PorNome(clientes_search.Text), Etiquetas.pessoas, Etiquetas.pessoas_weights, false);

            lbl_naoHaClientes.Visible = dgv_clientes.Rows.Count.Equals(0);
            btn_mensageiro.Visible    = !dgv_clientes.Rows.Count.Equals(0);
            btn_historico.Visible     = !dgv_clientes.Rows.Count.Equals(0) && Buscar.Usuario.IsTecnico;
        }
Exemplo n.º 4
0
        void Preencher_dgv_funcionarios(object sender, EventArgs e)
        {
            item  = sender == null ? string.Empty : (sender as Control).Text;
            table = Listar.Funcionarios.PorNome(item);

            Preencher.GridView(dgv_funcionarios, table, Etiquetas.pessoas, Etiquetas.pessoas_weights, false);

            lbl_naoHaFuncionarios.Visible = dgv_funcionarios.Rows.Count.Equals(0);
        }
Exemplo n.º 5
0
        void Preencher_cargos_especialidades()
        {
            Preencher.ComboBox(cargo_default, Listar.Cargos.Todos, "titulo", "id");
            Preencher.ListBox(boxCargos, Listar.Cargos.Todos, "titulo", "id");

            Preencher.ComboBox(especialidade_default, Listar.Especialidades.Todos, "titulo", "id");
            Preencher.ListBox(boxEspecialidades, Listar.Especialidades.Todos, "titulo", "id");

            Atualizar_estabelecimento_Info();
        }
Exemplo n.º 6
0
        void Preencher_Etiquetas()
        {
            Preencher.ComboBox(sexo_input, Tabela.Sexos, "sexo");
            Preencher.ComboBox(uf_input, Tabela.Estados, "estado");
            Preencher.ComboBox(registro_uf_input, Tabela.Estados, "estado");
            Preencher.ComboBox(cargo_input, Listar.Cargos.Todos, "titulo", "id");
            Preencher.ComboBox(especialidade_input, Listar.Especialidades.Todos, "titulo", "id");

            especialidade_input.SelectedValue = Buscar.Estabelecimento.EspecialidadeNenhuma;
        }
Exemplo n.º 7
0
        public Administracao()
        {
            InitializeComponent();

            Preencher.ComboBox(uf_input, Tabela.Estados, "estado");
            Preencher.ComboBox(abertura_input, Tabela.Horario.Geral, "hora");
            Preencher.ComboBox(fechamento_input, Tabela.Horario.Geral, "hora");
            Preencher.ComboBox(atendimento_input, Tabela.TempoDeAtendimento, "tempo");

            Preencher_dgv_funcionarios(null, null);
            Preencher_cargos_especialidades();
        }
Exemplo n.º 8
0
        void Preencher_dgv_agendamentos(object sender, EventArgs e)
        {
            try
            {
                Datas.Agora = Convert.ToDateTime(agendamentos_search.Text);
            }catch (Exception ex)
            {
                Datas.Agora = Convert.ToDateTime(Datas.HojeFormatada);
            }
            Preencher.GridView(dgv_agendamentos, Listar.Agendamentos.PorDia(Datas.Agora), Etiquetas.agendamentos, Etiquetas.agendamentos_weights, false);

            lbl_naoHaAgendamentos.Visible = dgv_agendamentos.Rows.Count.Equals(0);
        }
Exemplo n.º 9
0
        void Atualizar_estabelecimento_Info()
        {
            if (!Buscar.Estabelecimento.Info.Rows.Count.Equals(0))
            {
                row = Buscar.Estabelecimento.Info.Rows[0];

                Preencher.Panel(editor, row);
                Preencher.Panel(cargoEspecialidade_padrao, row, 16);

                cargoEspecialidade_padrao.Visible = !especialidade_default.Items.Count.Equals(0) && !cargo_default.Items.Count.Equals(0);
                btn_novoFuncionario.Visible       = !Buscar.Estabelecimento.CargoTecnico.Equals(0) && !Buscar.Estabelecimento.EspecialidadeNenhuma.Equals(0);
            }
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
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);
        }
Exemplo n.º 12
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);
        }
Exemplo n.º 13
0
        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);
        }
Exemplo n.º 14
0
 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();
 }
Exemplo n.º 15
0
        public Cadastro()
        {
            InitializeComponent();
            Preencher_Etiquetas();

            funcionarios_inputs.Visible = Buscar.Editor.Type.Equals("funcionario");
            nascimento_input.MaxDate    = Datas.Hoje;
            nascimento_input.Text       = Datas.HojeFormatada;

            Text = "{acao} de {ator}";
            Text = Text.Replace("{acao}", Buscar.Editor.ID.Equals(0) ? "Cadastrar" : "Editar dados");
            Text = Text.Replace("{ator}", Buscar.Editor.Type);

            Height -= Buscar.Editor.ID.Equals(0) ? habilitar_edicao_input.Height : 0;
            Height -= Buscar.Editor.Type.Equals("funcionario") ? 0 : funcionarios_inputs.Height;

            if (!Buscar.Editor.CPF.Equals(string.Empty))
            {
                cpf_input.Text    = Buscar.Editor.CPF;
                cpf_input.Enabled = cpf_label.Enabled = false;
            }

            if (!Buscar.Editor.ID.Equals(0))
            {
                row = Buscar.Executar.Reader("usp_buscar_{t}".Replace("{t}", Buscar.Editor.Type), Buscar.Editor.ID).Rows[0];

                Preencher.Panel(comum_inputs, row, 1);

                if (Buscar.Editor.Type.Equals("funcionario"))
                {
                    Preencher.Panel(funcionarios_inputs, row, 15);
                }

                cpf_label.Enabled = cpf_input.Enabled = editor.Enabled = false;
                habilitar_edicao_input.Visible = true;
            }
        }
Exemplo n.º 16
0
 void Preencher_agendamentos_search()
 {
     Preencher.ComboBox(agendamentos_search, Listar.Agendamentos.Datas(), "dia");
     agendamentos_search.SelectedValue = Datas.HojeFormatada;
 }
Exemplo n.º 17
0
        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();
            }
        }