public static string AtenderChamado(int numeroDetalhes) { string ds_retorno = "Erro entre em contato com Administrador do sistema"; try { if (numeroDetalhes > 0) { int retorno = 0; daoChamados bdc = new daoChamados(); retorno = bdc.pro_setAceitaChamado(numeroDetalhes, usuario); if (retorno > 0) { ds_retorno = "CHAMADO ACEITO"; } } else { } } catch (Exception ex) { ex.ToString(); } return(ds_retorno); }
private void GravaChamando() { int id_grupo = 0; if (dropArea.SelectedValue != "SELECIONE" && dropAsssunto.SelectedValue != "SELECIONE") { if (Session["acessoLogin"] != null) { AcessoLogin acessoLogin = (AcessoLogin)Session["acessoLogin"]; // if (acessoLogin.idFranquia > 0) // { daogetChamados bdc = new daogetChamados(); DataTable dt_valida = new DataTable(); dt_valida = bdc.ValidaChamado(acessoLogin.idFranquia, Convert.ToInt32(dropAsssunto.SelectedValue)); if (dt_valida.Rows.Count > 0) { Mensagem("EXISTE UM CHAMADO COM O MESMO MOTIVO EM ABERTO.."); } else { daoChamados bda = new daoChamados(); int id_motivo = Convert.ToInt32(dropAsssunto.SelectedValue); StringBuilder ds_descricao = new StringBuilder(txtDescricao.Text); int franquia = acessoLogin.idFranquia; string userChamado = txtNome.Text; int area = Convert.ToInt32(dropArea.SelectedValue); int exec = 0; if (Session["id_grupo"] != null) { id_grupo = Convert.ToInt32(Session["id_grupo"].ToString()); } exec = bda.pro_setGravaChamada(id_motivo, ds_descricao, franquia, userChamado, id_grupo); if (exec > 0) { Mensagem("CHAMADO ABERTO COM SUCESSO: " + exec.ToString()); txtStatus.Text = "ABERTO"; EnviaEmail(dropArea.SelectedItem.Text, ds_descricao, txtSLA.Text, exec, area); } else { Mensagem("NÃO FOI POSSIVEL ABRIR SEU CHAMADO:"); } } // } // else // { // Mensagem("USUÁRIO NÃO PERTENCE A NENHUMA FRANQUIA"); // } } else { Response.Redirect("../../Login.aspx"); } } else { Mensagem("FAVOR PREENCHER TODAS AS INFORMAÇÕES:"); } }
protected void dropAsssunto_SelectedIndexChanged(object sender, EventArgs e) { if (dropAsssunto.SelectedValue != "SELECIONE") { int id_assunto = Convert.ToInt32(dropAsssunto.SelectedValue); daoChamados bda = new daoChamados(); DataSet dt = new DataSet(); dt = bda.GetSla(id_assunto); if (dt.Tables[0].Rows.Count > 0) { txtSLA.Text = dt.Tables[0].Rows[0]["sla"].ToString() + ".Hs"; } } }
private void BuscaDepartamento() { DataTable dsDepartamento = new DataTable(); daoChamados bda = new daoChamados(); int tipo = Convert.ToInt32(Session["fl_abertura"].ToString()); dsDepartamento = bda.GetDepartamentos(tipo); if (dsDepartamento.Rows.Count > 0) { dropArea.DataSource = dsDepartamento; dropArea.DataBind(); dropArea.Items.Insert(0, "SELECIONE"); } }
protected void dropArea_SelectedIndexChanged(object sender, EventArgs e) { if (dropArea.SelectedValue != "SELECIONE") { int Depto = Convert.ToInt32(dropArea.SelectedValue); daoChamados bda = new daoChamados(); DataTable dt = new DataTable(); dt = bda.GetAssuntoDepartamentos(Depto); if (dt.Rows.Count > 0) { dropAsssunto.DataSource = dt; dropAsssunto.DataBind(); dropAsssunto.Items.Insert(0, "SELECIONE"); } } }
public static string GravaComentarios(int numero, string novomen, string antigamen) { if (numero > 0 && novomen != "") { daoChamados bdc = new daoChamados(); string obs = novomen + " Data: " + DateTime.Now + " Usuario: " + usuario + " " + "\r\n" + antigamen + "\r\n"; int exec = bdc.pro_setGravaObs(numero, obs); if (exec > 0) { EnviaComentarioEmail(antigamen, novomen, "", Convert.ToInt32(numero)); } } else { } return(DateTime.Now.ToString() + " Usuario: " + usuario); }
public static string FinalizarChamado(int numeroDetalhes, string ds_encerramento, string ds_abertura, string ds_observacao) { string ds_retorno = "Não foi possível Gravar dados"; try { if (numeroDetalhes > 0 && ds_encerramento != "") { int retorno = 0; daoChamados bdc = new daoChamados(); retorno = bdc.pro_setEncerraChamado(numeroDetalhes, ds_encerramento); if (retorno > 0) { EnviaEmail(ds_abertura, ds_encerramento, "", numeroDetalhes); GravaComentarios(numeroDetalhes, ds_encerramento, ds_observacao); } } } catch (Exception ex) { ex.ToString(); } return(ds_retorno); }
public static string ReabrirChamado(int numeroDetalhes, string ds_encerramento, string ds_abertura) { string ds_retorno = "Não foi possível Gravar dados"; try { if (numeroDetalhes > 0) { int retorno = 0; daoChamados bdc = new daoChamados(); retorno = bdc.pro_setReabrirChamado(numeroDetalhes); if (retorno > 0) { ds_retorno = "CHAMADO REABERTO"; EmailReabrirEmail(ds_abertura, ds_encerramento, "", numeroDetalhes); } } } catch (Exception ex) { ex.ToString(); } return(ds_retorno); }