protected void btVoucher_Click(object sender, EventArgs e) { try { AcessoLogin acessoLogin = (dao.AcessoLogin)Session["acessoLogin"]; dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); if (txtPesquisaVoucher.Value != "") { object retorno = os.set_Voucher(Convert.ToInt32(txtIdOs.Value), Convert.ToInt32(txtPesquisaVoucher.Value), acessoLogin.Nome); if (retorno != null) { lbMensErro.Visible = true; lbMensErro.Text = retorno.ToString(); } else { lbMensErro.Visible = true; lbMensErro.Text = "Erro ao vincular Voucher..."; } } } catch (Exception ex) { lbMensErro.Visible = true; lbMensErro.Text = ex.Message.ToString(); } }
public static string getTecnicos(int nr_os) { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); System.Data.DataTable iPedido = os.getTecnicoslOJAS(nr_os); return(CarSystem.Utilidades.Rede.HTML.tableToJson(iPedido)); }
protected void dropDetalhesMotivos_SelectedIndexChanged(object sender, EventArgs e) { try { if (txtIdOs.Value != "" && dropDetalhesMotivos.SelectedValue != "Selecione") { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); int nr_os = Convert.ToInt32(txtIdOs.Value); os.pro_setItensOs(nr_os, Convert.ToInt32(dropDetalhesMotivos.SelectedValue)); System.Data.DataTable iPedido = os.pro_getDetalhesEncerramento(nr_os); if (iPedido.Rows.Count > 0) { foreach (var item in iPedido.Rows) { messageos.Value = messageos.Value + ((System.Data.DataRow)item).ItemArray[0].ToString().ToString() + "\n"; } } else { messageos.Value = ""; } } } catch (Exception) { throw; } }
public void set_Excluirdetalhe() { try { if (txtIdOs.Value != "" && dropDetalhesMotivos.SelectedValue != "Selecione") { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); os.pro_setExcluirItensOs(Convert.ToInt32(txtIdOs.Value), Convert.ToInt32(dropDetalhesMotivos.SelectedValue)); System.Data.DataTable iPedido = os.pro_getDetalhesEncerramento(Convert.ToInt32(txtIdOs.Value)); if (iPedido.Rows.Count > 0) { foreach (var item in iPedido.Rows) { messageos.Value = messageos.Value + ((System.Data.DataRow)item).ItemArray[0].ToString().ToString() + "\n"; } } else { messageos.Value = ""; } } } catch (Exception) { throw; } }
public static string detalhesOs(int nr_os) { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); System.Data.DataTable iPedido = os.pro_getDetalhesEncerramento(nr_os); return(CarSystem.Utilidades.Rede.HTML.tableToJson(iPedido)); }
private void buscaDetalheMotivo(Int32 nr_os) { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); System.Data.DataTable iPedido = os.pro_getItensMotivoOs(nr_os); dropDetalhesMotivos.DataSource = iPedido; dropDetalhesMotivos.DataBind(); dropDetalhesMotivos.Items.Insert(0, "Selecione"); }
public void InfoEncerramento(int nr_os) { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); System.Data.DataTable iPedido = os.pro_getAMotivoOs(nr_os); dropMotivosAtendimento.DataSource = iPedido; dropMotivosAtendimento.DataBind(); dropMotivosAtendimento.Items.Insert(0, "Selecione"); }
private void buscaDetalheAtendimento(Int32 nr_os) { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); DataTable dt_osMotivo = os.pro_getAMotivoOs(nr_os); dropMotivosAtendimento.DataSource = dt_osMotivo; dropMotivosAtendimento.DataBind(); dropMotivosAtendimento.Items.Insert(0, "Selecione"); }
public void ItensEncerramento(string id) { dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); System.Data.DataTable iPedido = os.pro_getItensMotivoOs(Convert.ToInt32(id)); dropDetalhesMotivos.DataSource = iPedido; dropDetalhesMotivos.DataBind(); dropDetalhesMotivos.Items.Insert(0, "Selecione"); //return CarSystem.Utilidades.Rede.HTML.tableToJson(iPedido); }
// Miguel - inicio - 21/02 // public string set_EncerraOs(int id_status, int nr_os, string problemaResolvido, string ds_medidaAdotada, string ds_acaoServico, string ds_trocaID, string ds_resolvidoPor, string tecnico) // Miguel - fim - 21/02 public int set_EncerraOs(int id_status, int nr_os, string ds_medidaAdotada, string ds_acaoServico, string tecnico) { try { AcessoLogin acessoLogin = (dao.AcessoLogin)Session["acessoLogin"]; dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); if (dropVisita.SelectedValue == "1") { ds_acaoServico = "VISITA"; } // Miguel - inicio - 25/02 // Miguel - inicio - 21/02 // var retorno = os.pro_setOs(id_status, nr_os, problemaResolvido, ds_medidaAdotada, ds_acaoServico, ds_trocaID, ds_resolvidoPor, tecnico, acessoLogin.Nome); var retorno = os.pro_setOs(id_status, nr_os, ds_medidaAdotada, ds_acaoServico, tecnico, acessoLogin.Nome); // Miguel - fim - 21/02 //int retorno = 0; // Miguel - fim - 25/02 if (retorno > 0) { if (txtPesquisa.Value != "") { exibeOSContrato(txtPesquisa.Value, 2); } System.Data.DataTable iPedido = os.pro_getInfOS(Convert.ToInt32(nr_os)); return(retorno); } else { return(retorno); } // exibeOSContrato(txtPesquisa.Value); // return CarSystem.Utilidades.Rede.HTML.tableToJson(iPedido); } catch (Exception) { throw; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Utils.setNomeModulo(Page, "O.S. - O.S. Abertas"); Utils.setVoltarUrl(Page, Session, "~/modulos/OS/OS.aspx"); dao.AcessoLogin acessoLogin = (dao.AcessoLogin)Session["acessoLogin"]; Usuario.Value = acessoLogin.Nome; Cetec.Value = acessoLogin.cdCetec; dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); DataTable dt = os.getOSInstalador(acessoLogin.cdCetec); DataTable dt_os = os.pro_getAcaoOs(acessoLogin.idGrupo); //if (acessoLogin.idGrupo == 39) //{ // DataTable dt_empresa = os.pro_getEmpresa(); // dropEmpresa.DataSource = dt_empresa; // dropEmpresa.DataBind(); // dropEmpresa.Items.Insert(0, "SELECIONE EMPRESA"); // dropEmpresa.Visible = true; // lblEmpresa.Visible = true; //} //else //{ // dropEmpresa.Visible = false; // lblEmpresa.Visible = false; //} dropTecnico.DataSource = dt; dropTecnico.DataBind(); dropTecnico.Items.Insert(0, "SELECIONE TECNICO"); dropAcaoOs.DataSource = dt_os; dropAcaoOs.DataBind(); dropAcaoOs.Items.Insert(0, "SELECIONE AÇÃO"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { dao.AcessoLogin acessoLogin = (dao.AcessoLogin)Session["acessoLogin"]; Usuario.Value = acessoLogin.Nome; Cetec.Value = acessoLogin.cdCetec; Session["nr_os"] = idOSSelecionada.Value; txtIdOs.Value = Session["nr_os"].ToString(); dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); DataTable dt = os.getOSInstalador(acessoLogin.cdCetec); DataTable dt_os = os.pro_getAcaoOs(acessoLogin.idGrupo); if (acessoLogin.idGrupo == 39) { DataTable dt_empresa = os.pro_getEmpresa(); dropEmpresa.DataSource = dt_empresa; dropEmpresa.DataBind(); dropEmpresa.Items.Insert(0, "SELECIONE EMPRESA"); dropEmpresa.Visible = true; lblEmpresa.Visible = true; } else { dropEmpresa.Visible = false; lblEmpresa.Visible = false; } dropTecnico.DataSource = dt; dropTecnico.DataBind(); dropTecnico.Items.Insert(0, "SELECIONE TECNICO"); dropAcaoOs.DataSource = dt_os; dropAcaoOs.DataBind(); dropAcaoOs.Items.Insert(0, "SELECIONE AÇÃO"); } }
public static string set_CancelaOs(int nr_os, string usuariologado, string ds_motivoCancelamento) { // Convert.ToInt32(idOSSelecionada.Value),acessoLogin.cdCetec == "" ? acessoLogin.Nome.Substring(0, 6) : acessoLogin.cdCetec, acessoLogin.Nome, ddlMotivoCancelamento.SelectedValue) try { string retorno = ""; dao.OS.daoOSConsulta os = new dao.OS.daoOSConsulta(); retorno = os.CancelaOS(nr_os, usuariologado, ds_motivoCancelamento); if (retorno == "S") { //System.Data.DataTable iPedido = os.pro_getInfOS(Convert.ToInt32(nr_os)); return("S"); } else { return("N"); } } catch (Exception ex) { return(ex.Message.ToString()); } }
//protected void Delete(object sender, EventArgs e) //{ // dao.OS.daoOSsAberta cancela = new daoOSsAberta(); // AcessoLogin acessoLogin = (dao.AcessoLogin)Session["acessoLogin"]; // idOSSelecionada.Value = (sender as Button).CommandArgument; // string motivo = dropMotivosCancelamento.SelectedValue; // bool retorno = cancela.CancelaOS(Convert.ToInt32(idOSSelecionada.Value), acessoLogin.Nome, acessoLogin.Nome, motivo); //} public void exibeOSContrato(string nr_contrato, int tipo) { // Carrega as OS daoOSsAberta os = new daoOSsAberta(); AcessoLogin acessoLogin = (dao.AcessoLogin)Session["acessoLogin"]; DataTable OSAbertas = os.getCliente(tipo, nr_contrato, acessoLogin.idGrupo, acessoLogin.cdCetec); Session["dt_os"] = OSAbertas; DivResumo.Visible = false; divOs.Visible = false; DivResumo.Visible = false; divVisita.Visible = false; if (OSAbertas.Rows.Count > 0) { slcMotivos.Visible = true; btnEncerrarOs.Visible = true; //lblCancelarOs.Visible = true; btnEncerrarOs.Visible = true; btVoucher.Visible = true; btCancelarOrdem.Visible = true; btnUltimoPacote.Visible = true; primeiraTela.Visible = true; txtPesquisaVoucher.Visible = true; btVoucher.Visible = true; ///lbl_volcher.Visible = true; gridsOS.DataSource = OSAbertas; gridsOS.DataBind(); txtIdOs.Value = OSAbertas.Rows[0][6].ToString(); EtxtNumeroOS.Value = OSAbertas.Rows[0][6].ToString(); txtUltimoId.Value = OSAbertas.Rows[0][9].ToString(); EtxtNumeroPeca.Value = OSAbertas.Rows[0][9].ToString(); TxtTipoOS = OSAbertas.Rows[0][8].ToString(); EtxtTecnico.Value = OSAbertas.Rows[0][5].ToString(); TxtOsStatus = OSAbertas.Rows[0][13].ToString(); TxtInfChamado = OSAbertas.Rows[0][14].ToString(); int tp_Produto = 0; tp_Produto = Convert.ToInt32(OSAbertas.Rows[0][15].ToString()); if (tp_Produto == 0) { btnUltimoPacote.Visible = false; } else { btnUltimoPacote.Visible = true; } // Miguel - inicio - 21 / 02 //txtResolvidoPor.Value = OS.Rows[0][12].ToString(); //Miguel - fim - 21 / 02 //EtxtDetalheAtendimento.Value = OS.Rows[0][8].ToString(); EtxtMedidaAdotada.Value = OSAbertas.Rows[0][11].ToString(); if (txtIdOs.Value != "") { dao.OS.daoOSConsulta daoOs = new dao.OS.daoOSConsulta(); int nr_os = Convert.ToInt32(txtIdOs.Value); System.Data.DataTable iPedido = daoOs.pro_getDetalhesEncerramento(nr_os); if (iPedido.Rows.Count > 0) { EtxtDetalheOs.Value = iPedido.Rows[0][0].ToString(); } } } else { slcMotivos.Visible = false; btCancelarOrdem.Visible = false; primeiraTela.Visible = false; divOs.Visible = false; // Carrega as OS daoOSsAberta UltimaOsEncerrada = new daoOSsAberta(); DataTable UOS = UltimaOsEncerrada.getUltimaOsContrato(nr_contrato); gridsOS.DataSource = OSAbertas; gridsOS.DataBind(); //dropMotivosCancelamento.Visible = false; btnEncerrarOs.Visible = false; ///lblCancelarOs.Visible =false; btVoucher.Visible = false; btCancelarOrdem.Visible = false; if (UOS.Rows.Count > 0) { txtPesquisaVoucher.Visible = false; btVoucher.Visible = false; ///lbl_volcher.Visible = false; EtxtNumeroOS.Value = UOS.Rows[0][0].ToString(); EtxtNumeroPeca.Value = UOS.Rows[0][1].ToString(); EtxtTecnico.Value = UOS.Rows[0][2].ToString(); EtxtDetalheOs.Value = UOS.Rows[0][3].ToString(); EtxtMedidaAdotada.Value = UOS.Rows[0][4].ToString(); } } }