Exemplo n.º 1
0
        public List <ObjetivoEL> GetAllObjetivo(ObjetivoEL DE)
        {
            string            postdata = js.Serialize(DE);
            List <ObjetivoEL> Objetivo = js.Deserialize <List <ObjetivoEL> >(conecRest.ConectREST("objetivo", "POST", postdata));

            return(Objetivo);
        }
Exemplo n.º 2
0
        public List <ObjetivoEL> GetAllObjetivo(ObjetivoEL DE)
        {
            string request = ctx.IncomingRequest.Headers["token-client"];

            if (!UDA.Validarusuario(request))
            {
                return(null);
            }
            return(ObjetivoDA.Objetivo.GetAllObjetivo(DE));
        }
 public JsonResult ListaObjetivo(ObjetivoEL DE)
 {
     try
     {
         List <ObjetivoEL> ListObjetivo = new List <ObjetivoEL>();
         ListObjetivo = SeguimientoPlanMarketingBL.SeguimientoPlanMarketing.GetAllObjetivo(DE);
         return(Json(new { ListObjetivo = ListObjetivo }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception e)
     {
         Herramienta.Herramientas.Log(e.Message);
         return(Json(new { ListObjetivo = "" }, JsonRequestBehavior.AllowGet));
     }
 }
Exemplo n.º 4
0
 public List <ObjetivoEL> GetAllObjetivo(ObjetivoEL DE)
 {
     using (SqlConnection con = new SqlConnection(ConexionUtil.Cadena))
     {
         con.Open();
         using (SqlCommand com = new SqlCommand("spGettb_ObjetivoAll", con))
         {
             com.CommandType = CommandType.StoredProcedure;
             com.Parameters.Add("@idPlanMkt", SqlDbType.Int).Value = DE.idPlanMkt;
             List <ObjetivoEL> lst = new List <ObjetivoEL>();
             using (IDataReader dataReader = com.ExecuteReader())
             {
                 while (dataReader.Read())
                 {
                     ObjetivoEL obj = new ObjetivoEL();
                     if (dataReader["codObjetivo"] != DBNull.Value)
                     {
                         obj.codObjetivo = (int)dataReader["codObjetivo"];
                     }
                     if (dataReader["nombreObjetivo"] != DBNull.Value)
                     {
                         obj.nombreObjetivo = (string)dataReader["nombreObjetivo"];
                     }
                     if (dataReader["estadoObjetivo"] != DBNull.Value)
                     {
                         obj.estadoObjetivo = (string)dataReader["estadoObjetivo"];
                     }
                     if (dataReader["idPlanMkt"] != DBNull.Value)
                     {
                         obj.idPlanMkt = (int)dataReader["idPlanMkt"];
                     }
                     if (dataReader["porcentajeavance"] != DBNull.Value)
                     {
                         obj.porcentajeavance = (int)dataReader["porcentajeavance"];
                     }
                     lst.Add(obj);
                 }
                 return(lst);
             }
         }
     }
 }