Ejemplo n.º 1
0
 public bool CRUD_CONSULTORIOS(Consultorio_TB consultorio, string accion)
 {
     try
     {
         return(BL.CRUD_CONSULTORIOS(consultorio, accion));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="consultorio"></param>
        /// <param name="accion"></param>
        /// <returns></returns>
        public static bool CRUD_CONSULTORIOS(Consultorio_TB consultorio, string accion)
        {
            try
            {
                List <SqlCommand> lstSentencias = new List <SqlCommand>();//Lista de sentencias a ejecutar
                AD objAcceso = new AD();

                SQLSentencias sentencia = new SQLSentencias();
                //Se crea la peticion
                sentencia.Peticion = "EXEC CRUD_CONSULTORIO_SP @Consultorio_ID, @Nombre, @Estado, @Accion";

                //Se agregan los parametros correspondientes
                SqlParameter Consultorio_ID_P = new SqlParameter();
                Consultorio_ID_P.Value         = consultorio.Consultorio_ID;
                Consultorio_ID_P.SqlDbType     = System.Data.SqlDbType.SmallInt;
                Consultorio_ID_P.ParameterName = "@Consultorio_ID";

                SqlParameter Nombre_P = new SqlParameter();
                Nombre_P.Value         = consultorio.Nombre;
                Nombre_P.SqlDbType     = System.Data.SqlDbType.VarChar;
                Nombre_P.ParameterName = "@Nombre";

                SqlParameter Estado_P = new SqlParameter();
                Estado_P.Value         = consultorio.Estado;
                Estado_P.SqlDbType     = System.Data.SqlDbType.Char;
                Estado_P.ParameterName = "@Estado";

                SqlParameter Accion_P = new SqlParameter();
                Accion_P.Value         = accion;
                Accion_P.SqlDbType     = System.Data.SqlDbType.Char;
                Accion_P.ParameterName = "@Accion";

                sentencia.lstParametros.Add(Consultorio_ID_P);
                sentencia.lstParametros.Add(Nombre_P);
                sentencia.lstParametros.Add(Estado_P);
                sentencia.lstParametros.Add(Accion_P);

                return(objAcceso.EjecutarSentencias(sentencia));
            }
            catch (Exception e)
            {
                throw e;
            }
        }