Example #1
0
        public JsonResult GetResumenDetalle(long pLiqId, long pLiqMovId, int link)
        {
            DataSet ds;
            List <ResumenItemDetalle> oList = new List <ResumenItemDetalle>();

            WSTercerosLiquidaciones.TercerosLiquidacionesSoapClient wsClient = new WSTercerosLiquidaciones.TercerosLiquidacionesSoapClient();
            wsClient.Open();
            switch (link)
            {
            case 0:    //No tiene link
                ds = null;
                break;

            case 1:    //Productividad
                ds = wsClient.GetResumenProductividad(pLiqMovId);
                break;

            case 2:    //Premios
                ds = wsClient.GetResumenPremios(pLiqMovId);
                break;

            case 3:    //Insumos
                ds = wsClient.GetResumenInsumos(pLiqId);
                break;

            case 4:    //Otros Descuentos
                ds = wsClient.GetResumenOtrosDescuentos(pLiqId);
                break;

            default:    //No está parametrizado
                ds = null;
                break;
            }
            wsClient.Close();
            if (ds != null)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    oList.Add(new ResumenItemDetalle(dr));
                }
            }

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