コード例 #1
0
ファイル: RemisionBLL.cs プロジェクト: polaniavera/inventario
        public int UpdateRemision(int id, RemisionDetalleModel collection)
        {
            RemisionEntrada rmInput = new RemisionEntrada();

            rmInput.Id             = id;
            rmInput.Codigo         = collection.Codigo;
            rmInput.FechaDocumento = collection.FechaDocumento;
            rmInput.IdProveedor    = collection.IdProveedor;
            rmInput.IdAlmacen      = collection.IdAlmacen;
            rmInput.Estado         = 1;

            var productos = new ProductoBLL().GetAllProductos();
            List <RemisionEntradaDetalle> rmDetail = new List <RemisionEntradaDetalle>();

            for (int i = 0; i < productos.Count; i++)
            {
                rmDetail.Add(new RemisionEntradaDetalle()
                {
                    IdProducto        = productos[i].Id,
                    Cantidad          = collection.Cantidades[i],
                    IdRemisionEntrada = collection.Id
                });
            }
            //RemisionEntradaDetalle rmDetail = new RemisionEntradaDetalle();
            //rmDetail.IdRemisionEntrada = id;
            //rmDetail.IdProducto = collection.IdProducto;
            //rmDetail.IdRemisionEntrada = collection.Id;
            //rmDetail.Cantidad = collection.Cantidad;

            return(new RemisionDAL().UpdateRemision(id, rmInput, rmDetail));
        }
コード例 #2
0
 public ActionResult Anular(int id, RemisionDetalleModel collection)
 {
     try
     {
         var rs = new RemisionBLL().UpdateAnular(id);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
コード例 #3
0
        public ActionResult Create(RemisionDetalleModel collection, string submitButton)
        {
            try
            {
                switch (submitButton)
                {
                case "Guardar":
                    var rs = new RemisionBLL().SetRemision(collection);
                    return(RedirectToAction(nameof(Index)));

                case "Guardar y Confirmar":
                    var idConfirm = new RemisionBLL().ConfirmRemision(collection);
                    var re        = new RemisionBLL().UpdateConfirmar(idConfirm);
                    return(RedirectToAction(nameof(Index)));

                default:
                    return(View());
                }
            }
            catch
            {
                return(View());
            }
        }