Example #1
0
        public RResponsableObservacionBE ObtenerResponsableObservaciónPorId(int IdRo)
        {
            RResponsableObservacionBE ResponsableObservacionBE = new RResponsableObservacionBE();
            Database objDB = Util.CrearBaseDatos();

            using (DbCommand objCMD = objDB.GetStoredProcCommand("USPR_GET_OBTENER_RO_PORID"))
            {
                try
                {
                    objDB.AddInParameter(objCMD, "@Id", DbType.Int32, IdRo);
                    using (IDataReader oDataReader = objDB.ExecuteReader(objCMD))
                    {
                        if (oDataReader.Read())
                        {
                            ResponsableObservacionBE.Id     = (int)oDataReader["Id"];
                            ResponsableObservacionBE.Cuenta = (string)oDataReader["Cuenta"];
                            ResponsableObservacionBE.Nombre = (string)oDataReader["Nombre"];
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return(ResponsableObservacionBE);
        }
Example #2
0
        public List <RResponsableObservacionBE> ObtenerResponsablesObservacion(int IdArea)
        {
            List <RResponsableObservacionBE> listaResponsables = new List <RResponsableObservacionBE>();
            Database objDB = Util.CrearBaseDatos();

            using (DbCommand objCMD = objDB.GetStoredProcCommand("USPR_GET_RESPONSABLE_OBSERVACION"))
            {
                try
                {
                    objDB.AddInParameter(objCMD, "@IdArea", DbType.Int32, IdArea);
                    using (IDataReader oDataReader = objDB.ExecuteReader(objCMD))
                    {
                        while (oDataReader.Read())
                        {
                            RResponsableObservacionBE responsable = new RResponsableObservacionBE();

                            responsable.Id     = (int)oDataReader["Id"];
                            responsable.Cuenta = (string)oDataReader["Cuenta"];
                            responsable.Nombre = (string)oDataReader["Nombre"];
                            listaResponsables.Add(responsable);
                        }
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }

            return(listaResponsables);
        }
Example #3
0
        public bool InsertarResponsable(RResponsableObservacionBE ResponsableObservacionBE)
        {
            int      res   = 0;
            Database objDB = Util.CrearBaseDatos();

            using (DbCommand objCMD = objDB.GetStoredProcCommand("USPR_INS_RESPONSABLE_OBSERVACION"))
            {
                objDB.AddInParameter(objCMD, "@IdArea", DbType.String, ResponsableObservacionBE.IdArea);
                objDB.AddInParameter(objCMD, "@Cuenta", DbType.String, ResponsableObservacionBE.Cuenta);
                objDB.AddInParameter(objCMD, "@Nombre", DbType.String, ResponsableObservacionBE.Nombre);
                objDB.AddInParameter(objCMD, "@EstaActivo", DbType.Boolean, ResponsableObservacionBE.EstaActivo);

                try
                {
                    res = objDB.ExecuteNonQuery(objCMD);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(res > 0);
        }