public string insert() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_salvarOcorrencia"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pId_departamento", Id_departamento).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_defeito", Ds_Defeito).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_solucao", Ds_solucao).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDt_entrada", Dt_entrada).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDt_saida", Dt_saida).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_retirante", Nm_retirante).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_status", Ds_status).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_maquina", Nm_maquina).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pPatrimonio_os", Patrimonio_os).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_usuario", Id_usuario).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Ocorrência aberta com sucesso!"; getLastOcorrencia(); MandarHistorico(); } catch (Exception ex) { ds_msg = "Erro ao gravar ocorrência!" + ex.Message; } return(ds_msg); }
public void remove() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_retirarOcorrencia"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pId_departamento", Id_departamento).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_defeito", Ds_Defeito).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_solucao", Ds_solucao).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDt_entrada", Dt_entrada).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDt_saida", Dt_saida).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_retirante", Nm_retirante).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_maquina", Nm_maquina).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_status", Ds_status).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_usuario", Id_usuario).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pPatrimonio_os", Patrimonio_os).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNr_ocorrencia", Nr_ocorrencia).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Ocorrência removida com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao atualizar ocorrência!" + ex.Message; } }
public void update() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_editarDept"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pNm_departamento", Nm_departamento).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_departamento", Id_departamento).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Departamento atualizado com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao atualizar Departamento!" + ex.Message; } }
public string delete() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_deleteResp"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pId_Usuario", Id_usuario).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_Departamento", Id_Departamento).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Responsável deletado com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao deletar responsável!" + ex.Message; } return(ds_msg); }
public string insert() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_salvarDept"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pNm_departamento", Nm_departamento).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Departamento gravado com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao gravar Departamento!" + ex.Message; } return(ds_msg); }
public string insert() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_salvarProcedimento"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pDs_procedimento", Ds_Procedimento).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNr_Ocorrencia", Nr_ocorrencia).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pStatus_Atual", Status_atual).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Procedimento registrado com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao gravar Procedimento!" + ex.Message; } return(ds_msg); }
public void MandarHistorico() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_salvarHistorico"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pDs_defeito", Ds_Defeito).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDt_entrada", Dt_entrada).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_maquina", Nm_maquina).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_status", Ds_status).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_usuario", Id_usuario).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNr_ocorrencia", Nr_ocorrencia).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Ocorrência salva no historico!"; } catch (Exception ex) { ds_msg = "Erro ao salvar historico!" + ex.Message; } }
public string Insert() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_salvarAtendimento"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pId_Departamento", Id_departamento).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_User", Id_user).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_Solicitante", Nm_solicitante).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pNm_Maquina", Nm_maquina).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pProblema", Problema).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pSolucao", Solucao).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Atendimento salvo com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao gravar Procedimento!" + ex.Message; } return(ds_msg); }
public void update() { try { clsConexao instancia_conexao = new clsConexao(); MySqlCommand sql_cmd = new MySqlCommand("sp_editarUser"); sql_cmd.CommandType = CommandType.StoredProcedure; sql_cmd.Parameters.AddWithValue("pNm_usuario", Nm_Usuario).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_login", Ds_login).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_senha", Ds_senha).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_perfil", Ds_perfil).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_dept", Id_Departamento).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pId_usuario", Id_usuario).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pemail", email).Direction = ParameterDirection.Input; sql_cmd.Parameters.AddWithValue("pDs_ativo", Ds_ativo).Direction = ParameterDirection.Input; instancia_conexao.CRUD(sql_cmd); ds_msg = "Usuário atualizado com sucesso!"; } catch (Exception ex) { ds_msg = "Erro ao atualizar usuário!" + ex.Message; } }