Exemple #1
0
        public TOTransaction <CtPropoLoad> GetMunicipios(int emp_codi, int pai_codi, int reg_codi, int dep_codi)
        {
            BOGnMunic boMunic = new BOGnMunic();

            try
            {
                CtPropoLoad    result  = new CtPropoLoad();
                List <GnMunic> GnMunic = boMunic.GetGnMunic(pai_codi, reg_codi, dep_codi);
                result.GnMunic = GnMunic;
                return(new TOTransaction <CtPropoLoad>()
                {
                    objTransaction = result, txtRetorno = "", retorno = 0
                });
            }
            catch (Exception ex)
            {
                return(new TOTransaction <CtPropoLoad>()
                {
                    objTransaction = null, retorno = 1, txtRetorno = ex.Message
                });
            }
        }
        public TOTransaction <PqrTransactionLoad> GetInitialDataWpqinqr(string cli_coda, int emp_codi)
        {
            BOGnPaise  boPaise  = new BOGnPaise();
            BOGnDepar  boDepar  = new BOGnDepar();
            BOGnMunic  boMunic  = new BOGnMunic();
            BOGnItems  boItems  = new BOGnItems();
            BOGnDigfl  boFlag   = new BOGnDigfl();
            BOPqDpara  boPerte  = new BOPqDpara();
            BOGnArbol  boArbol  = new BOGnArbol();
            DAOGnParam daoParam = new DAOGnParam();
            DAOGnLogo  daoLogo  = new DAOGnLogo();
            DAOCtContr daoContr = new DAOCtContr();

            try
            {
                PqrTransactionLoad result    = new PqrTransactionLoad();
                GnParam            param     = daoParam.GetGnParam(emp_codi);
                GnFlag             spq000001 = boFlag.GetGnDigfl("SPQ000001");
                if (param == null)
                {
                    throw new Exception(string.Format("Parámetros de empresa no definidos para empresa {0}", emp_codi));
                }
                List <GnPaise>  countries      = boPaise.GetGnPaise();
                List <GnDepar>  states         = boDepar.GetGnDepar(param.pai_codi);
                List <GnMunic>  cities         = boMunic.GetAllGnMunic(param.pai_codi);
                GnFlag          flag           = boFlag.GetGnDigfl("SPQ000002");
                List <GnItem>   pqrType        = boItems.GetGnItems(327);
                List <GnItem>   pqrSubject     = boItems.GetGnItems(330);
                List <GnItem>   pqrInscription = boItems.GetGnItems(331);
                List <TOGPerte> pqrGrpups      = boPerte.GetPqDpara(emp_codi);
                GnFlag          flag008        = boFlag.GetGnDigfl("SGN000008");

                result.countries      = countries;
                result.states         = states;
                result.cities         = cities;
                result.pqrInscription = pqrInscription;
                result.pqrSubject     = pqrSubject;
                result.pqrType        = pqrType;
                result.pqrGroup       = pqrGrpups;
                result.digiflag       = flag;
                result.pqrImage       = daoLogo.GetGnLogo(emp_codi).emp_logs;
                result.SGN000008      = flag008.dig_valo;

                if (emp_codi > 0 && cli_coda != null && cli_coda != "undefined")
                {
                    FaClien client = DAOFaClien.GetFaClien(emp_codi, cli_coda);
                    if (client == null)
                    {
                        throw new Exception(string.Format("No se encontraron clientes con identificación {0} y empresa {1}", cli_coda, emp_codi));
                    }
                    result.client    = client;
                    result.contracts = daoContr.GetCtContr(emp_codi, cli_coda);
                }
                if (spq000001 != null)
                {
                    result.spq000001 = spq000001;
                }


                return(new TOTransaction <PqrTransactionLoad>()
                {
                    objTransaction = result, txtRetorno = "", retorno = 0
                });
            }
            catch (Exception ex)
            {
                return(new TOTransaction <PqrTransactionLoad>()
                {
                    objTransaction = null, retorno = 1, txtRetorno = ex.Message
                });
            }
        }