コード例 #1
0
        public ClsZTPPLogsCollection ConsultarZTPPLogsBAL(string psCriterio)
        {
            ClsZTPPLogsCollection zTPPLogsCollection = new ClsZTPPLogsCollection();

            try
            {
                zTPPLogsCollection = base.ConsultarZTPPLogsDAL(psCriterio);
                return(zTPPLogsCollection);
            }
            catch
            {
                throw;
            }
        }
コード例 #2
0
        public ClsZTPPLogsCollection ObtenerChargReimpresionBAL(string psCriterio)
        {
            ClsZTPPLogsCollection zTPPLogsCollection = new ClsZTPPLogsCollection();

            try
            {
                zTPPLogsCollection = base.ObtenerChargReimpresion(psCriterio);
                return(zTPPLogsCollection);
            }
            catch
            {
                throw;
            }
        }
コード例 #3
0
        protected ClsZTPPLogsCollection ObtenerChargReimpresion(string psCriterio)
        {
            //Declaración de variables
            DataSet ds = new DataSet();
            //Definición del adaptador
            SqlDataAdapter da = new SqlDataAdapter();
            //Definición de la coleccion
            ClsZTPPLogsCollection zTPPLogsCollection = new ClsZTPPLogsCollection();
            ClsZTPPLogs           zTPPLogs;

            try
            {
                da.SelectCommand             = new SqlCommand(Procedimientos.sp_ConsZTTPLogs, this.Conexion);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.Add("@Criterio", SqlDbType.VarChar).Value = psCriterio;
                //Se llena el DataSet
                da.Fill(ds);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    int renglones = ds.Tables[0].Rows.Count;
                    int columnas  = ds.Tables[0].Columns.Count;
                    for (int contador = 0; contador < ds.Tables[0].Rows.Count; contador++) //Cada renglòn
                    {
                        zTPPLogs = new ClsZTPPLogs();

                        zTPPLogs.Charg = ds.Tables[0].Rows[contador]["CHARG"].ToString().Trim();
                        zTPPLogsCollection.Add(zTPPLogs);
                    }
                }

                return(zTPPLogsCollection);
            }
            catch (Exception ex)
            {
                //Regenerar la excepción pero ahora con un mensaje personalizado para el usuario
                throw new Exception(Errores.ConsultarRegistro + Errores.MensajeOriginal + ex.Message.ToString());
            }
            finally
            {
                //Cerrar la conexión
                this.Conexion.Close();
            }
        }
コード例 #4
0
        protected ClsZTPPLogsCollection ConsultarZTPPLogsDAL(string psCriterio)
        {
            //Declaración de variables
            DataSet ds = new DataSet();
            //Definición del adaptador
            SqlDataAdapter da = new SqlDataAdapter();
            //Definición de la coleccion
            ClsZTPPLogsCollection zTPPLogsCollection = new ClsZTPPLogsCollection();
            ClsZTPPLogs           zTPPLogs;

            try
            {
                da.SelectCommand             = new SqlCommand(Procedimientos.sp_ConsZTTPLogs, this.Conexion);
                da.SelectCommand.CommandType = CommandType.StoredProcedure;
                da.SelectCommand.Parameters.Add("@Criterio", SqlDbType.VarChar).Value = psCriterio;
                //Se llena el DataSet
                da.Fill(ds);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    int renglones = ds.Tables[0].Rows.Count;
                    int columnas  = ds.Tables[0].Columns.Count;
                    for (int contador = 0; contador < ds.Tables[0].Rows.Count; contador++) //Cada renglòn
                    {
                        zTPPLogs = new ClsZTPPLogs();

                        zTPPLogs.Werks    = ds.Tables[0].Rows[contador]["WERKS"].ToString().Trim();
                        zTPPLogs.Exidv    = ds.Tables[0].Rows[contador]["EXIDV"].ToString().Trim();
                        zTPPLogs.Posicion = int.Parse(ds.Tables[0].Rows[contador]["POSICION"].ToString().Trim());
                        zTPPLogs.Fecha    = DateTime.Parse(ds.Tables[0].Rows[contador]["FECHA"].ToString().Trim());
                        zTPPLogs.Hora     = DateTime.Parse(ds.Tables[0].Rows[contador]["HORA"].ToString().Trim());
                        zTPPLogs.Proceso  = ds.Tables[0].Rows[contador]["PROCESO"].ToString().Trim();
                        zTPPLogs.Lgort    = ds.Tables[0].Rows[contador]["LGORT"].ToString().Trim();
                        zTPPLogs.Matnr    = ds.Tables[0].Rows[contador]["MATNR"].ToString().Trim();
                        zTPPLogs.Aufnr    = ds.Tables[0].Rows[contador]["AUFNR"].ToString().Trim();
                        zTPPLogs.Vornr    = ds.Tables[0].Rows[contador]["VORNR"].ToString().Trim();
                        zTPPLogs.Icon     = ds.Tables[0].Rows[contador]["ICON"].ToString().Trim();
                        zTPPLogs.Vemng    = double.Parse(ds.Tables[0].Rows[contador]["VEMNG"].ToString().Trim());
                        zTPPLogs.Message  = ds.Tables[0].Rows[contador]["MESSAGE"].ToString().Trim();
                        zTPPLogs.Mblnr    = ds.Tables[0].Rows[contador]["MBLNR"].ToString().Trim();
                        zTPPLogs.Mjahr    = int.Parse(ds.Tables[0].Rows[contador]["MJAHR"].ToString().Trim());
                        zTPPLogs.Bwart    = ds.Tables[0].Rows[contador]["BWART"].ToString().Trim();
                        zTPPLogs.Rueck    = int.Parse(ds.Tables[0].Rows[contador]["RUECK"].ToString().Trim());
                        zTPPLogs.Rmzhl    = ds.Tables[0].Rows[contador]["RMZHL"].ToString().Trim()[0];
                        zTPPLogs.Mov_hu   = ds.Tables[0].Rows[contador]["MOV_HU"].ToString().Trim();
                        zTPPLogs.Tipo_en  = ds.Tables[0].Rows[contador]["TIPO_EN"].ToString().Trim();
                        zTPPLogs.Anulo    = ds.Tables[0].Rows[contador]["ANULO"].ToString().Trim();
                        zTPPLogs.Fecha_a  = DateTime.Parse(ds.Tables[0].Rows[contador]["FECHA_A"].ToString().Trim());
                        zTPPLogs.Hora_a   = DateTime.Parse(ds.Tables[0].Rows[contador]["HORA_A"].ToString().Trim());
                        zTPPLogsCollection.Add(zTPPLogs);
                    }
                }

                return(zTPPLogsCollection);
            }
            catch (Exception ex)
            {
                //Regenerar la excepción pero ahora con un mensaje personalizado para el usuario
                throw new Exception(Errores.ConsultarRegistro + Errores.MensajeOriginal + ex.Message.ToString());
            }
            finally
            {
                //Cerrar la conexión
                this.Conexion.Close();
            }
        }