Exemplo n.º 1
0
 private void ImputacionMaterialesCostes(Albaranes model)
 {
     foreach (var l in model.AlbaranesLin)
     {
         if (l.importe == null || l.importe == 0)
         {
             var lotesService = new LotesService(Context);
             l.precio = Math.Round((double)_db.Stockhistorico.Where(f => f.empresa == Context.Empresa && f.lote == l.lote && f.loteid == l.tabla.ToString() && f.fkarticulos == l.fkarticulos)
                                   .Select(f => f.preciovaloracion + f.costeacicionalvariable / f.metrosentrada + f.costeadicionalmaterial / f.metrosentrada
                                           + f.costeadicionalotro / f.metrosentrada + f.costeadicionalportes / f.metrosentrada).SingleOrDefault(), 2);
             l.importe = Math.Round((double)((decimal)l.precio * (decimal)l.metros), l.decimalesmonedas ?? 2);
         }
     }
 }
Exemplo n.º 2
0
 public ActionResult Imagenes(LotesModel model)
 {
     if (!string.IsNullOrEmpty(model.Lote))
     {
         try
         {
             var lotesService = new LotesService(ContextService);
             lotesService.SubirImagenLote(model);
         }
         catch (Exception e)
         {
             ModelState.AddModelError("Error", e.Message);
         }
     }
     else
     {
         ModelState.AddModelError("Error", "Introduce un número de lote");
     }
     model.Toolbar.Titulo   = General.SubirImagen;
     model.Toolbar.Acciones = HelpItem();
     return(View("Imagenes", model));
 }