private void insertPqr(PqInpqr pqr, string typeRequest) { DAOPqParam daoPqParam = new DAOPqParam(); DAOGnInsta daoInsta = new DAOGnInsta(); DAOGnLogo daoLogo = new DAOGnLogo(); if (string.IsNullOrEmpty(pqr.inp_nide)) { pqr.inp_nide = "."; } int result = daoPqr.InseRSELFANG(pqr); pqr.genratedKey = mailHandler.GetPassword(pqr); // valida si tiene parametrizado Manejo Correo de Ingreso PQR en PQ_PARAM var MailPQParam = daoPqParam.GetMailParam(pqr.emp_codi); if (MailPQParam.par_mcin == "S") // Si tiene configurado envio de correo al ingresar un PQR { if (MailPQParam.par_tcin == null) // si no tiene una plantilla configurada para ingreso de PQR, continua con el metodo original para Defensa Civil { pqr.genratedKey = mailHandler.GetPassword(pqr); Mail mail = mailHandler.generateMail(pqr, MailPQParam, typeRequest); Mail mailModulo = mailHandler.generateMail(pqr, MailPQParam, "", "Modulo"); GnInsta insta = daoInsta.GetGnInsta(); mailHandler.sendMail(mail, insta); mailHandler.sendMail(mailModulo, insta); } else { Gnlogo Logo = daoLogo.GetGnLogo(pqr.emp_codi); MailImages ItemList = new MailImages(); ItemList.imageType = "Jpeg"; ItemList.sourceName = "logo"; ItemList.imgBytes = Logo.emp_logs; List <MailImages> LstImg = new List <MailImages>(); LstImg.Add(ItemList); Mail mail = mailHandler.generateMailFromPQParam(pqr, MailPQParam, typeRequest); Mail mailModulo = mailHandler.generateMailFromPQParam(pqr, MailPQParam, "", "Modulo"); GnInsta insta = daoInsta.GetGnInsta(); mailHandler.sendMail(mail, insta, true, LstImg); mailHandler.sendMail(mailModulo, insta, true, LstImg); } } }
public TOTransaction <CtPropoLoad> GetInitialDataCtPropo(int emp_codi) { DAOGnTipdo daoGnTipDo = new DAOGnTipdo(); DAOCtPropo daoCtPropo = new DAOCtPropo(); BOGnItems boItems = new BOGnItems(); BOGnPaise boPaise = new BOGnPaise(); BOGnArbol boArbol = new BOGnArbol(); DAOGnLogo daoLogo = new DAOGnLogo(); BOGnDigfl boDigfl = new BOGnDigfl(); try { CtPropoLoad result = new CtPropoLoad(); List <GnTipdo> tipdoct = daoGnTipDo.getListGnTipdo(); List <TOCtCamar> CtCamar = daoCtPropo.GetCtCamar(emp_codi); List <GnItem> tipCont = boItems.GetGnItems(98); List <GnPaise> GnPaise = boPaise.GetGnPaise(); List <GnArbol> GnArbol = boArbol.GetGbnArbol(18, emp_codi); string parptda = daoCtPropo.GetPolitica(emp_codi); List <GnItem> CtDtrda = boItems.GetGnItems(342); string parcrpr = daoCtPropo.GetInfoProv(emp_codi); GnFlag digfl = boDigfl.GetGnDigfl("SGN000008"); result.tipdoct = tipdoct; result.CtCamar = CtCamar; result.tipCont = tipCont; result.GnPaise = GnPaise; result.GnArbol = GnArbol; result.parptda = parptda; result.CtDtrda = CtDtrda; result.parcrpr = parcrpr; result.empImage = daoLogo.GetGnLogo(emp_codi).emp_logs; result.SGN000008 = digfl.dig_valo; 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 <Gnlogo> GetGnLogo(int emp_codi) { DAOGnLogo dao = new DAOGnLogo(); try { var result = dao.GetGnLogo(emp_codi); if (result == null) { throw new Exception("No se encontraron datos de la empresa"); } return(new TOTransaction <Gnlogo>() { objTransaction = result, retorno = 0, txtRetorno = "" }); } catch (Exception ex) { return(new TOTransaction <Gnlogo>() { retorno = 1, txtRetorno = ex.Message, objTransaction = null }); } }
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 }); } }