public SevenFramework.TO.TOTransaction <FaClien> GetFaclien(short emp_codi, string cli_coda) { try { var client = DAOFaClien.GetFaClien(emp_codi, cli_coda); if (client == null) { throw new Exception(string.Format("Cliente {0} no encontrado.", client)); } return(new SevenFramework.TO.TOTransaction <FaClien>() { ObjTransaction = client, Retorno = 0, TxtError = "" }); } catch (Exception ex) { return(new SevenFramework.TO.TOTransaction <FaClien>() { ObjTransaction = null, TxtError = ex.Message }); } }
public TOTransaction <Fa_Inacl> GetFaInacl(short emp_codi, string cli_coda) { try { var client = DAOFaClien.GetFaClien(emp_codi, cli_coda); var result = new DAO_Fa_Inacl().GetFaInacl(emp_codi, client.cli_codi); if (result == null) { throw new Exception("No se encontró información del cliente en programa SFAINACL.Contacte con su administrador."); } return(new TOTransaction <Fa_Inacl>() { Retorno = 0, TxtError = "", ObjTransaction = result }); } catch (Exception) { return(new TOTransaction <Fa_Inacl>() { ObjTransaction = null, TxtError = "", Retorno = 1 }); } }
public TOTransaction <List <Fa_Dina> > GetFaDina(short emp_codi, string cli_coda) { try { var clien = DAOFaClien.GetFaClien(emp_codi, cli_coda); var ddina = new DAO_Fa_Dina().GetFaDdina(emp_codi, clien.cli_codi); if (ddina == null) { throw new Exception(string.Format("No se encontró información adicional para el cliente {0}", cli_coda)); } return(new TOTransaction <List <Fa_Dina> >() { ObjTransaction = ddina, Retorno = 0, TxtError = "" }); } catch (Exception ex) { return(new TOTransaction <List <Fa_Dina> >() { ObjTransaction = null, TxtError = ex.Message, Retorno = 1 }); } }
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 }); } }