Esempio n. 1
0
        //JsonResult - ActionResult
        public JsonResult GetMoviles(long pPer, long pEst, long pTip)
        {
            //if (!ValidarSession())
            //    return null;
            WSTercerosLiquidaciones.TercerosLiquidacionesSoapClient wsClient = new WSTercerosLiquidaciones.TercerosLiquidacionesSoapClient();
            wsClient.Open();
            DataSet ds;

            if (Convert.ToInt32(Session["empresa"]) == 1)
            {
                ds = wsClient.GetEmpresas(Convert.ToInt32(Session["usr_id"]), Convert.ToInt32(Session["Acceso"]), pPer, pEst, pTip);
            }
            else
            {
                ds = wsClient.GetMoviles(Convert.ToInt32(Session["usr_id"]), Convert.ToInt32(Session["Acceso"]), pPer, pEst);
            }
            wsClient.Close();
            //hago la lista de objetos para retornar
            List <FiltroMoviles> lstMoviles = new List <FiltroMoviles>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                lstMoviles.Add(new FiltroMoviles(dr["ID"].ToString(), dr["Nombre"].ToString()));
            }

            return(Json(lstMoviles, JsonRequestBehavior.AllowGet));
        }