public Rota GetRotaIndicadoresFluxoLES(long cdRota) { // Rota com acesso a one to many // Key: cdRota Dictionary <long, Rota> rota = new Dictionary <long, Rota>(); using (var dapperConnection = AbreConexao()) { dapperConnection.Open(); // Multi-Mapping List <Rota> result = dapperConnection.Query <Rota>( @"SELECT Rota.*, Transportadora.*, Entrega.*, SolicitacaoDescarga.*, MotivoDevolucao.*, Cliente.*, UnidadeNegocio.* FROM OPMDM.TB_ROTA AS Rota LEFT JOIN OPMDM.TB_TRANSPORTADORA AS Transportadora ON Rota.CdTransportadora = Transportadora.CdTransportadora LEFT JOIN OPMDM.TB_ENTREGA Entrega ON Rota.CdRota = Entrega.CdRota LEFT JOIN OPMDM.TB_SOLICITACAO_DESCARGA SolicitacaoDescarga ON Entrega.CdEntrega = SolicitacaoDescarga.CdEntrega LEFT JOIN OPMDM.TB_MOTIVO_DEVOLUCAO MotivoDevolucao ON Entrega.CdMotivoDevolucaoCA = MotivoDevolucao.CdMotivoDevolucao LEFT JOIN OPMDM.TB_CLIENTE Cliente ON Entrega.CdCliente = Cliente.CdCliente LEFT JOIN OPMDM.TB_UNIDADE_NEGOCIO UnidadeNegocio ON UnidadeNegocio.CdUnidadeNegocio = Rota.CdUnidadeNegocio WHERE Rota.CdRota = @CdRota ORDER BY Entrega.CdCliente", new[] { typeof(Rota), typeof(Transportadora), typeof(Entrega), typeof(SolicitacaoDescarga), typeof(MotivoDevolucao), typeof(Cliente), typeof(UnidadeNegocio) }, objects => { Rota Rota = objects[0] as Rota; Transportadora Transportadora = objects[1] as Transportadora; Entrega Entrega = objects[2] as Entrega; SolicitacaoDescarga SolicitacaoDescarga = objects[3] as SolicitacaoDescarga; MotivoDevolucao MotivoDevolucao = objects[4] as MotivoDevolucao; Cliente Cliente = objects[5] as Cliente; UnidadeNegocio UnidadeNegocio = objects[6] as UnidadeNegocio; if (!rota.ContainsKey(cdRota)) { rota.Add(cdRota, new Rota()); rota[cdRota] = Rota; rota[cdRota].Transportadora = Transportadora; rota[cdRota].UnidadeNegocio = UnidadeNegocio; } if (Entrega != null) { Entrega.SolicitacaoDescarga = SolicitacaoDescarga; Entrega.MotivoDevolucao = MotivoDevolucao; Entrega.Cliente = Cliente; } rota[cdRota].Entregas.Add(Entrega); return(Rota); }, splitOn: "CdTransportadora, CdEntrega, CdSolicitacaoDescarga, CdMotivoDevolucao, CdPontoInteresse, CdUnidadeNegocio", param: new { CdRota = cdRota }).AsList(); return(rota[cdRota]); } }
string createPrintDoc(Entrega ent) { IList <EntregaItemVendido> nor = new List <EntregaItemVendido>(); IList <EntregaItemVendido> of = new List <EntregaItemVendido>(); IList <EntregaItemVendido> dev = new List <EntregaItemVendido>(); StringBuilder st = new StringBuilder(); if (ent != null) { if (ent.ItemVendidos.Count > 0) { foreach (EntregaItemVendido i in ent.ItemVendidos) { if (i.Oferta && i.CantidadNor > 0) { of.Add(i); } if (i.Devolucion || i.CantidadDev > 0) { dev.Add(i); } if (!i.Oferta && i.CantidadNor > 0) { nor.Add(i); } } } } st.Append("<html>"); st.Append("<body>"); st.Append("<table>"); st.Append("<tr>"); PanLoco.Models.Perfil perfile = App.PerfilDB.GetItemAsync(1).Result; st.Append("<tr><td colspan=\"2\">" + perfile.FullName + "</td ></tr>"); st.Append("<tr><td colspan=\"2\">" + perfile.Calle + "</td ></tr>"); st.Append("<tr><td colspan=\"2\">" + perfile.Localidad + "</td ></tr>"); if (ent != null) { st.Append("<tr><td colspan=\"2\">" + perfile.Cuil + " " + ent.Fecha.ToString() + " </ td ></tr>"); st.Append("<tr><td colspan=\"2\">" + ent.ClienteNombre + "</td></tr>"); } else { st.Append("<tr><td>[Cliente]</td><td></td></tr>"); } st.Append("<tr><td colspan=\"2\">Item Descripción Neto</td ></tr>"); st.Append("<tr><td colspan=\"2\">Cant Precio Neto</td ></tr>"); double subt = 0; if (nor.Count > 0) { st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); st.Append("</tr><tr><td colspan=\"2\">Productos</td></tr>"); st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); } foreach (EntregaItemVendido i in nor) { st.Append("</tr><tr><td>" + i.Producto.Codigo + " " + i.Producto.Nombre + "</td><td> $ " + (i.CantidadNor * i.PrecioUnitario) + "</td></tr>"); st.Append("</tr><tr><td colspan=\"2\">" + i.CantidadNor + " x $ " + i.PrecioUnitario + "</td></tr>"); subt += (i.CantidadNor * i.PrecioUnitario); } if (nor.Count() > 0) { st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); st.Append("</tr><tr><td>Sub Total Prod</td><td> $ " + subt.ToString("##.##") + "</td></tr>"); if (ent.ClienteDescuento > 0) { st.Append("</tr><tr><td>Descuento " + ent.ClienteDescuento.ToString() + "%</td><td> - $ " + (subt * (ent.ClienteDescuento / 100)).ToString("##.##") + "</td></tr>"); subt -= (subt * (ent.ClienteDescuento / 100)); st.Append("</tr><tr><td>Sub Total con Desc</td><td> $ " + subt.ToString("##.##") + "</td></tr>"); } } if (of.Count > 0) { st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); st.Append("</tr><tr><td colspan=\"2\">Ofertas</td></tr>"); st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); } subt = 0; foreach (EntregaItemVendido i in of) { st.Append("</tr><tr><td>" + i.Producto.Codigo + " " + i.Producto.Nombre + "</td><td> $" + (i.CantidadNor * i.PrecioOferta) + "</td></tr>"); st.Append("</tr><tr><td colspan=\"2\">" + i.CantidadNor + " x $" + i.PrecioOferta + "</td></tr>"); subt += (i.CantidadNor * i.PrecioOferta); } if (of.Count > 0) { st.Append("</tr><tr><td>Sub Total Ofertas</td><td> $ " + subt.ToString("##.##") + "</td></tr>"); } if (dev.Count() > 0) { st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); st.Append("</tr><tr><td colspan=\"2\" >Devoluciones</td></tr>"); st.Append("</tr><tr><td colspan=\"2\"></td></tr>"); } foreach (EntregaItemVendido i in dev) { st.Append("</tr><tr><td>" + i.Producto.Codigo + " " + i.Producto.Nombre + "</td><td>$ 0</td></tr>"); st.Append("</tr><tr><td colspan=\"2\">" + i.CantidadDev + " x $ 0</td></tr>"); } if (ent != null) { st.Append("<tr><td>TOTAL</td><td>$ " + ent.Total.ToString("##.##") + "</td></tr>"); } st.Append("</table>"); st.Append("</body>"); st.Append("</html>"); return(st.ToString()); }
public void Deletar() { Entrega e = EntregaDAO.BuscarPorId(EntregaDAO.getLastId()); Assert.IsTrue(EntregaDAO.Excluir(EntregaDAO.getLastId())); }
// passar o Usuario logado no sistema public EntregaLista_B() { entrega = new Entrega(); }
public Entrega InsertTblEntrega(Entrega entrega) { return(_CondoDatabase.InsertTblEntrega(entrega)); }
public async Task Atualizar(Entrega entrega) { _context.Entry(entrega).State = EntityState.Modified; await _context.SaveChangesAsync(); }
public void SetEntrega(Entrega pEntrega) { entrega = pEntrega; }
/// <summary> /// Agregar /// </summary> /// <param name="entidad"></param> /// <returns>Agrega una entrega</returns> public bool Agregar(Entrega entidad) { return(repositorio.Crear(entidad)); }
private void PrintMayorista(IList <EntregaItemVendido> nor, IList <EntregaItemVendido> of, IList <EntregaItemVendido> dev, Entrega ent) { double subt = 0; if (nor.Count > 0) { printLine(""); printLine(" Productos"); printLine(""); } System.Text.StringBuilder lb = new System.Text.StringBuilder(); string lbb = ""; int u = 0; foreach (EntregaItemVendido i in nor) { //f.Insert(0," ",5) lb = lb.Clear(); lb.Append(i.Producto.Codigo + " " + i.Producto.Nombre); lbb = "$ " + (i.CantidadNor * i.PrecioMayorista).ToString("#.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine("d123456789v123456789t123456789cu23456789c1234567"); //printLine(i.Producto.Codigo + " " + i.Producto.Descripcion); printLine(" " + i.CantidadNor.ToString("##") + " X $" + i.PrecioMayorista.ToString("#.##")); subt += (i.CantidadNor * i.PrecioMayorista); } if (nor.Count() > 0) { printLine(""); lb = lb.Clear(); lb.Append("--------------->"); lbb = "$ " + subt.ToString("##.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine("Sub Total Prod $ " + subt.ToString("##.##") + ""); if (ent.ClienteDescuento > 0) { lb = lb.Clear(); lb.Append("Descuento " + ent.ClienteDescuento.ToString() + "%"); lbb = "$ -" + (subt * (ent.ClienteDescuento / 100)).ToString("##.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine("Descuento " + ent.ClienteDescuento.ToString() + "% - $ " + (subt * (ent.ClienteDescuento / 100)).ToString("##.##")); subt -= (subt * (ent.ClienteDescuento / 100)); lb = lb.Clear(); lb.Append("Sub Total con Desc"); lbb = "$ " + subt.ToString("##.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine("Sub Total con Desc $ " + subt.ToString("##.##") ); } } if (of.Count > 0) { printLine(""); printLine("Ofertas"); printLine(""); } subt = 0; foreach (EntregaItemVendido i in of) { lb = lb.Clear(); lb.Append(i.Producto.Codigo + " " + i.Producto.Nombre); lbb = "$ " + (i.CantidadNor * i.PrecioMayorista).ToString("#.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine( i.Producto.Codigo + " $" + (i.CantidadNor * i.PrecioMayorista) ); printLine(i.CantidadNor + " x $" + i.PrecioMayorista); subt += (i.CantidadNor * i.PrecioOferta); } if (of.Count > 0) { lb = lb.Clear(); lb.Append("Sub Total Ofertas "); lbb = "$ " + subt.ToString("##.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine("Sub Total Ofertas $ " + subt.ToString("##.##")); } if (dev.Count() > 0) { printLine(""); printLine("Devoluciones"); printLine(""); } foreach (EntregaItemVendido i in dev) { lb = lb.Clear(); lb.Append(i.Producto.Codigo + " " + i.Producto.Nombre); lbb = "$ 0"; u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine("" + i.Producto.Codigo + "$ 0"); printLine(i.CantidadDev + " x $ 0"); } }
public void Imprimir(string pStrNomBluetooth, int intSleepTime, Entrega entrega, Perfil perfil) { try { string pStrTextoImprimir = string.Empty; string bt_printer = (from d in adapter.BondedDevices where d.Name == pStrNomBluetooth select d).FirstOrDefault().ToString(); device = adapter.GetRemoteDevice(bt_printer); UUID applicationUUID = UUID.FromString("00001101-0000-1000-8000-00805f9b34fb"); //socket.InputStream.Write() socket = device.CreateRfcommSocketToServiceRecord(applicationUUID); socket.Connect(); //socket.InputStream.Write(bytes,0, bytes.Length); //socket.InputStream.WriteByte(Byte.Parse("h")); outReader = new BufferedWriter(new OutputStreamWriter(socket.OutputStream)); printLine(perfil.FullName); printLine(perfil.Calle); printLine(perfil.Localidad); if (entrega != null) { printLine(perfil.Cuil + " " + entrega.Fecha.ToShortDateString()); } //printLine("d123456789v123456789t123456789cu23456789c1234567"); printLine("Item Descripcion Neto"); printLine(" Cant Precio Neto"); IList <EntregaItemVendido> nor = new List <EntregaItemVendido>(); IList <EntregaItemVendido> of = new List <EntregaItemVendido>(); IList <EntregaItemVendido> dev = new List <EntregaItemVendido>(); System.Text.StringBuilder st = new System.Text.StringBuilder(); if (entrega != null) { if (entrega.ItemVendidos.Count > 0) { foreach (EntregaItemVendido i in entrega.ItemVendidos) { if (i.Oferta && i.CantidadNor > 0) { of.Add(i); } if (i.Devolucion || i.CantidadDev > 0) { dev.Add(i); } if (!i.Oferta && i.CantidadNor > 0) { nor.Add(i); } } } } if (entrega.ClienteMayorista) { PrintMayorista(nor, of, dev, entrega); } else { PrintMinorista(nor, of, dev, entrega); } //outReader.WriteAsync(pStrTextoImprimir); //cabecera // //Body if (entrega != null) { System.Text.StringBuilder lb = new System.Text.StringBuilder(); string lbb = ""; int u = 0; lb = lb.Clear(); lb.Append(" TOTAL"); lbb = "$ " + entrega.Total.ToString("#.##"); u = 47 - (lb.Length + lbb.Length); lb.Insert(lb.Length, " ", u); lb.Append(lbb); printLine(lb.ToString()); //printLine(" TOTAL $" + // entrega.Total.ToString("#.##")); } printLine(" ESTE TICKET NO TIENE"); printLine(" VALIDEZ FISCAL"); printLine(""); printLine(""); } catch (System.Exception ex) { throw ex; } finally { if (socket != null) { outReader.Close(); socket.Close(); socket.Dispose(); } } }
//Preguntar si se financia con tarjeta de credito el envio, el tema del interes public void procesarDevolucionExcedente(Entrega entregaInstanciada) { notaCredito.Saldo = entregaInstanciada.PrecioEntrega; InterfazNotaCredito.lbl_subTotal.Text = notaCredito.Saldo.ToString("$0.00"); InterfazNotaCredito.lbl_saldo.Text = notaCredito.Saldo.ToString("$0.00"); }
public VendaFacade() { entrega = new Entrega(); ordemPedido = new OrdemPedido(); pagamento = new Pagamento(); }
public List <EstruturaEntregaControle> CarregarEventoEntrega(int eventoID, int entregaID, int entregaAreaID, int periodoID, bool disponiveis) { try { EntregaArea oEntregaArea = new EntregaArea(); EntregaPeriodo oEntregaPeriodo = new EntregaPeriodo(); Entrega oEntrega = new Entrega(); List <EstruturaEntregaControle> lista = new List <EstruturaEntregaControle>(); string filtroAux = " WHERE tEntrega.Disponivel = 'T' AND tEntregaControle.Ativa = 'T' "; if (entregaID > 0) { filtroAux += " AND tEntregaControle.EntregaID= " + entregaID; } if (entregaAreaID > 0) { filtroAux += " AND tEntregaControle.EntregaAreaID= " + entregaAreaID; } if (periodoID > 0) { filtroAux += " AND tEntregaControle.PeriodoID= " + periodoID; } if (disponiveis) { filtroAux += " AND EventoID is not NULL "; } string sql = @"SELECT tEntregaControle.ID, tEntregaControle.EntregaID, tEntregaControle.EntregaAreaID, tEntregaControle.PeriodoID, tEntregaControle.QuantidadeEntregas, tEntregaControle.Valor, tEntregaControle.ProcedimentoEntrega as ProcedimentoArea, tEntrega.ProcedimentoEntrega as ProcedimentoTaxa, tEventoEntregaControle.ProcedimentoEntrega as ProcedimentoEvento, tEventoEntregaControle.DiasTriagem, EventoID FROM tEntregaControle LEFT JOIN tEntrega ON tEntrega.ID = tEntregaControle.EntregaID LEFT JOIN tEventoEntregaControle ON tEventoEntregaControle.EntregaControleID = tEntregaControle.ID AND EventoID = " + eventoID + filtroAux + " ORDER BY EntregaID, EntregaAreaID, PeriodoID"; bd.Consulta(sql); while (bd.Consulta().Read()) { int areaID = bd.LerInt("EntregaAreaID"); string nomeArea = oEntregaArea.LerNome(areaID); int periodoIDConsulta = bd.LerInt("periodoID"); string nomePeriodo = oEntregaPeriodo.LerNome(periodoIDConsulta); int entregaIDConsulta = bd.LerInt("entregaID"); string nomeEntrega = oEntrega.LerNome(entregaIDConsulta); int diasTriagem = bd.LerInt("DiasTriagem"); bool disponivel = (bd.LerInt("EventoID") != 0); string procedimentoEvento = bd.LerString("ProcedimentoEvento"); string procedimentoTaxa = bd.LerString("ProcedimentoTaxa"); string procedimentoArea = bd.LerString("ProcedimentoArea"); string procedimento = string.Empty; if (procedimentoEvento.Length > 0) { procedimento = procedimentoEvento; } else if (procedimentoArea.Length > 0) { procedimento = procedimentoArea; } else if (procedimentoTaxa.Length > 0) { procedimento = procedimentoTaxa; } lista.Add(new EstruturaEntregaControle { ID = bd.LerInt("ID"), EntregaID = entregaIDConsulta, NomeTaxa = nomeEntrega, EntregaAreaID = areaID, NomeArea = nomeArea, UsarDiasTriagemPadrao = diasTriagem > 0 ? "Sim" : "Não", DiasTriagem = diasTriagem, PeriodoID = periodoID, NomePeriodo = nomePeriodo, Manter = disponivel ? "Sim" : "Não", UsarProcedimentoEntregaPadrao = procedimentoEvento.Length > 0 ? "Não" : "Sim", ProcedimentoEntrega = procedimento, QuantidadeEntregas = bd.LerInt("QuantidadeEntregas"), Valor = bd.LerDecimal("Valor"), Disponivel = disponivel }); } return(lista); } catch (Exception ex) { throw ex; } finally { bd.Fechar(); } }
public bool AltaEntega(Entrega unaEntrega) { bool exito = false; return(exito); }
public int buscarUltimoNroEntrega() { return(Entrega.mostrarUltimoNroEntrega()); }
// GET: Entrega/Details/5 public ActionResult Details(int id) { Entrega entrega = gerenciadorEntrega.Obter(id); return(View(entrega)); }
/// <summary> /// NotificarEntrega /// </summary> /// <param name="url">Url del servicio Pasamonte</param> /// <param name="apiKey">Clave de integracion</param> /// <param name="identificacionUsuario"></param> /// <param name="identificacionTerminal"></param> /// <param name="identificacionSistemaRemoto"></param> /// <param name="entrega">Entrega a notificar</param> /// <returns>Objeto con la respuesta. <see cref="RespuestaNotificarEntrega"/></returns> public async Task <RespuestaNotificarEntrega> RceNotificarEntrega ( string url, string apiKey, IdentificacionUsuario identificacionUsuario, IdentificacionTerminal identificacionTerminal, IdentificacionSistemaRemoto identificacionSistemaRemoto, Entrega entrega ) { if (!ValidarUrl(url)) { return(RespuestaErrorUrl <RespuestaNotificarEntrega>("RceNotificarEntrega")); } if (!ValidarApiKey(apiKey)) { return(RespuestaErrorApiKey <RespuestaNotificarEntrega>("RceNotificarEntrega")); } if (entrega == null) { return new RespuestaNotificarEntrega() { Status = StatusLlamada.ErrorDesconocido, Descripcion = "RceNotificarEntrega - Error parametro entrega nulo" } } ; var respuesta = new RespuestaNotificarEntrega() { }; using (var client = new HttpClient()) { client.BaseAddress = new Uri(url); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // HTTP POST var requestData = new { identificacionUsuario = identificacionUsuario, identificacionTerminal = identificacionTerminal, identificacionSistemaRemoto = identificacionSistemaRemoto, entrega = entrega }; var response = await client.PostAsJsonAsync ( RceAccionNotificarEntrega, requestData ); if (response.IsSuccessStatusCode) { respuesta = await response.Content.ReadAsAsync <RespuestaNotificarEntrega>(); } else { respuesta.Status = StatusLlamada.ErrorDesconocido; } } return(respuesta); } }
/// <summary> /// Modificar /// </summary> /// <param name="entidad"></param> /// <returns>regresa un empleado modificado</returns> public bool Modificar(Entrega entidad) { return(repositorio.Editar(entidad)); }
public async Task <IActionResult> Criar(Entrega entrega) { var entregaCriado = await _entregaRepository.Criar(entrega); return(CreatedAtAction(nameof(SelecionarPorId), new { id = entregaCriado.Id }, entregaCriado)); }
public static Boolean Excluir(Entrega entrega) { return(Excluir(entrega.Id)); }
public async Task <IActionResult> Atualizar(Entrega entrega) { await _entregaRepository.Atualizar(entrega); return(NoContent()); }
public void BuscarID() { Entrega e = EntregaDAO.BuscarPorId(EntregaDAO.getLastId()); Assert.IsNotNull(e); }
public async Task <IActionResult> Excluir(Entrega entrega) { await _entregaRepository.Excluir(entrega.Id); return(NoContent()); }
/// <summary> /// IMPORTANTE /// Este método obtiene todos los datos del documento electrónico, por el momento esta como sincrono para testing pero en producción se pondrá como asíncrono /// </summary> /// <param name="data_Documento"></param> /// <returns></returns> public DocumentoElectronico data(Data_Documentos data_Documento) { DocumentoElectronico documento; try { Data_CabeceraDocumento cabeceraDocumento = new Data_CabeceraDocumento(data_Documento.IdCabeceraDocumento); cabeceraDocumento.Read_CabeceraDocumento(); documento = new DocumentoElectronico() // Documento principal { SerieCorrelativo = data_Documento.SerieCorrelativo, TipoDocumento = data_Documento.TipoDocumento ?? string.Empty, FechaEmision = cabeceraDocumento.FechaEmision, HoraEmision = cabeceraDocumento.HoraEmision, FechaVencimiento = cabeceraDocumento.FechaVencimiento, OrdenCompra = cabeceraDocumento.OrdenCompra, Moneda = cabeceraDocumento.Moneda, TipoOperacion = cabeceraDocumento.TipoOperacion, MontoEnLetras = cabeceraDocumento.MontoEnLetras ?? string.Empty, CantidadItems = cabeceraDocumento.CantidadItems, TotalValorVenta = cabeceraDocumento.TotalValorVenta, TotalPrecioVenta = cabeceraDocumento.TotalPrecioVenta, TotalDescuento = cabeceraDocumento.TotalDescuento, TotalOtrosCargos = cabeceraDocumento.TotalOtrosCargos, TotalAnticipos = cabeceraDocumento.TotalAnticipos, ImporteTotalVenta = cabeceraDocumento.ImporteTotalVenta }; #region Emisor Data_Contribuyente Emisor = new Data_Contribuyente(data_Documento.IdEmisor); Emisor.Read_Contribuyente(); documento.Emisor = Emisor; #endregion Emisor #region Receptor Data_Contribuyente Receptor = new Data_Contribuyente(cabeceraDocumento.IdReceptor); Receptor.Read_Contribuyente(); documento.Receptor = Receptor; documento.Receptor.OtrosParticipantes = new List <Contribuyente>(); // Pendiente crear entidad OtrosParticipantes #endregion Receptor #region documentoDetalle Data_DocumentoDetalle data_DocumentoDetalle = new Data_DocumentoDetalle(data_Documento.IdCabeceraDocumento); List <DetalleDocumento> detalleDocumentos = data_DocumentoDetalle.Read_DocumentoDetalle(); if (detalleDocumentos.Count > 0) // Validar en caso de que no haya detalles del documento { foreach (var detalleDocumento in detalleDocumentos) { #region lineaTotalImpuesto Data_TotalImpuesto lineaTotalImpuesto = new Data_TotalImpuesto(detalleDocumento.IdDocumentoDetalle); List <TotalImpuesto> lineaTotalImpuestos = lineaTotalImpuesto.Read_TotalImpuestos(2); // El parámetro -> 2 <- es indicativo de que es por cada línea foreach (var st_totalImpuesto in lineaTotalImpuestos) { Data_SubTotalImpuesto data_SubTotalImpuesto = new Data_SubTotalImpuesto(st_totalImpuesto.IdTotalImpuestos); List <SubTotalImpuestos> subTotalImpuestos = data_SubTotalImpuesto.Read_SubTotalImpuesto(); st_totalImpuesto.SubTotalesImpuestos = subTotalImpuestos; } detalleDocumento.TotalImpuestos = lineaTotalImpuestos; #endregion lineaTotalImpuesto #region Notas Data_Nota lineaData_Nota = new Data_Nota(detalleDocumento.IdDocumentoDetalle); // Parámetro es el id de cabecera de documento List <Nota> lineaNotas = lineaData_Nota.Read(2); detalleDocumento.Notas = lineaNotas; #endregion Notas #region Descripciones List <Descripcion> descripciones = data_DocumentoDetalle.Read_Descripcion(detalleDocumento.IdDocumentoDetalle); detalleDocumento.Descripciones = descripciones; #endregion Descripciones #region PrecioAlternativo Data_PrecioAlternativo data_PrecioAlternativo = new Data_PrecioAlternativo(detalleDocumento.IdDocumentoDetalle); List <PrecioAlternativo> precioAlternativos = data_PrecioAlternativo.Read_PrecioAlternativo(); detalleDocumento.PreciosAlternativos = precioAlternativos; #endregion PrecioAlternativo #region emergency List <Descuento> descuentos = new List <Descuento>(); detalleDocumento.Descuentos = descuentos; List <PropiedadAdicional> propiedadAdicionales = new List <PropiedadAdicional>(); detalleDocumento.PropiedadesAdicionales = propiedadAdicionales; List <Entrega> entregas1 = new List <Entrega>(); Entrega data_entrega; data_entrega = new Entrega() { Cantidad = 0, MaximaCantidad = 0, Envio = new Envio(), }; entregas1.Add(data_entrega); detalleDocumento.Entregas = entregas1; #endregion emergency } documento.DetalleDocumentos = detalleDocumentos; } #endregion documentoDetalle #region TotalImpuestos Data_TotalImpuesto data_TotalImpuesto = new Data_TotalImpuesto(data_Documento.IdCabeceraDocumento); List <TotalImpuesto> totalImpuestos = data_TotalImpuesto.Read_TotalImpuestos(1); // El parámetro -> 1 <- es indicativo de que es por cada línea foreach (var st_totalImpuesto in totalImpuestos) { Data_SubTotalImpuesto data_SubTotalImpuesto = new Data_SubTotalImpuesto(st_totalImpuesto.IdTotalImpuestos); List <SubTotalImpuestos> subTotalImpuestos = data_SubTotalImpuesto.Read_SubTotalImpuesto(); st_totalImpuesto.SubTotalesImpuestos = subTotalImpuestos; } documento.TotalImpuestos = totalImpuestos; #endregion TotalImpuestos #region Notas Data_Nota data_Nota = new Data_Nota(data_Documento.IdCabeceraDocumento); // Parámetro es el id de cabecera de documento List <Nota> notas = data_Nota.Read(1); documento.Notas = notas; #endregion Notas #region TerminosEntregas Data_TerminosEntrega data_TerminosEntrega = new Data_TerminosEntrega(data_Documento.IdCabeceraDocumento); data_TerminosEntrega.Read_TerminosEntrega(); // El parámetro -> 1 <- es indicativo de que es por cada línea documento.TerminosEntrega = data_TerminosEntrega; #endregion TerminosEntregas #region Anticipos Data_Anticipo anticipo = new Data_Anticipo(data_Documento.IdCabeceraDocumento); List <Anticipo> anticipos = anticipo.Read_Anticipo(); documento.Anticipos = anticipos; #endregion Anticipos List <PeriodoFactura> periodoFacturas = null; List <DocumentoRelacionado> documentoRelacionados = null; List <DocumentoRelacionado> otrosDocumentosRelacionados = null; List <Entrega> entregas = null; List <MedioPago> medioPagos = null; List <Descuento> item_descuentos = null; documento.Relacionados = documentoRelacionados; documento.OtrosDocumentosRelacionados = otrosDocumentosRelacionados; documento.Entregas = entregas; documento.MedioPagos = medioPagos; documento.Descuentos = item_descuentos; documento.PeriodosFactura = periodoFacturas; } catch (Exception ex) { documento = new DocumentoElectronico(); } return(documento); }
public Task <int> DeleteItemAsync(Entrega item) { return(database.DeleteAsync(item)); }
// passar o Usuario logado no sistema public EntregaLista_B(int usuarioIDLogado) { entrega = new Entrega(usuarioIDLogado); }
public Entrega GuardarEntrega(Entrega entrega) { EntregaDAO entregaDAO = new EntregaDAO(); return(entregaDAO.GuardarEntrega(entrega)); }
public void Seed() { if (_context.Osc.Any() || _context.Membro.Any() || _context.Usuario.Any() || _context.Produto.Any() || _context.Fornecedor.Any() || _context.Recebimento.Any() || _context.Entrega.Any()) { return; //DB já foi populado } Osc osc1 = new Osc(1, "Ymagi Social", "Ymagi", "123456789", "Daniel", "daniel@ymagi", "1234567", "Cep", "Holanda", "1054", "2", "Vila Mariana", "Ribeirao Preto", "SP", "Daniel", "Adm"); Osc osc2 = new Osc(2, "Mentoria Social", "Mentoria", "123456789", "Gisele", "daniel@ymagi", "1234567", "Cep", "Holanda", "1054", "2", "Vila Mariana", "Ribeirao Preto", "SP", "Daniel", "Adm"); Osc osc3 = new Osc(3, "Resolvi Mudar", "Resolvi Mudar", "123456789", "Paula", "daniel@ymagi", "1234567", "Cep", "Holanda", "1054", "2", "Vila Mariana", "Ribeirao Preto", "SP", "Daniel", "Adm"); Membro mem1 = new Membro(1, "Daniel Gibeli", "12345678", "2548255", "254455225", "email", new DateTime(1984, 08, 03), "Masc", "Solteiro", "3", new DateTime(2020, 09, 05), "14075240", "Holanda", "1054", "m", "vl mariana", "ribeirao", "SP", osc1); Membro mem2 = new Membro(2, "Gisele", "12345678", "2548255", "254455225", "email", new DateTime(1984, 08, 03), "Masc", "Solteiro", "2", new DateTime(2020, 09, 05), "14075240", "Holanda", "1054", "m", "vl mariana", "ribeirao", "SP", osc2); Usuario us1 = new Usuario(1, "Daniel", "123456", "123456", "25487", "daniel@gmail", new DateTime(1980, 05, 03), "Masc", "Casado", "2", new DateTime(2020, 09, 05), "14075210", "Guiana", "450", "34m", "Vl Mariana", "Ribs", "SP", mem1); Usuario us2 = new Usuario(2, "Giseli", "123456", "12345", "25487", "daniel@gmail", new DateTime(1980, 05, 03), "Masc", "Casado", "1", new DateTime(2020, 09, 05), "14075210", "Guiana", "450", "34m", "Vl Mariana", "Ribs", "SP", mem2); Fornecedor for1 = new Fornecedor(1, "Ymagi Gestao Ltda", "Ymagi", "123456789", "22222222", "Daniel", "Cep", "Holanda", "1054", "casa", "Vl Mariana", "Ribeirao Preto", "SP", "999945651", "*****@*****.**", mem1); Fornecedor for2 = new Fornecedor(2, "Copapar", "Copapar", "123456789", "22225555", "Daniel", "Cep", "Holanda", "1054", "casa", "Vl Mariana", "Ribeirao Preto", "SP", "999945651", "*****@*****.**", mem2); Produto p1 = new Produto(1, "Arroz", "KG", 10, 10, 15, 15, new DateTime(1985, 07, 03), for1, us2, mem1); Produto p2 = new Produto(2, "Feijão", "KG", 10, 10, 15, 15, new DateTime(1985, 07, 03), for2, us1, mem2); Entrega en1 = new Entrega(1, new DateTime(2020, 09, 05), p1, 2, 10, 20, us2, mem1, DoacoesStatus.Efetivada); Entrega en2 = new Entrega(2, new DateTime(2020, 08, 03), p2, 5, 100, 500, us1, mem2, DoacoesStatus.Programada); Entrega en3 = new Entrega(3, new DateTime(2020, 10, 11), p1, 10, 5, 50, us2, mem2, DoacoesStatus.Cancelada); Recebimento rec1 = new Recebimento(1, p2, 10, 10, 10, 1000, new DateTime(2020, 09, 05), us1, mem1, for1, DoacoesStatus.Cancelada); Recebimento rec2 = new Recebimento(2, p1, 2, 2, 4, 8, new DateTime(2020, 02, 12), us1, mem1, for2, DoacoesStatus.Efetivada); _context.Osc.AddRange(osc1, osc2, osc3); _context.Membro.AddRange(mem1, mem2); _context.Usuario.AddRange(us1, us2); _context.Fornecedor.AddRange(for1, for2); _context.Produto.AddRange(p1, p2); _context.Entrega.AddRange(en1, en2, en3); _context.Recebimento.AddRange(rec1, rec2); _context.SaveChanges(); }
public bool Nuevo(string articuloID, int disponible, Entrega entrega) { return(_stockADO.InsertarStock(articuloID, disponible, entrega)); }
public EntregaCreacionViewModel() { ItemMaster = new EntregaMock(); Item = new Entrega(); iVendidos = new ObservableRangeCollection <EntregaItemVendido>(); MessagingCenter.Subscribe <EntregaAddProducto, EntregaItemVendido>(this, "AddItemVendido", (obj, item) => { try { var _item = item as EntregaItemVendido; if (!editingPosition.Equals(-1)) { iVendidos.RemoveAt(editingPosition); } editingPosition = -1; iVendidos.Add(_item); //stock[_item.Producto.Codigo] -= _item.Cantidad; SetStock(_item.Producto.Codigo, _item.Cantidad, false); Item.SubTotal = Item.SubTotal + _item.SubTotal; Item.Total = 0; foreach (EntregaItemVendido eiv in iVendidos) { if (!eiv.Devolucion && !eiv.Oferta) { Item.Total += (eiv.SubTotal - (eiv.SubTotal * (Item.ClienteDescuento / 100))); } else { Item.Total += eiv.SubTotal; } } MessagingCenter.Send(this, "EntregatotalNuevo", Item); //this.TotalAmount.Text = "$ " + Item.Total.ToString(); } catch (Exception ex) { } }); MessagingCenter.Subscribe <EntregaAddProducto, int>(this, "DeleteItemVendido", (obj, item) => { try { if (!editingPosition.Equals(-1)) { iVendidos.RemoveAt(editingPosition); } editingPosition = -1; Item.SubTotal = 0; Item.Total = 0; foreach (EntregaItemVendido eiv in iVendidos) { if (!eiv.Devolucion && !eiv.Oferta) { Item.Total += (eiv.SubTotal - (eiv.SubTotal * (Item.ClienteDescuento / 100))); } else { Item.Total += eiv.SubTotal; } Item.SubTotal += eiv.SubTotal; } MessagingCenter.Send(this, "EntregatotalNuevo", Item); //this.TotalAmount.Text = "$ " + Item.Total.ToString(); } catch (Exception ex) { } }); MessagingCenter.Subscribe <EntregaAddProducto, int>(this, "CerrarItemVendido", (obj, item) => { try { if (!editingPosition.Equals(-1)) { var _item = iVendidos[editingPosition]; if (_item != null) { SetStock(_item.Producto.Codigo, _item.Cantidad, false); } editingPosition = -1; } } catch (Exception ex) { } }); }
public void Delete(Entrega entidade) { Database.GetConnection().Delete(entidade); }