예제 #1
0
        static void Main(string[] args)
        {
            // configuracion de los servicion
            ServicioEmpleado _servicioEmpleado = new ServicioEmpleado(new RepositorioEmpleado());
            ServicioPago     _servicioPago     = new ServicioPago(new RepositorioPago());

            List <EmpleadoDTO> listadoEmpleados = _servicioEmpleado.ObtenerTodos();
            List <PagoDTO>     listadoPagos     = _servicioPago.ObtenerTodos();

            PagoDTO pagoDTO = new PagoDTO();

            pagoDTO.IdEmpleado  = 2;
            pagoDTO.Fecha       = DateTime.Now;
            pagoDTO.SueldoBruto = 100000f;

            _servicioPago.InsertarPago(pagoDTO);

            for (int e = 0; e < listadoEmpleados.Count; e++)
            {
                EmpleadoDTO empleado = listadoEmpleados[e];
                Console.WriteLine(string.Format("{0} {1} - Puesto: {2}", empleado.Nombre, empleado.Apellido, empleado.Puesto));

                List <PagoDTO> pagosEmpleado = _servicioPago.ObtenerPagoEmpleado(empleado.Id);

                for (int p = 0; p < pagosEmpleado.Count; p++)
                {
                    PagoDTO pago = pagosEmpleado[p];
                    Console.WriteLine(string.Format("   Monto: {0:0.00} - Fecha: {1}", pago.SueldoBruto, pago.Fecha));
                }
            }

            Console.ReadKey();
        }
예제 #2
0
        public bool EnviarInicioVersion(string Version, string APP)
        {
            PipeClient    pipeClient = new PipeClient();
            ServicioPago  servicio   = new ServicioPago();
            List <string> data       = new List <string>();
            var           cambiover  = false;

            if (APP == "APP_PAGO" && Version != Globals.VAppFPago)
            {
                Globals.VAppFPago = Version;
                cambiover         = true;
            }

            if (APP == "APP_EFE" && Version != Globals.VAppFEfe)
            {
                Globals.VAppFEfe = Version;
                cambiover        = true;
            }

            if (APP == "APP_TES" && Version != Globals.VAppFTes)
            {
                Globals.VAppFTes = Version;
                cambiover        = true;
            }

            if (APP == "SRVLOC2" && Version != Globals.VAppSV2)
            {
                Globals.VAppSV2 = Version;
                cambiover       = true;
            }
            if (APP == "APILOC")
            {
                cambiover = true;
            }
            if (cambiover == true)
            {
                data.Add("0");
                data.Add(Version);
                data.Add(APP);
                var resultado = false;
                pipeClient.Message = servicio.BuildMessage(ServicioPago.Comandos.APP_FRTINI, data);
                resultado          = pipeClient.SendMessage(ServicioPago.Comandos.APP_FRTINI);
                if (resultado == true)
                {
                    var datos = pipeClient.Resultado.Data[0].Split("~");
                    Globals.idmaquina     = datos[0];
                    Globals.nombremaquina = datos[1];
                }
                return(resultado);
            }
            else
            {
                return(true);
            }
        }
예제 #3
0
        public void VersionServicioPago2()
        {
            PipeClient2   pipeClient2 = new PipeClient2();
            ServicioPago  servicio    = new ServicioPago();
            List <string> data        = new List <string>();

            data.Add("");
            var resultado = false;

            pipeClient2.Message = servicio.BuildMessage(ServicioPago.Comandos.APP_FRTINI, data);
            resultado           = pipeClient2.SendMessage(ServicioPago.Comandos.APP_FRTINI);
            if (resultado == true)
            {
                EnviarInicioVersion(pipeClient2.Resultado.Data[0], "SRVLOC2");
            }
        }
예제 #4
0
        public bool EnviarFinVersion()
        {
            PipeClient    pipeClient = new PipeClient();
            ServicioPago  servicio   = new ServicioPago();
            List <string> data       = new List <string>();

            data.Add("0");
            var resultado = false;

            pipeClient.Message = servicio.BuildMessage(ServicioPago.Comandos.APP_FRTFIN, data);
            resultado          = pipeClient.SendMessage(ServicioPago.Comandos.APP_FRTFIN);
            if (resultado == true)
            {
                var respuesta = pipeClient.Resultado.Data;
            }
            return(resultado);
        }
예제 #5
0
 public PresentadorPago(IPagoRepositorio Ipr, IAgregarPago vista)
 {
     servicioPago = new ServicioPago(Ipr);
     IagregarPago = vista;
 }
예제 #6
0
 public PresentadorPagosDetalle(IPagoRepositorio IpagoR, IMostrarPagosDetalle vista)
 {
     servicioPago         = new ServicioPago(IpagoR);
     ImostrarPagosDetalle = vista;
 }
 public PresentadorPagosPorAlumno(IPagoRepositorio ipago, IBuscarPagosPorAlumno vista)
 {
     servicioPago = new ServicioPago(ipago);
     ibusqueda    = vista;
 }