Ejemplo n.º 1
0
        public static string concentradoUdtActiva(int id_cliente, DateTime corte_ini, DateTime corte_fin)
        {
            IDbTransaction tran  = null;
            string         folio = string.Empty;

            try
            {
                tran  = GenericDataAccess.BeginTransaction();
                folio = CatalogoCtrl.getFolio(enumTipo.PRF, tran);

                ProformaMng oMng = new ProformaMng()
                {
                    O_Proforma = new Proforma()
                    {
                        Fecha_servicio = corte_fin,
                        Id_cliente     = id_cliente,
                        Corte_ini      = corte_ini,
                        Corte_fin      = corte_fin,
                        Folio_aplicada = folio
                    }
                };
                oMng.udt(tran);
                GenericDataAccess.CommitTransaction(tran);
            }
            catch
            {
                if (tran != null)
                {
                    GenericDataAccess.RollbackTransaction(tran);
                }
                throw;
            }
            return(folio);
        }
Ejemplo n.º 2
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;
            }
        }