예제 #1
0
 public List <INDEX> Post(UserAuthen userauthen)
 {
     if (ModelState.IsValid)
     {
         if (!Authentication.AuthenApi(userauthen.username, userauthen.password))
         {
             return(new List <INDEX>());
         }
         return(INDEXServices.GetINDEXHNX() + INDEXServices.GetINDEXHSX()); // vnindex and hnxindex get from database                    //"TV3','KCE"
     }
     else
     {
         return(new List <INDEX>());
     }
 }
예제 #2
0
        //public IEnumerable<string> Get(string username, string password)
        //{
        //    if (Authentication.AuthenApi(username, password))
        //    return new string[] { "YES", "value2" };
        //    else
        //    {
        //        throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.Unauthorized));
        //    }
        //}



        public List <AGNews_Articles> Post(News tickerList)
        {
            if (tickerList == null)
            {
                return(null);
            }
            int outputRownumber = 0;

            string tickerItem = ApplicationHelper.ParstToFormat_IN_SQL(tickerList.tickerList);

            if (Authentication.AuthenApi(tickerList.username, tickerList.password))
            {
                return(AGNews_ArticlesServices.GetAGNews_ArticlesListByTickerList(tickerItem, 1, 100, out outputRownumber));
                //"TV3','KCE"
            }
            else
            {
                return(new List <AGNews_Articles>());
            }
            //HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created);
            //return response;
        }