//ver si conviene hacer métodos estáticos o instanciar la clase para acceder a los métodos!

        /// <summary>
        /// Obtiene una OrdenTrabajo por su clave Primaria.
        /// </summary>
        /// <param name="ord">La OrdenTrajo con solo con la Pk seteada.</param>
        /// <returns>OrdenTrabajo.</returns>
        public static OrdenTrabajo ObtenerPorPK(OrdenTrabajo ord)
        {
            try
            {
                using (SqlConnection connection = new SqlConnection(""))
                    return(ObtenerPorPK(ord, connection));
            }
            catch (Exception ex)
            {
                //si hubiera ws ahí tendría que haber otro try catch y ahí loguear el error!
                string hostName  = Dns.GetHostName();
                string ipAddress = Dns.GetHostEntry(hostName).AddressList[0].ToString();
                LogError.CreateLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, "", ipAddress);
                throw ex;
            }
        }
Beispiel #2
0
 public static Usuario[] ObtenerPorParametros(ParametrosBusquedaUsuarios parametros)
 {
     try
     {
         using (SqlConnection connection = null)
             return(ObtenerPorParametros(parametros, connection));
     }
     catch (Exception ex)
     {
         //si hubiera ws ahí tendría que haber otro try catch y ahí loguear el error!
         string hostName  = Dns.GetHostName();
         string ipAddress = Dns.GetHostEntry(hostName).AddressList[0].ToString();
         LogError.CreateLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, "", ipAddress);
         throw ex;
     }
 }
 /// <summary>
 /// documentar
 /// </summary>
 /// <param name="ord"></param>
 public static void Cierre(OrdenTrabajo ord)
 {
     try
     {
         ord.FechaCierre = DateTime.Now;
         using (SqlConnection connection = new SqlConnection(""))
             Editar(ord, connection);
     }
     catch (Exception ex)
     {
         //si hubiera ws ahí tendría que haber otro try catch y ahí loguear el error!
         string hostName  = Dns.GetHostName();
         string ipAddress = Dns.GetHostEntry(hostName).AddressList[0].ToString();
         LogError.CreateLog(ex, System.Reflection.MethodBase.GetCurrentMethod().Name, "", ipAddress);
         throw ex;
     }
 }