Exemplo n.º 1
0
    public static List <FacturaDetalle> GetListFacturaDetalle(int facturaID)
    {
        List <FacturaDetalle> theList = new List <FacturaDetalle>();
        FacturaDetalle        theData = null;

        try
        {
            FacturaDetalleDSTableAdapters.FacturaDetalleTableAdapter localAdapter = new FacturaDetalleDSTableAdapters.FacturaDetalleTableAdapter();
            FacturaDetalleDS.FacturaDetalleDataTable table = localAdapter.GetFacturaDetalleByFactID(facturaID);

            if (table != null && table.Rows.Count > 0)
            {
                foreach (var row in table)
                {
                    theData = FillRecord(row);
                    theList.Add(theData);
                }
            }
        }
        catch (Exception)
        {
            throw;
        }

        return(theList);
    }
Exemplo n.º 2
0
 public static void DeleteFacturaDetalle(int detalleId)
 {
     try
     {
         FacturaDetalleDSTableAdapters.FacturaDetalleTableAdapter localAdapter = new FacturaDetalleDSTableAdapters.FacturaDetalleTableAdapter();
         localAdapter.DeleteFacturaDetalle(detalleId);
     }
     catch (Exception)
     {
         throw;
     }
 }
Exemplo n.º 3
0
    public static int InsertFacturaDetalle(FacturaDetalle theData)
    {
        int?detalleId = 0;

        try
        {
            FacturaDetalleDSTableAdapters.FacturaDetalleTableAdapter localAdapter = new FacturaDetalleDSTableAdapters.FacturaDetalleTableAdapter();
            localAdapter.InsertFacturaDetalle(theData.FacturaId, theData.ProductoId, theData.AlmacenId, theData.PesoKG, theData.Monto, ref detalleId);
        }
        catch (Exception)
        {
            throw;
        }

        return(detalleId.Value);
    }