Ejemplo n.º 1
0
        public JsonResult JsVerificaHorario(string dtAgendamento, string hora, int idFuncionario)
        {
            var dao   = new AgendamentosDAO();
            var valid = dao.validHorario(dtAgendamento, hora, idFuncionario);
            var type  = string.Empty;
            var msg   = string.Empty;

            if (valid)
            {
                type = "success";
                msg  = "Horario Disponivel!";
            }
            else
            {
                type = "danger";
                msg  = "Já existe Horario marcado, verifique!";
            }
            var result = new
            {
                type    = type,
                message = msg,
            };

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var agendaDAO = new AgendamentosDAO();

            ModelState.Clear();
            return(View(agendaDAO.SelecionarAgendamento()));
        }
Ejemplo n.º 3
0
 public RelObras()
 {
     InitializeComponent();
     obrasDAO = new ObrasDAO();
     projDAO  = new ProjetosDAO();
     fotosDAO = new FotosDAO();
     agendDAO = new AgendamentosDAO();
     path     = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + @"\rel\";
     radioUltimaFoto.Checked = true;
 }
Ejemplo n.º 4
0
 public ActionResult Delete(int id, AgendamentoVW model)
 {
     try
     {
         AgendamentosDAO dao = new AgendamentosDAO();
         dao.DeleteAgendamento(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Ejemplo n.º 5
0
        public MenuPrincipal(string login, int tipoUsuario)
        {
            InitializeComponent();
            acoesDAO    = new AcoesDAO();
            agendDAO    = new AgendamentosDAO();
            cidadesDAO  = new CidadesDAO();
            fotosDAO    = new FotosDAO();
            logsDAO     = new LogsDAO();
            usuariosDAO = new UsuariosDAO();

            this.login       = login;
            this.tipoUsuario = tipoUsuario;

            // Tirar borda 3D
            this.SetBevel(false);
        }
Ejemplo n.º 6
0
        public ActionResult Create(Agenda agenda)
        {
            try
            {
                var agendaDAO = new AgendamentosDAO();

                agenda.flSituacao = "A";

                agendaDAO.InsertAgendamento(agenda);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 7
0
        public ActionResult Cancelar(int id, AgendamentoVW model)
        {
            try
            {
                AgendamentosDAO dao    = new AgendamentosDAO();
                var             aganda = dao.GetAgendamento(id);

                var bean = model.GetAgenda(aganda);
                bean.dtUltAlteracao = DateTime.Now;

                dao.CancelarAgendamento(bean);
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 8
0
        private ActionResult GetView(int id)
        {
            AgendamentosDAO objAgenda      = new AgendamentosDAO();
            ClienteDAO      DAOCliente     = new ClienteDAO();
            FuncionarioDAO  DAOFuncionario = new FuncionarioDAO();
            ServicoDAO      DAOServico     = new ServicoDAO();

            var obj    = objAgenda.GetAgendamento(id);
            var result = new AgendamentoVW
            {
                IdModelPai = obj.IdAgenda,
                //idAgenda = obj.IdAgenda,
                //dtNota = obj.dtAgendamento,
                dtAgendamento     = obj.dtAgendamento,
                flhoraAgendamento = obj.flhoraAgendamento,
                flSituação        = obj.flSituacao,
                IdCliente         = obj.IdCliente,
                IdServico         = obj.IdServico,
                IdFuncionario     = obj.IdFuncionario,
                dtCadastro        = obj.dtCadastro,
                dtUltAlteracao    = obj.dtUltAlteracao
            };
            var objFuncionario = DAOFuncionario.DAOGetFuncionario(result.IdFuncionario);

            result.Funcionario = new ViewModels.Funcionarios.SelectFuncionarioVM {
                IdFuncionario = objFuncionario.IdFuncionario, nmFuncionario = objFuncionario.nmFuncionario
            };

            var objCliente = DAOCliente.DAOGetCliente(result.IdCliente);

            result.Cliente = new ViewModels.Clientes.SelectClienteVM {
                IdCliente = objCliente.IdCliente, nmCliente = objCliente.nmCliente
            };

            var objServico = DAOServico.GetServico(result.IdServico);

            result.Servico = new ViewModels.Servicos.SelectServicoVM {
                IdServico = objServico.IdServico, dsServico = objServico.dsServico, vlServico = Convert.ToDecimal(objServico.vlServico)
            };


            return(View(result));
        }
Ejemplo n.º 9
0
 public Backup()
 {
     InitializeComponent();
     agendDAO    = new AgendamentosDAO();
     cidadesDAO  = new CidadesDAO();
     clientesDAO = new ClientesDAO();
     fornDAO     = new FornecedoresDAO();
     fotosDAO    = new FotosDAO();
     logsDAO     = new LogsDAO();
     obrasDAO    = new ObrasDAO();
     ofDAO       = new ObrasFornecedoresDAO();
     otDAO       = new ObrasTrabalhadoresDAO();
     obsDAO      = new ObservacoesDAO();
     palavrasDAO = new PalavrasProibidasDAO();
     projetosDAO = new ProjetosDAO();
     regCauDAO   = new RegCauDAO();
     regCauPDAO  = new RegCauProjetoDAO();
     regCreaDAO  = new RegCreaDAO();
     regCreaPDAO = new RegCreaProjetoDAO();
     respDAO     = new ResponsavelDAO();
     trabDAO     = new TrabalhadoresDAO();
     usuariosDAO = new UsuariosDAO();
     inserts     = new StringBuilder();
 }
Ejemplo n.º 10
0
        public AddAgendamento(int tipo, string id)
        {
            InitializeComponent();
            this.ActiveControl = textAssunto;
            textPara.Text      = id;

            agendDAO = new AgendamentosDAO();

            switch (tipo)
            {
            case 1:
                this.Text  += " - Projeto";
                projetosDAO = new ProjetosDAO();
                break;

            case 2:
                this.Text        += " - Obra";
                label1.Text       = "Código da Obra";
                textPara.Location = new System.Drawing.Point(99, 12);
                textPara.Size     = new System.Drawing.Size(214, 20);
                obrasDAO          = new ObrasDAO();
                break;
            }
        }