public TOTransaction <PqTrazab> GetInitialDataPq(int emp_codi)
        {
            BOGnItems boItems = new BOGnItems();
            BOGnArbol boArbol = new BOGnArbol();
            BOPqDpara boPerte = new BOPqDpara();
            BOGnDigfl boDigfl = new BOGnDigfl();

            try
            {
                PqTrazab result = new PqTrazab();

                List <GnArbol>  seccional = boArbol.GetGbnArbol(2, emp_codi);
                List <GnItem>   formRecib = boItems.GetGnItems(326);
                List <GnItem>   tipoDePqr = boItems.GetGnItems(327);
                List <GnArbol>  areaRespo = boArbol.GetGbnArbol(3, emp_codi);
                List <GnItem>   tipificac = boItems.GetGnItems(330);
                List <GnItem>   subtipifi = boItems.GetGnItems(331);
                List <TOGPerte> pqrGrpups = boPerte.GetPqDpara(emp_codi);
                GnFlag          SPQ000003 = boDigfl.GetGnDigfl("SPQ000003");

                result.seccional = seccional;
                result.formRecib = formRecib;
                result.tipoDePqr = tipoDePqr;
                result.areaRespo = areaRespo;
                result.tipificac = tipificac;
                result.subtipifi = subtipifi;
                result.grupPerte = pqrGrpups;
                result.SPQ000003 = SPQ000003.dig_valo;

                return(new TOTransaction <PqTrazab>()
                {
                    objTransaction = result, txtRetorno = "", retorno = 0
                });
            }
            catch (Exception ex)
            {
                return(new TOTransaction <PqTrazab>()
                {
                    objTransaction = null, retorno = 1, txtRetorno = ex.Message
                });
            }
        }
Esempio n. 2
0
        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
                });
            }
        }