Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        public static List <Asn_transporte_sello> AsnTranspSelloLstByAsn(int id_asn)
        {
            List <Asn_transporte_sello> lst = new List <Asn_transporte_sello>();

            try
            {
                Asn_transporte_selloMng oMng = new Asn_transporte_selloMng()
                {
                    O_Asn_transporte_sellos = new Asn_transporte_sello()
                    {
                        Id_asn = id_asn
                    }
                };
                oMng.fillLstByAsn();
                lst = oMng.Lst;
            }
            catch
            {
                throw;
            }
            return(lst);
        }