Example #1
0
        public static FormularioModel GetFormularioXSeleccion(MotivoModel motivo, NegocioModel negocio)
        {
            Query supQuery = new Query();

            CompositeTest where = new CompositeTest();
            where.SetOperator(CompositeTest.AND);
            where.Add(new AttributeTest("idMotivo", motivo.IdMotivo, AttributeTest.EQUAL));
            where.Add(new AttributeTest("idNegocio", negocio.IdNegocio, AttributeTest.EQUAL));

            supQuery.Where(where);

            GenericList <SeleccionFormulario> seleccionFormulario = SeleccionFormulario.FindWithQuery(supQuery);

            if (seleccionFormulario.Size() > 0)
            {
                return(FormularioModel.Create(seleccionFormulario[0].Formulario));
            }
            else
            {
                return(null);
            }
        }
        public static DireccionEntregaModelCollection BuscarClientes(String cuit, String razonSocial, String apies)
        {
            Query supQuery = new Query();

            AttributeTest testCUIT = new AttributeTest();

            testCUIT.Attribute = "CUIT";
            testCUIT.Operator  = AttributeTest.LIKE;
            testCUIT.Value     = "%" + cuit + "%";

            AttributeTest testRazonSocial = new AttributeTest();

            testRazonSocial.Attribute = "razonSocial";
            testRazonSocial.Operator  = AttributeTest.LIKE;
            testRazonSocial.Value     = "%" + razonSocial + "%";

            AttributeTest testAPIES = new AttributeTest();

            testRazonSocial.Attribute = "APIES";
            testRazonSocial.Operator  = AttributeTest.LIKE;
            testRazonSocial.Value     = "%" + apies + "%";

            //AttributeTest testCuentaLP2 = new AttributeTest();
            //testCuentaLP2.setAttribute("cuentaLP2");
            //testCuentaLP2.setOperator(AttributeTest.EQUAL);
            //testCuentaLP2.setValue(nroCuenta);

            //AttributeTest testCuentaQP1 = new AttributeTest();
            //testCuentaQP1.setAttribute("cuentaQP1");
            //testCuentaQP1.setOperator(AttributeTest.EQUAL);
            //testCuentaQP1.setValue(nroCuenta);

            //AttributeTest testCuentaSGC = new AttributeTest();
            //testCuentaSGC.setAttribute("cuentaSGC");
            //testCuentaSGC.setOperator(AttributeTest.EQUAL);
            //testCuentaSGC.setValue(nroCuenta);

            //AttributeTest testDummy = new AttributeTest();
            //testDummy.setAttribute("CUIT");
            //testDummy.setOperator(AttributeTest.NOT_EQUAL);
            //testDummy.setValue("");


            CompositeTest where = new CompositeTest();
            where.Operator      = CompositeTest.AND;

            if (cuit.Trim().Length != 0)
            {
                where.Add(testCUIT);
            }
            if (razonSocial.Trim().Length != 0)
            {
                where.Add(testRazonSocial);
            }
            if (apies.Trim().Length > 0)
            {
                where.Add(testAPIES);
            }
            //if (nroCuenta != null && nroCuenta.length() > 0 && tipoCuenta != null && tipoCuenta.length() > 0)
            //{
            //    if (tipoCuenta.equals("LP2"))
            //        where.add(testCuentaLP2);
            //    if (tipoCuenta.equals("QP1"))
            //        where.add(testCuentaQP1);
            //    if (tipoCuenta.equals("SGC"))
            //        where.add(testCuentaSGC);
            //}

            if (where.Operands.Count > 0)
            {
                supQuery.Where(where);
            }

            //SortCriteria sort = new SortCriteria();
            //sort.add("CUIT", SortOrderType.ASCENDING);
            //sort.add("razonSocial", SortOrderType.ASCENDING);

            //supQuery.setSortCriteria(sort);

            GenericList <DireccionEntrega> result = DireccionEntrega.FindWithQuery(supQuery);

            return(new DireccionEntregaModelCollection(result));
        }
Example #3
0
        public static FormularioModel GetFormularioXSeleccion(MotivoModel motivo, NegocioModel negocio)
        {
            Query supQuery = new Query();

            CompositeTest where = new CompositeTest();
            where.SetOperator(CompositeTest.AND);
            where.Add(new AttributeTest("idMotivo", motivo.IdMotivo, AttributeTest.EQUAL));
            where.Add(new AttributeTest("idNegocio", negocio.IdNegocio, AttributeTest.EQUAL));

            supQuery.Where(where);

            GenericList<SeleccionFormulario> seleccionFormulario = SeleccionFormulario.FindWithQuery(supQuery);
            if (seleccionFormulario.Size() > 0)
                return FormularioModel.Create(seleccionFormulario[0].Formulario);
            else
                return null;
        }
Example #4
0
        public static DireccionEntregaModelCollection BuscarClientes(String cuit, String razonSocial, String apies)
        {
            Query supQuery = new Query();
            
            AttributeTest testCUIT = new AttributeTest();
            testCUIT.Attribute = "CUIT";
            testCUIT.Operator = AttributeTest.LIKE;
            testCUIT.Value = "%" + cuit + "%" ;

            AttributeTest testRazonSocial = new AttributeTest();
            testRazonSocial.Attribute = "razonSocial";
            testRazonSocial.Operator = AttributeTest.LIKE;
            testRazonSocial.Value = "%" + razonSocial + "%";

            AttributeTest testAPIES = new AttributeTest();
            testRazonSocial.Attribute = "APIES";
            testRazonSocial.Operator = AttributeTest.LIKE;
            testRazonSocial.Value = "%" + apies + "%";

            //AttributeTest testCuentaLP2 = new AttributeTest();
            //testCuentaLP2.setAttribute("cuentaLP2");
            //testCuentaLP2.setOperator(AttributeTest.EQUAL);
            //testCuentaLP2.setValue(nroCuenta);

            //AttributeTest testCuentaQP1 = new AttributeTest();
            //testCuentaQP1.setAttribute("cuentaQP1");
            //testCuentaQP1.setOperator(AttributeTest.EQUAL);
            //testCuentaQP1.setValue(nroCuenta);

            //AttributeTest testCuentaSGC = new AttributeTest();
            //testCuentaSGC.setAttribute("cuentaSGC");
            //testCuentaSGC.setOperator(AttributeTest.EQUAL);
            //testCuentaSGC.setValue(nroCuenta);

            //AttributeTest testDummy = new AttributeTest();
            //testDummy.setAttribute("CUIT");
            //testDummy.setOperator(AttributeTest.NOT_EQUAL);
            //testDummy.setValue("");


            CompositeTest where = new CompositeTest();
            where.Operator = CompositeTest.AND;

            if (cuit.Trim().Length != 0) where.Add(testCUIT);
            if (razonSocial.Trim().Length != 0) where.Add(testRazonSocial);
            if (apies.Trim().Length > 0) where.Add(testAPIES);
            //if (nroCuenta != null && nroCuenta.length() > 0 && tipoCuenta != null && tipoCuenta.length() > 0)
            //{
            //    if (tipoCuenta.equals("LP2"))
            //        where.add(testCuentaLP2);
            //    if (tipoCuenta.equals("QP1"))
            //        where.add(testCuentaQP1);
            //    if (tipoCuenta.equals("SGC"))
            //        where.add(testCuentaSGC);
            //}

            if(where.Operands.Count > 0)
                supQuery.Where(where);

            //SortCriteria sort = new SortCriteria();
            //sort.add("CUIT", SortOrderType.ASCENDING);
            //sort.add("razonSocial", SortOrderType.ASCENDING);

            //supQuery.setSortCriteria(sort);

            GenericList<DireccionEntrega> result = DireccionEntrega.FindWithQuery(supQuery);

            return new DireccionEntregaModelCollection(result);
        }