private string connectionStringMysql() { string cadena = string.Empty; ConexionDAO objDa = new ConexionDAO(); cadena = objDa.CnxMySQL(); return(cadena); }
public string Usuarios_Insertar(EnUsuario objEn) { string msg = string.Empty; ConexionDAO cadenaDao = new ConexionDAO(); using (MySqlConnection cn = new MySqlConnection(cadenaDao.CnxMySQL())) { cn.Open(); using (MySqlTransaction tran = cn.BeginTransaction()) { try { DaUsuario OjbDAO = new DaUsuario(); OjbDAO.Usuarios_Insertar(objEn, tran); tran.Commit(); msg = "EXITO"; } catch (MySqlException ex) { tran.Rollback(); throw ex; } catch (Exception ex) { tran.Rollback(); throw ex; } finally { tran.Dispose(); cn.Close(); } return(msg); } } }
public string Devices_configuracion(int ID, string cadena) { string msg = string.Empty; ConexionDAO cadenaDao = new ConexionDAO(); using (MySqlConnection cn = new MySqlConnection(cadenaDao.CnxMySQL())) { cn.Open(); using (MySqlTransaction tran = cn.BeginTransaction()) { try { DaDevices OjbDAO = new DaDevices(); OjbDAO.Devices_configuracion(ID, cadena, tran); tran.Commit(); msg = "EXITO"; } catch (MySqlException ex) { tran.Rollback(); throw ex; } catch (Exception ex) { tran.Rollback(); throw ex; } finally { tran.Dispose(); cn.Close(); } return(msg); } } }