_21 de enero 2022

main
unknown 2 years ago
parent de6dc2f451
commit fe7b0ed881
  1. 9
      Controllers/DetallesController.cs
  2. 51
      DATA/Ddetalles.cs
  3. 80
      Models/Factura.cs
  4. BIN
      bin/Debug/net6.0/MyFirstAPI.dll
  5. BIN
      bin/Debug/net6.0/MyFirstAPI.pdb
  6. 2
      obj/Debug/net6.0/MyFirstAPI.csproj.CoreCompileInputs.cache
  7. BIN
      obj/Debug/net6.0/MyFirstAPI.dll
  8. BIN
      obj/Debug/net6.0/MyFirstAPI.pdb
  9. BIN
      obj/Debug/net6.0/ref/MyFirstAPI.dll
  10. BIN
      obj/Debug/net6.0/refint/MyFirstAPI.dll

@ -1,10 +1,11 @@
using System.ComponentModel; using System.ComponentModel;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text.RegularExpressions;
using Azure.Messaging; using Azure.Messaging;
using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using MyFirstAPI.DATA;
using MyFirstAPI.Models; using MyFirstAPI.Models;
using MyFirstAPI.Repositorio; using MyFirstAPI.Repositorio;
@ -33,6 +34,12 @@ namespace MyFirstAPI.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Create(Detalles deta) public async Task<IActionResult> Create(Detalles deta)
{ {
string pattern = "^[0-9]+$";
bool result = Regex.IsMatch(deta.ArticuloNumber, pattern);
if (!result)
{
return BadRequest( "El articulo number debe ser solo numerico");
}
await repositoriooo.Create(deta); await repositoriooo.Create(deta);
return Ok(); return Ok();
} }

@ -1,51 +0,0 @@
using System.Data;
using Microsoft.Data.SqlClient;
using MyFirstAPI.Models;
using MyFirstAPI.Repositorio;
namespace MyFirstAPI.DATA
{
public class Ddetalles
{
//ConexionDb cn = new ConexionDb();
//public async Task<List<Detalles>> MostrarDetalles()
//{
// var lista = new List<Detalles>();
// using (var sql = new SqlConnection(cn.CadenaSql()))
// {
// using (var cmd = new SqlCommand("SpVerDetalles", sql))
// {
// await sql.OpenAsync();
// cmd.CommandType = CommandType.StoredProcedure;
// using (var iteam = await cmd.ExecuteReaderAsync())
// {
// while (await iteam.ReadAsync())
// {
// var detalles = new Detalles();
// detalles.Id = (int)iteam["Id"];
// detalles.IdFactura = (int)iteam["IdFactura"];
// detalles.Nfactura = (string)iteam["Nfactura"];
// detalles.ArticuloNumber = (string)iteam["ArticuloNumber"];
// detalles.Cantidad = (int)iteam["Cantidad"];
// detalles.Precio = (double)iteam["Precio"];
// detalles.TotalId = (double)iteam["TotalId"];
// detalles.Articulo = (string)iteam["Articulo"];
// detalles.Activo = (byte)iteam["Activo"];
// lista.Add(detalles);
// }
// }
// }
// }
// return lista;
//}
}
}

@ -3,85 +3,7 @@
public class Factura public class Factura
{ {
#region"Atributos y propiedades factura " #region"Atributos y propiedades factura "
//private int _intIdf;
//public int Idf
//{
// get { return _intIdf; }
// set { _intIdf = value; }
//}
//private DateTime _dtmFecha;
//public DateTime Fecha
//{
// get { return _dtmFecha; }
// set { _dtmFecha = value; }
//}
//private string _strNumeroFactura;
//public string NumeroFactura
//{
// get { return _strNumeroFactura; }
// set { _strNumeroFactura = value; }
//}
//private string _strMetodopago;
//public string Metodopago
//{
// get { return _strMetodopago; }
// set { _strMetodopago = value; }
//}
//private string _strDirrecion;
//public string Dirrrecion
//{
// get { return _strDirrecion; }
// set { _strDirrecion = value; }
//}
//private string _strEmpresa;
//public string Empresa
//{
// get { return _strEmpresa; }
// set { _strEmpresa = value; }
//}
//private double _dblSubtotal;
//public double Subtotal
//{
// get { return _dblSubtotal; }
// set { _dblSubtotal = value; }
//}
//private double _dblTotal;
//public double Total
//{
// get { return _dblTotal; }
// set { _dblTotal = value; }
//}
//private byte _byteActivo;
//public byte Activo
//{
// get { return _byteActivo; }
// set { _byteActivo = value; }
//}
public int Idf { get; set; } public int Idf { get; set; }

Binary file not shown.

Binary file not shown.

@ -1 +1 @@
c6dfb80b0039b072decc8c171abd1e494c782a76 3cd71d297dd42d64ae88a8338c464cd6d31d1b73

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save