示例#1
0
 /// <summary>
 /// Almacenamiento de una Linea Ticket
 /// </summary>
 /// <param name="lineaTicket">Objeto de peticion linea ticket de la venta</param>
 /// <returns></returns>
 public ResponseBussiness <OperacionLineaTicketVentaResponse> AgregarLineaTicketVenta(LineaTicket lineaTicket)
 {
     return(tryCatch.SafeExecutor(() =>
     {
         OperacionLineaTicketVentaResponse response = repository.AgregarLineaTicketVenta(token.CodeStore, token.CodeBox, token.CodeEmployee, lineaTicket);
         return response;
     }));
 }
示例#2
0
        /// <summary>
        /// Almacenamiento de una Linea Ticket
        /// </summary>
        /// <param name="codeStore">Código de tienda</param>
        /// <param name="codeBox">Código de caja</param>
        /// <param name="codeEmployee">Código de empleado cajero</param>
        /// <param name="lineaTicket">Objeto de peticion linea ticket de la venta</param>
        /// <returns>Resultado de la operación</returns>
        public OperacionLineaTicketVentaResponse AgregarLineaTicketVenta(int codeStore, int codeBox, int codeEmployee, LineaTicket lineaTicket)
        {
            OperacionLineaTicketVentaResponse operacionLineaTicketVentaResponse = new OperacionLineaTicketVentaResponse();

            using (TransactionScope scope = new TransactionScope())
            {
                operacionLineaTicketVentaResponse.FolioOperacion = lineaTicket.cabeceraVentaRequest.FolioOperacion;
                if (operacionLineaTicketVentaResponse.FolioOperacion == "")
                {
                    operacionLineaTicketVentaResponse.FolioOperacion = this.AgregarCabeceraApartado(codeStore, codeBox,
                                                                                                    codeEmployee, lineaTicket.cabeceraVentaRequest);
                }
                this.AgregarDetalleApartado(operacionLineaTicketVentaResponse.FolioOperacion, codeStore, codeBox,
                                            lineaTicket.cabeceraVentaRequest.TipoCabeceraVenta, lineaTicket);
                this.ActualizarCabeceraApartado(codeStore, codeBox, codeEmployee, lineaTicket.cabeceraVentaRequest);
                scope.Complete();
            }
            return(operacionLineaTicketVentaResponse);
        }