Ejemplo n.º 1
0
 /// <summary>
 /// OBTENER LA LISTA DE CAMPAÑAS
 /// </summary>
 /// <param name="oBe"></param>
 /// <returns></returns>
 public List <BESHMC_CAMP> P0010SHPR_CAMP_LIST(BESHMC_CAMP oBe)
 {
     using (var odr = oDa.P0010SHPR_CAMP_LIST(oBe))
     {
         var oList = new List <BESHMC_CAMP>();
         ((IList)oList).LoadFromReader <BESHMC_CAMP>(odr);
         return(oList);
     }
 }
        public HttpResponseMessage P0010SHPR_CAMP_LIST(BESHMC_CAMP oBe)
        {
            try
            {
                if (string.IsNullOrWhiteSpace((string)HttpContext.Current.Session["username"]))
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Acceso no autorizado."));
                }

                var oBr   = new BRSHMC_CAMP();
                var oList = oBr.P0010SHPR_CAMP_LIST(oBe);
                return(Request.CreateResponse(HttpStatusCode.OK, oList));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// OBTENER LA LISTA DE CAMPAÑAS
        /// </summary>
        /// <param name="oBe"></param>
        /// <returns></returns>
        public IDataReader P0010SHPR_CAMP_LIST(BESHMC_CAMP oBe)
        {
            try
            {
                oDb  = oDg.getDataBase();
                oCon = oDg.getConnection();
                if (oCon.State == ConnectionState.Closed)
                {
                    oCon.Open();
                }
                var ocmd = oDb.GetStoredProcCommand("P0010SHPR_CAMP_LIST", oBe.NUM_ACCI);

                ocmd.CommandTimeout = 2000;
                var odr = oDb.ExecuteReader(ocmd);
                return(odr);
            }
            finally
            {
                oCon.Close();
            }
        }