public TOTransaction <Su_Afili> GetSuAfili(int emp_codi, string afi_docu) { try { var result = new DAO_Su_Afili().GetSuAfili(emp_codi, afi_docu); List <SQLParams> sQLParams = new List <SQLParams>() { new SQLParams("MOD_CODI", 189) }; var modulAfili = DAO_Gn_Modul.GetGnModul(sQLParams); if (modulAfili.mod_inst == "S") { return(new TOTransaction <Su_Afili>() { ObjTransaction = result.Where(t => t.afi_tipo == "A").FirstOrDefault(), Retorno = 0, TxtError = "" }); } else { return(new TOTransaction <Su_Afili>() { ObjTransaction = result.Where(t => t.afi_tipo == "C").FirstOrDefault(), Retorno = 0, TxtError = "" }); } } catch (Exception ex) { return(new TOTransaction <Su_Afili>() { ObjTransaction = null, Retorno = 1, TxtError = ex.Message }); } }
//GET: api/GnModul public TOTransaction <Gn_Modul> GetGnModul(int mod_codi) { try { var modul = DAO_Gn_Modul.GetGnModul(mod_codi); return(new TOTransaction <Gn_Modul>() { ObjTransaction = modul, Retorno = 0, TxtError = "" }); } catch (Exception ex) { return(new TOTransaction <Gn_Modul>() { ObjTransaction = null, Retorno = 1, TxtError = ex.Message }); } }