예제 #1
0
        protected void DropDownListTipo_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DropDownListArea.DataSource     = new ManterRegiaoAtendimento().ConsultaRegiaoAtendimentos();
                DropDownListArea.DataTextField  = "Regiao";
                DropDownListArea.DataValueField = "Id";
                DropDownListArea.DataBind();
                DropDownListArea.Items.Insert(0, new ListItem("Selecione a regiao", "0"));

                DropDownListEspec.DataSource     = new ManterEspecialidade().ConsultaEspecialidades();
                DropDownListEspec.DataTextField  = "NomeEspec";
                DropDownListEspec.DataValueField = "Id";
                DropDownListEspec.DataBind();
                DropDownListEspec.Items.Insert(0, new ListItem("Selecione a especialidade", "0"));

                DropDownListEmpresa.DataSource     = new ManterEmpresa().ConsultaEmpresas();
                DropDownListEmpresa.DataTextField  = "NomeEmpresa";
                DropDownListEmpresa.DataValueField = "Id";
                DropDownListEmpresa.DataBind();
                DropDownListEmpresa.Items.Insert(0, new ListItem("Selecione a empresa", "0"));
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                {
                    Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                }
                IdEmpresa = (int)(Session["idEmpresa"]);

                if (!Page.IsPostBack)
                {
                    Mensagem = "Cadastro de usuário.";
                    DropDownListTipo.DataSource = new ManterUsuario().GetRegrasUsuario();
                    DropDownListTipo.Items.Insert(0, new ListItem("Selecione o tipo de usuário", "0"));

                    Endereco.Disabled = true;

                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                    {
                        Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                    }

                    Mensagem = "Alteração de informação de uma empresa.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);

                    if (Request.QueryString["Id"] != null)
                    {
                        ObjEmpresa.Id = Convert.ToInt32(Request.QueryString["Id"]);
                        ObjEmpresa    = new ManterEmpresa(ObjEmpresa).ConsultaEmpresaById();

                        Empresa.Value     = ObjEmpresa.NomeEmpresa;
                        Endereco.Value    = ObjEmpresa.Endereco;
                        Complemento.Value = ObjEmpresa.Complemento;
                        CEP.Value         = ObjEmpresa.Cep;
                        Telefone.Value    = ObjEmpresa.Telefone;
                    }
                }
                catch (Exception Ex)
                {
                    LogException.InsereLogBd(Ex);
                    MsgLabel.Text = LogException.CodigoErroBd();
                }
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    Mensagem = "Suas configurações.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);

                    ObjUsuario.Id = Convert.ToInt32(Session["id"]);

                    ObjUsuario = new ManterUsuario(ObjUsuario).ConsultaUsuarioById();

                    Nome.Value        = ObjUsuario.Nome;
                    Endereco.Value    = ObjUsuario.Endereco;
                    Telefone.Value    = ObjUsuario.Telefone;
                    Complemento.Value = ObjUsuario.Complemento;
                    CEP.Value         = ObjUsuario.Cep;
                    Email.Value       = ObjUsuario.Email;
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                    {
                        Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                    }

                    Mensagem = "Alteração de informações da região de atendimento.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);

                    if (Request.QueryString["Id"] != null)
                    {
                        ObjRegiao.Id = Convert.ToInt32(Request.QueryString["Id"]);

                        ObjRegiao = new ManterRegiaoAtendimento(ObjRegiao).ConsultaRegiaoAtendimentoById();

                        Regiao.Value = ObjRegiao.Regiao;
                        Cidade.Value = ObjRegiao.Cidade;
                        Estado.Value = ObjRegiao.Estado;
                    }
                }
                catch (Exception Ex)
                {
                    LogException.InsereLogBd(Ex);
                    MsgLabel.Text = LogException.CodigoErroBd();
                }
            }
        }
예제 #6
0
        protected void AlterarButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["Id"] != null)
                {
                    ObjRegiao.Id     = Convert.ToInt32(Request.QueryString["Id"]);
                    ObjRegiao.Regiao = Regiao.Value;
                    ObjRegiao.Cidade = Cidade.Value;
                    ObjRegiao.Estado = Estado.Value;

                    if (new ManterRegiaoAtendimento(ObjRegiao).AlteraRegiaoAtendimento())
                    {
                        Mensagem = "Região de atendimento alterada com sucesso.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                    else
                    {
                        Mensagem = "Não foi possível alterar a região de atendimento.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #7
0
 protected void RelacionarButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (DropDownListUsuario.SelectedIndex > 0 && DropDownListRegiao.SelectedIndex > 0)
         {
             ObjUsuario.Id           = Convert.ToInt32(DropDownListUsuario.SelectedValue);
             ObjUsuario.Regra        = DropDownListTipo.SelectedValue;
             ObjUsuario.ObjRegiao.Id = Convert.ToInt32(DropDownListRegiao.SelectedValue);
             if (new ManterUsuario(ObjUsuario).RelacionaUsuarioAreaAtendimento())
             {
                 Mensagem = "Usuário e região relacionados com sucesso.";
                 ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
             }
             else
             {
                 Mensagem = "Não foi possível relacionar usuário e região.";
                 ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
             }
         }
     }
     catch (Exception Ex)
     {
         LogException.InsereLogBd(Ex);
         MsgLabel.Text = LogException.CodigoErroBd();
     }
 }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                    {
                        Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                    }

                    Mensagem = "Relacionamento de usuário e região.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);

                    Perfis.Add("Técnico");
                    Perfis.Add("Cliente");

                    DropDownListTipo.Items.Insert(0, new ListItem("Selecione o tipo de usuário", "0"));
                    DropDownListTipo.Items.Insert(1, new ListItem("Técnico", "1"));
                    DropDownListTipo.Items.Insert(2, new ListItem("Cliente Físico", "2"));
                    DropDownListTipo.Items.Insert(3, new ListItem("Cliente Jurídico", "3"));

                    DropDownListRegiao.DataSource     = new ManterRegiaoAtendimento().ConsultaRegiaoAtendimentos();
                    DropDownListRegiao.DataTextField  = "Regiao";
                    DropDownListRegiao.DataValueField = "Id";
                    DropDownListRegiao.Items.Insert(0, new ListItem("Selecione a regiao", "0"));
                }
                catch (Exception Ex)
                {
                    LogException.InsereLogBd(Ex);
                    MsgLabel.Text = LogException.CodigoErroBd();
                }
            }
        }
예제 #9
0
        protected void ButtonChamar_Click(object sender, EventArgs e)
        {
            try
            {
                ListaUsuario.Clear();

                ChamarTecnico = true;
                EntrarChat    = false;

                Perfil.Add("Técnico");
                Perfil.Add("Gestor");
                Perfil.Add("Atendente");

                foreach (var ObjTecnico in new ManterUsuario().ConsultaUsuariosByPerfil(Perfil))
                {
                    Usuario ObjUsuario = FactoryUsuario.GetNew(TipoUsuario.UsuarioFuncionario);

                    if (!ObjTecnico.IdMS.Equals(Session["idms"]))
                    {
                        ObjUsuario.Id    = ObjTecnico.Id;
                        ObjUsuario.Login = ObjTecnico.Login;
                        ObjUsuario.Nome  = ObjTecnico.Nome;
                        ObjUsuario.IdMS  = ObjTecnico.IdMS;

                        ListaUsuario.Add(ObjUsuario);
                    }
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #10
0
        protected void GerarRelatorioChamado_Click(object sender, EventArgs e)
        {
            try
            {
                if (filtrosChm.SelectedIndex == 0)
                {
                    foreach (var Itens in filtrosChm.Items)
                    {
                        ObjRelatorio.FiltroRelatorio += "and" + Itens + ", ";
                    }
                }
                if (filtrosPrioridade.SelectedIndex == 0)
                {
                    foreach (var Itens in filtrosPrioridade.Items)
                    {
                        ObjRelatorio.FiltroRelatorio += "and" + Itens + ", ";
                    }
                }

                Response.Redirect("\\Views\\SGA\\VRelatorio\\RelatorioChamados.aspx?Relatorio=Chamados", false);
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #11
0
        protected void CadastrarButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (DropDownListTpServico.SelectedIndex > 0)
                {
                    ObjServico          = FactoryServico.GetNewServico();
                    ObjServico.IdTipo   = Convert.ToInt32(DropDownListTpServico.SelectedValue);
                    ObjServico.NomeServ = Nome.Value;
                    ObjServico.DescServ = DescServ.Value;
                    ObjServico.Sla      = Convert.ToDouble(SLA.Value);

                    if (new ManterServico(ObjServico).CadastraServico())
                    {
                        Mensagem = "Serviço cadastrado com sucesso.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                    else
                    {
                        Mensagem = "Não foi possível cadastrar o serviço";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                {
                    Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                }

                if (!Page.IsPostBack)
                {
                    Mensagem = "Consulta relacionamento entre usuário e especialidade.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }

                foreach (var ObjAT in new ManterUsuario(ObjUsrRela).ConsultaUsuarioEspecialidade())
                {
                    ListaUsrRegiao.Add(ObjAT);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #13
0
        protected void CadastrarButton_Click(object sender, EventArgs e)
        {
            try
            {
                Especialidade ObjEspec = FactoryEspecialidade.GetNew();
                ObjEspec.NomeEspec = Espec.Value;
                ObjEspec.DescEspec = DetalhesEspec.Value;

                if (new ManterEspecialidade(ObjEspec).CadastraEspecialidade())
                {
                    Mensagem = "Especialidade cadastrada com sucesso.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
                else
                {
                    Mensagem = "Não foi possível cadastrar a especialidade.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                    {
                        Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                    }

                    Mensagem = "Relacionamento entre serviço e especialidade.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);

                    DropDownListServ.DataSource     = new ManterServico().ConsultaServicos();
                    DropDownListServ.DataTextField  = "NomeServ";
                    DropDownListServ.DataValueField = "Id";
                    DropDownListServ.Items.Insert(0, new ListItem("Selecione o serviço", "0"));

                    DropDownListEspec.DataSource     = new ManterEspecialidade().ConsultaEspecialidades();
                    DropDownListEspec.DataTextField  = "NomeEspec";
                    DropDownListEspec.DataValueField = "Id";
                    DropDownListEspec.Items.Insert(0, new ListItem("Selecione a especialidade", "0"));
                }
                catch (Exception Ex)
                {
                    LogException.InsereLogBd(Ex);
                    MsgLabel.Text = LogException.CodigoErroBd();
                }
            }
        }
예제 #15
0
        protected void BotaoEntrar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!TxtLogin.Text.Equals("") && !TxtSenha.Text.Equals(""))
                {
                    if (ManterLogin.Logar(TxtLogin.Text, TxtSenha.Text))
                    {
                        ObjUsuario       = FactoryUsuario.GetNew(TipoUsuario.Usuario);
                        ObjUsuario.Login = TxtLogin.Text;

                        TxtLogin.Visible           = true;
                        ObjUsuario                 = new ManterUsuario(ObjUsuario).GetUsuarioEmpresa();
                        Session["usuario"]         = TxtLogin.Text;
                        InfoGlobal.GlobalIdEmpresa = ObjUsuario.IdEmpresa;
                        FormsAuthentication.RedirectFromLoginPage(TxtLogin.Text, true);
                        Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                    }
                    else
                    {
                        MsgLabel.Text = "Login ou senha inválidos.";
                    }
                }
                else
                {
                    MsgLabel.Text = "Login ou senha não preenchidos.";
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #16
0
        protected void AlterarButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["Id"] != null)
                {
                    ObjEspec.Id        = Convert.ToInt32(Request.QueryString["Id"]);
                    ObjEspec.NomeEspec = Espec.Value;
                    ObjEspec.DescEspec = DetalhesEspec.Value;

                    if (new ManterEspecialidade(ObjEspec).AlteraEspecialidade())
                    {
                        Mensagem = "Especialidade alterada com sucesso.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                    else
                    {
                        Mensagem = "Não foi possível alterar a especialidade.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #17
0
        protected void CadastrarButton_Click(object sender, EventArgs e)
        {
            try
            {
                Empresa ObjEmpresa = FactoryEmpresa.GetNew();
                ObjEmpresa.NomeEmpresa = Empresa.Value;
                ObjEmpresa.Endereco    = Endereco.Value;
                ObjEmpresa.Complemento = Complemento.Value;
                ObjEmpresa.Cep         = CEP.Value;
                ObjEmpresa.Telefone    = Telefone.Value;

                if (new ManterEmpresa(ObjEmpresa).CadastraEmpresa())
                {
                    Mensagem = "Empresa cadastrada com sucesso.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
                else
                {
                    Mensagem = "Não foi possível cadastrar a especialidade.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #18
0
        protected void RelacionarButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (DropDownListEspec.SelectedIndex > 0 && DropDownListServ.SelectedIndex > 0)
                {
                    ObjEspec.Id = Convert.ToInt32(DropDownListEspec.SelectedValue);
                    ObjServ.Id  = Convert.ToInt32(DropDownListServ.SelectedValue);

                    if (new ManterEspecialidade(ObjEspec, ObjServ).RelacionaEspecServ())
                    {
                        Mensagem = "Especialidade e serviço relacionados com sucesso.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                    else
                    {
                        Mensagem = "Não foi possível relacionar a especialidade e o serviço";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
                else
                {
                    Mensagem = "Selecione as opções.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
        protected void CadastrarButton_Click(object sender, EventArgs e)
        {
            try
            {
                RegiaoAtendimento ObjRegiao = FactoryRegiao.GetNew();
                ObjRegiao.Regiao = Regiao.Value;
                ObjRegiao.Cidade = Cidade.Value;
                ObjRegiao.Estado = Estado.Value;

                if (new ManterRegiaoAtendimento(ObjRegiao).CadastraRegiaoAtendimento())
                {
                    Mensagem = "Região de atendimento cadastrada com sucesso.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
                else
                {
                    Mensagem = "Não foi possível cadastrar a região de atendimento.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (!Session["perfil"].Equals("Gestor") && !Session["perfil"].Equals("Administrador"))
                    {
                        Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                    }

                    Mensagem = "Alteração de informações da especialidade.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);

                    if (Request.QueryString["Id"] != null)
                    {
                        ObjEspec.Id = Convert.ToInt32(Request.QueryString["Id"]);
                        ObjEspec    = new ManterEspecialidade(ObjEspec).ConsultaEspecialidadeById();

                        Espec.Value         = ObjEspec.NomeEspec;
                        DetalhesEspec.Value = ObjEspec.DescEspec;
                    }
                }
                catch (Exception Ex)
                {
                    LogException.InsereLogBd(Ex);
                    MsgLabel.Text = LogException.CodigoErroBd();
                }
            }
        }
예제 #21
0
        protected void AlterarButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["Id"] != null && DropDownListTpServico.SelectedIndex > 0)
                {
                    ObjServico.Id       = Convert.ToInt32(Request.QueryString["Id"]);
                    ObjServico.IdTipo   = Convert.ToInt32(DropDownListTpServico.SelectedValue);
                    ObjServico.NomeServ = Nome.Value;
                    ObjServico.DescServ = DescServ.Value;
                    ObjServico.Sla      = Convert.ToDouble(SLA.Value);

                    if (new ManterServico(ObjServico).AlteraServico())
                    {
                        Mensagem = "Serviço modificado com sucesso.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                    else
                    {
                        Mensagem = "Não foi possível modificar o serviço.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
                else
                {
                    Mensagem = "Selecione todas as opções.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Session["perfil"].Equals("Cliente Físico") && !Session["perfil"].Equals("Cliente Jurídico") && !Session["perfil"].Equals("Técnico") && !Session["perfil"].Equals("Administrador"))
                {
                    Response.Redirect("\\Views\\SGA\\Inicio.aspx", false);
                }

                if (!"".Equals(Request.QueryString["IdCliente"]) && Session["perfil"].Equals("Técnico"))
                {
                    ObjGeo.IdUsr = Convert.ToInt32(Request.QueryString["IdCliente"]);
                    ObjGeo       = new ManterGeo(ObjGeo).GetClienteLocalizacao();
                    Mensagem     = "Localização do cliente.";
                }

                if (!"".Equals(Request.QueryString["IdTecnico"]) && Session["perfil"].Equals("Cliente Físico") || !"".Equals(Request.QueryString["IdTecnico"]) && Session["perfil"].Equals("Cliente Jurídico"))
                {
                    ObjGeo.IdUsr        = Convert.ToInt32(Request.QueryString["IdTecnico"]);
                    ObjGeo              = new ManterGeo(ObjGeo).GetTecnicoLocalizacao();
                    ObjGeoCliente.IdUsr = Convert.ToInt32(Session["id"]);
                    ObjGeoCliente       = new ManterGeo(ObjGeoCliente).GetClienteLocalizacao();

                    Mensagem = "Localização do técnico.";
                }

                ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #23
0
        protected void AvaliarButton_Click(object sender, EventArgs e)
        {
            try
            {
                ObjAvaliacao.IdChamado  = ObjAtend.IdChamado;
                ObjAvaliacao.IdAtend    = ObjAtend.Id;
                ObjAvaliacao.AvaAtend   = RatingAtendimento.CurrentRating;
                ObjAvaliacao.AvaChamado = RatingChamado.CurrentRating;
                ObjAvaliacao.Comentario = Comentario.Value;

                if (new ManterAvaliacao(ObjAvaliacao).IncluiAvaliacao())
                {
                    Response.Redirect("\\Views\\SGA\\VChamado\\ConsultaChamado.aspx?IdChamado=" + ObjAtend.IdChamado + "&Mensagem=Avaliado", false);
                }
                else
                {
                    Mensagem = "Ocorreu um erro ao avaliar.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (System.Data.SqlClient.SqlException)
            {
                Response.Redirect("\\Views\\SGA\\VChamado\\ConsultaChamado.aspx?IdChamado=" + ObjAtend.IdChamado + "&Mensagem=AvaliadoAnt", false);
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #24
0
        protected void AlterarButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (Request.QueryString["Id"] != null)
                {
                    ObjUsuario.Id          = Convert.ToInt32(Request.QueryString["Id"]);
                    ObjUsuario.Nome        = Nome.Value;
                    ObjUsuario.Endereco    = Endereco.Value;
                    ObjUsuario.Telefone    = Telefone.Value;
                    ObjUsuario.Complemento = Complemento.Value;
                    ObjUsuario.Cep         = CEP.Value;

                    if (new ManterUsuario(ObjUsuario).AlteraUsuario())
                    {
                        Mensagem = "Usuário alterado com sucesso.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                    else
                    {
                        Mensagem = "Não foi possível alterar o usuário";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #25
0
        protected void Recusar_Click(object sender, EventArgs e)
        {
            try
            {
                RecusarClick = true;

                if (!RecusarMotivo.Value.Equals(""))
                {
                    ObjAtend.MotivoRecusa = RecusarMotivo.Value;

                    if (new ManterAtendimento(ObjAtend, ObjChamado).RecusaAtendimentoChamado())
                    {
                        Response.Redirect("\\Views\\SGA\\VChamado\\ConsultaChamado.aspx?IdChamado=" + ObjChamado.Id + "&Mensagem=Recusado", false);
                    }
                    else
                    {
                        Mensagem = "Ocorreu um problema ao recusar o atendimento deste chamado.";
                        ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                    }
                }
                else
                {
                    Mensagem = "Justifique o motivo de recusar o atendimento deste chamado.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #26
0
        protected void AbrirButton_Click(object sender, EventArgs e)
        {
            try
            {
                ObjChamado      = FactoryChamado.GetNew();
                ObjUsuario.Nome = Membership.GetUser().ToString();

                if (DropDownListTpServico.SelectedIndex > 0 && DropDownListServico.SelectedIndex > 0 && DropDownListPrioridade.SelectedIndex > 0 || PerfilFunc && DropDownListTpServico.SelectedIndex > 0 && DropDownListServico.SelectedIndex > 0 && DropDownListPrioridade.SelectedIndex > 0 && DropDownListCliente.SelectedIndex > 0)
                {
                    if (PerfilFunc)
                    {
                        ObjChamado.IdCliente    = Convert.ToInt32(DropDownListCliente.SelectedValue);
                        ObjChamado.IdPrioridade = Convert.ToInt32(DropDownListPrioridade.SelectedValue);
                        ObjUsuario.Id           = ObjChamado.IdCliente;

                        ObjUsuario = new ManterUsuario(ObjUsuario).ConsultaUsuarioById();

                        foreach (var RegiaoUsr in new ManterUsuario(ObjUsuario).GetIdRegiaoAtendByUsr())
                        {
                            ObjAtend.IdRegiaoAtendimento = RegiaoUsr;
                        }
                    }
                    else
                    {
                        ObjUsuario.Id           = (int)Session["id"];
                        ObjUsuario              = new ManterUsuario(ObjUsuario).ConsultaUsuarioById();
                        ObjChamado.IdPrioridade = Convert.ToInt32(DropDownListPrioridade.SelectedValue);
                        ObjChamado.IdCliente    = ObjUsuario.Id;

                        foreach (var RegiaoUsr in new ManterUsuario(ObjUsuario).GetIdRegiaoAtendByUsr())
                        {
                            ObjAtend.IdRegiaoAtendimento = RegiaoUsr;
                        }
                    }

                    ObjChamado.Assunto   = Assunto.Value;
                    ObjChamado.Descricao = Descricao.Value;
                    ObjChamado.IdServico = Convert.ToInt32(DropDownListServico.SelectedValue);

                    if (new ManterChamado(ObjChamado, ObjUsuario, ObjAtend).AbreChamado())
                    {
                        ObjChamado.Id = new ManterChamado().GetUltIdChamado();
                    }
                }
                else
                {
                    Mensagem = "Selecione as opções para abertura do chamado.";
                    ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
                }
            }
            catch (Exception Ex)
            {
                ObjChamado = null;
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Mensagem     = "Consulta de chamados.";
                MensagemTela = Mensagem;

                if (!"".Equals(Request.QueryString["IdTecnico"]) && Session["perfil"].Equals("Técnico"))
                {
                    ObjUsuario.Id = Convert.ToInt32(Request.QueryString["IdTecnico"]);
                    Mensagem      = "Histórico de atendimentos.";
                    MensagemTela  = Mensagem;
                }

                if ("true".Equals(Request.QueryString["Fila"]))
                {
                    ObjChamado.Fila = true;
                    Mensagem        = "Fila de atendimento.";
                    MensagemTela    = Mensagem;
                }
                else
                {
                    ObjChamado.Fila = false;
                }
                if (Session["perfil"].Equals("Cliente Físico") || Session["perfil"].Equals("Cliente Jurídico"))
                {
                    ObjUsuario.Id     = Convert.ToInt32(Session["id"]);
                    ObjUsuario.Perfil = "Cliente";
                    Mensagem          = "Lista de seus chamados e seus respectivos atendimentos.";
                    MensagemTela      = Mensagem;
                }

                foreach (var Result in new ManterChamado(ObjChamado, ObjUsuario).ConsultaChamados())
                {
                    ObjServico.Id      = Result.IdServico;
                    ObjStatusChm.Id    = Result.IdStatus;
                    ObjAtend.IdChamado = Result.Id;

                    foreach (var Tecnico in new ManterAtendimento(ObjAtend, ObjUsuario).ConsultaTecnicoAtendByChamado())
                    {
                        NomeTecnico.Add(Tecnico.Nome);
                        NomeServico.Add(new ManterServico(ObjServico).ConsultaServicoById().NomeServ);
                        NomeStatus.Add(new ManterStatusChamado(ObjStatusChm).ConsultaStatusChamadoById().NomeStatus);
                        ListaChamado.Add(Result);
                    }
                }

                ScriptManager.RegisterStartupScript(this, GetType(), "CallMyFunction", "Alerta('" + Mensagem + "')", true);
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                Page.DataBind();
                ListaNotificacao.Clear();

                if (Session["usuario"] == null)
                {
                    Response.Redirect("\\Views\\Login\\Login.aspx");
                }
                else
                {
                    ObjUsuario.Login = Membership.GetUser().ToString();
                    ObjUsuario       = new ManterUsuario(ObjUsuario).GetUsuarioEmpresa();

                    Session["id"]        = ObjUsuario.Id;
                    Session["idms"]      = ObjUsuario.IdMS;
                    Session["usuario"]   = ObjUsuario.Login;
                    Session["nome"]      = ObjUsuario.Nome;
                    Session["empresa"]   = ObjUsuario.NomeEmpresa;
                    Session["idEmpresa"] = ObjUsuario.IdEmpresa;
                    Session["perfil"]    = Roles.GetRolesForUser(ObjUsuario.Login)[0];

                    InfoGlobal.GlobalIdEmpresa = ObjUsuario.IdEmpresa;

                    Page.Header.DataBind();
                    NomeUsuario = (string)(Session["nome"]);


                    ObjNotificacao.IdDest = ObjUsuario.Id;

                    foreach (var Notifica in new ManterNotificacao(ObjNotificacao).InformaNotificacao())
                    {
                        if (Notifica.IdTipo.Equals(4))
                        {
                            TemNotificacao = true;
                        }
                        if (Notifica.IdTipo.Equals(1) || Notifica.IdTipo.Equals(2))
                        {
                            TemNotificacaoChat = true;
                        }

                        ListaNotificacao.Add(Notifica);
                    }
                }
            }
            catch (Exception Ex)
            {
                LogException.InsereLogBd(Ex);
                MsgLabel.Text = LogException.CodigoErroBd();
            }
        }
예제 #29
0
 protected void GerarRelatorioRecusa_Click(object sender, EventArgs e)
 {
     try
     {
         Response.Redirect("\\Views\\SGA\\VRelatorio\\RelatorioChamados.aspx?Relatorio=RecusaAtend", false);
     }
     catch (Exception Ex)
     {
         LogException.InsereLogBd(Ex);
         MsgLabel.Text = LogException.CodigoErroBd();
     }
 }
예제 #30
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         GC.Collect();
     }
     catch (Exception Ex)
     {
         LogException.InsereLogBd(Ex);
         MsgLabel.Text = LogException.CodigoErroBd();
     }
 }