Esempio n. 1
0
        public static DataTable ConsultarArea(LineaLogica line)
        {
            DataTable datos = new DataTable();

            try
            {
                datos = AccesoDatos.Consultar("SELECT * FROM t_lineas WHERE planta = '" + line.Planta + "' and ('" + line.Global + "' = '1' or ('" + line.Global + "' = '0' and area = '" + line.Area + "')) ORDER BY linea");
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(datos);
        }
Esempio n. 2
0
        public static DataTable ConsultarLine(LineaLogica line)
        {
            DataTable datos = new DataTable();

            try
            {
                datos = AccesoDatos.Consultar("SELECT * FROM t_lineas WHERE linea = '" + line.Linea + "'");
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(datos);
        }
Esempio n. 3
0
        public static DataTable ListarPta(LineaLogica line)
        {
            DataTable datos = new DataTable();

            try
            {
                datos = AccesoDatos.Consultar("SELECT planta,linea as Linea,nombre as Estación,area as Area FROM t_lineas where planta='" + line.Planta + "' order by linea");
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(datos);
        }
Esempio n. 4
0
 public static bool Eliminar(LineaLogica line)
 {
     try
     {
         string sQuery = "DELETE FROM t_lineas WHERE planta = '" + line.Planta + "' and linea = '" + line.Linea + "'";
         if (AccesoDatos.Borrar(sQuery) != 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 5
0
 public static bool Verificar(LineaLogica line)
 {
     try
     {
         string sQuery;
         sQuery = "SELECT * FROM t_lineas WHERE planta = '" + line.Planta + "' and linea = '" + line.Linea + "'";
         DataTable datos = AccesoDatos.Consultar(sQuery);
         if (datos.Rows.Count != 0)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 6
0
 public static int GuardarPta(LineaLogica line)
 {
     string[] parametros = { "@Planta", "@Linea", "@Nombre", "@Area" };
     return(AccesoDatos.Actualizar("sp_mant_lineas", parametros, line.Planta, line.Linea, line.Nombre, line.Area));
 }