public List <belDI> Carrega(string snrLanc) { try { List <belDI> objListaRet = new List <belDI>(); foreach (DataRow dr in BuscaDI(snrLanc).Rows) { belDI objDI = new belDI(); objDI.nDI = dr["nDI"].ToString(); objDI.DDI = (dr["dDI"].ToString() != "" ? Convert.ToDateTime(dr["dDI"].ToString()) : daoUtil.GetDateServidor().Date); objDI.xLocDesemb = dr["xLocDesemb"].ToString(); objDI.UFDesemb = dr["UFDesemb"].ToString(); objDI.dDesemb = (dr["dDesemb"].ToString() != "" ? Convert.ToDateTime(dr["dDesemb"].ToString()) : daoUtil.GetDateServidor().Date); objDI.cExportador = dr["cExportador"].ToString(); foreach (DataRow dr2 in BuscaADI(dr["nr_lanc"].ToString()).Rows) { beladi objadi = new beladi(); objadi.cFabricante = dr2["cFabricante"].ToString(); objadi.nAdicao = Convert.ToInt32(dr2["nAdicao"].ToString()); objadi.nSeqAdic = Convert.ToInt32(dr2["nSeqAdic"].ToString().Replace("0", "")); objadi.vDescDI = Convert.ToDecimal(dr2["vDescDI"].ToString().Replace(".", ",")); objDI.adi.Add(objadi); } objListaRet.Add(objDI); } return(objListaRet); } catch (Exception) { throw; } }
public List<belDI> Carrega(string snrLanc) { try { List<belDI> objListaRet = new List<belDI>(); foreach (DataRow dr in BuscaDI(snrLanc).Rows) { belDI objDI = new belDI(); objDI.nDI = dr["nDI"].ToString(); objDI.DDI = (dr["dDI"].ToString() != "" ? Convert.ToDateTime(dr["dDI"].ToString()) : daoUtil.GetDateServidor().Date); objDI.xLocDesemb = dr["xLocDesemb"].ToString(); objDI.UFDesemb = dr["UFDesemb"].ToString(); objDI.dDesemb = (dr["dDesemb"].ToString() != "" ? Convert.ToDateTime(dr["dDesemb"].ToString()) : daoUtil.GetDateServidor().Date); objDI.cExportador = dr["cExportador"].ToString(); foreach (DataRow dr2 in BuscaADI(dr["nr_lanc"].ToString()).Rows) { beladi objadi = new beladi(); objadi.cFabricante = dr2["cFabricante"].ToString(); objadi.nAdicao = Convert.ToInt32(dr2["nAdicao"].ToString()); objadi.nSeqAdic = Convert.ToInt32(dr2["nSeqAdic"].ToString().Replace("0", "")); objadi.vDescDI = Convert.ToDecimal(dr2["vDescDI"].ToString().Replace(".", ",")); objDI.adi.Add(objadi); } objListaRet.Add(objDI); } return objListaRet; } catch (Exception) { throw; } }