public static void asnAdd(Asn o) { IDbTransaction tran = null; AsnMng oMng = new AsnMng() { O_Asn = o }; Asn_partidaMng oAPMng = new Asn_partidaMng(); Asn_transporte_selloMng oATSMng = new Asn_transporte_selloMng(); try { tran = GenericDataAccess.BeginTransaction(); string folio = CatalogoCtrl.getFolio(enumTipo.ASN, tran); o.Folio = folio; oMng.add(tran); foreach (Asn_partida item in o.PLstPartida) { item.Id_asn = o.Id; oAPMng.O_Asn_partida = item; oAPMng.add(tran); } foreach (Asn_transporte_sello itemSello in o.PLstTranSello) { itemSello.Id_asn = o.Id; oATSMng.O_Asn_transporte_sellos = itemSello; oATSMng.add(tran); } GenericDataAccess.CommitTransaction(tran); } catch { if (tran != null) { GenericDataAccess.RollbackTransaction(tran); } throw; } }
public static List <Asn_partida> AsnPartidaLstByAsn(int id_asn) { List <Asn_partida> lst = new List <Asn_partida>(); try { Asn_partidaMng oMng = new Asn_partidaMng() { O_Asn_partida = new Asn_partida() { Id_asn = id_asn } }; oMng.fillLstByAsn(); lst = oMng.Lst; } catch { throw; } return(lst); }