public TOTransaction <List <GnItem> > getInfoTipificacion(int ite_cont) { DAOGnItems daoItems = new DAOGnItems(); BOGnItems boItems = new BOGnItems(); try { List <GnItem> dataTipi = new List <GnItem>(); if (ite_cont != 0) { dataTipi = daoItems.GetGnItemsFromTipi(330, ite_cont); } else { dataTipi = boItems.GetGnItems(330); } return(new TOTransaction <List <GnItem> >() { objTransaction = dataTipi, retorno = 0, txtRetorno = "" }); } catch (Exception ex) { return(new TOTransaction <List <GnItem> >() { objTransaction = null, retorno = 1, txtRetorno = ex.Message }); } }
public List <GnItem> GetGnItems(int tit_cont, string ite_codi = "") { DAOGnItems dao = new DAOGnItems(); List <GnItem> result = new List <GnItem>(); result = dao.GetGnItems(tit_cont, ite_codi); if (result == null || !result.Any()) { throw new Exception(string.Format("No se encontraron items parametrizados para el titem {0}", tit_cont)); } return(result); }
public TOTransaction <List <GnItems> > GetGnItems(int tit_cont) { DAOGnItems daoItems = new DAOGnItems(); List <GnItems> ListItems = new List <GnItems>(); try { ListItems = daoItems.GetGnItemsLupa(tit_cont, ""); return(new TOTransaction <List <GnItems> >() { objTransaction = ListItems, txtRetorno = "", retorno = 0 }); } catch (Exception ex) { return(new TOTransaction <List <GnItems> >() { objTransaction = null, retorno = 1, txtRetorno = ex.Message }); } }
public TOTransaction <PqInpqrSalida> PostPqr(PqInpqr pqr) { DAOGnArbol daoArbol = new DAOGnArbol(); DAOGnItems daoItems = new DAOGnItems(); BOGnRadju boRdju = new BOGnRadju(); DAOGnParam daoParam = new DAOGnParam(); try { if (pqr.inp_tcli != "F") { pqr.inp_tcli = "O"; } string emp_codi = new tools.General().GetEmpCodi(pqr.emp_codi).ToString(); if (pqr.inp_tcli == "F") { var thirdPartie = DAOGnTerce.GetGnTerce(int.Parse(emp_codi), pqr.inp_nide); if (thirdPartie == null) { throw new Exception(string.Format("No se encontró tercero asociado a la identificación {0}", pqr.inp_nide)); } pqr.ter_codi = thirdPartie.ter_codi; } GnParam param = daoParam.GetGnParam(int.Parse(emp_codi)); string typeRequest = daoItems.GetGnItems(327, "").Where(i => i.ite_cont == pqr.ite_tpqr).FirstOrDefault().ite_nomb; if (string.IsNullOrEmpty(emp_codi)) { throw new Exception("Código de empresa no parametrizado en api."); } mailHandler.uploadFile(); pqr.emp_codi = int.Parse(emp_codi); pqr.inp_cont = daoPqr.GetCont("PQ_INPQR", "INP_CONT"); if (string.IsNullOrEmpty(pqr.arb_sucu)) { pqr.arb_sucu = "0"; } pqr.arb_sucu = daoArbol.GetGnArbol("2", pqr.arb_sucu, int.Parse(emp_codi))[0].arb_cont.ToString(); List <GnItem> data = daoItems.GetGnItems(326, "3"); if (data.Count > 0) { pqr.ite_frec = data[0].ite_cont.ToString(); } else { pqr.ite_frec = "0"; } pqr.arb_cecr = daoArbol.GetGnArbol("3", "0", int.Parse(emp_codi))[0].arb_cont.ToString(); if (pqr.pai_codi == param.pai_codi) { //Cuando se selecciona el país de instalación el municipio contiene también la región separada por - int mun_codi = int.Parse(pqr.mun_codi.Split('-')[0]); pqr.reg_codi = int.Parse(pqr.mun_codi.Split('-')[1]); pqr.mun_codi = mun_codi.ToString(); } else { pqr.reg_codi = 0; pqr.mun_codi = "0"; } insertPqr(pqr, typeRequest); string cas_cont = mailHandler.createWorkFlow(pqr, typeRequest); if (cas_cont.AsInt() > 0) { daoPqr.updatePqr(pqr.inp_cont, cas_cont); } string msg = mailHandler.GetDescriptionPqrMessage(pqr); return(new TOTransaction <PqInpqrSalida>() { objTransaction = new PqInpqrSalida() { inp_cont = pqr.inp_cont, msg = msg }, retorno = 0, txtRetorno = "" }); } catch (Exception ex) { if (pqr.inp_cont > 0) { daoPqr.deletePqr(pqr.inp_cont); } return(new TOTransaction <PqInpqrSalida>() { objTransaction = null, retorno = 1, txtRetorno = ex.Message }); } }