Beispiel #1
0
        public static ML.Response.TarjetasResponse UpdateRe(ML.Entities.Tarjetas tarjetas)
        {
            ML.Response.TarjetasResponse response = new ML.Response.TarjetasResponse();
            try
            {
                using (DL.BancoEntities context = new DL.BancoEntities())
                {
                    var UpdateRe = context.RetiroSaldo(tarjetas.NoTarjeta, tarjetas.Saldo);

                    if (UpdateRe > 0)
                    {
                        response.Code         = 100;
                        response.Message      = "Retiro exitoso";
                        response.TarjetasList = new List <ML.Entities.Tarjetas>();
                        return(response);
                    }
                    else
                    {
                        response.Code         = 50;
                        response.Message      = "error al retirar";
                        response.TarjetasList = new List <ML.Entities.Tarjetas>();
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                response.Code         = -100;
                response.Message      = "Reporta con sistemas" + ex;
                response.TarjetasList = new List <ML.Entities.Tarjetas>();
                return(response);
            }
        }
Beispiel #2
0
        public static ML.Response.TarjetasResponse GetNip(ML.Entities.Tarjetas tarjetas)
        {
            ML.Response.TarjetasResponse response = new ML.Response.TarjetasResponse();
            try
            {
                using (DL.BancoEntities context = new DL.BancoEntities())
                {
                    var logeo = context.GetNip(tarjetas.NoTarjeta, tarjetas.Nip).ToList();

                    if (logeo.Count > 0)
                    {
                        response.Code         = 100;
                        response.Message      = "Mapeo Exitoso";
                        response.TarjetasList = new List <ML.Entities.Tarjetas>();

                        foreach (var obj in logeo)
                        {
                            ML.Entities.Tarjetas TarjetasItem = new ML.Entities.Tarjetas();
                            TarjetasItem.IdTarjetas          = obj.IdTarjeta;
                            TarjetasItem.NoCuenta            = obj.NoCuenta;
                            TarjetasItem.NoTarjeta           = obj.NoTarjeta;
                            TarjetasItem.Nip                 = obj.Nip;
                            TarjetasItem.Saldo               = obj.Saldo;
                            TarjetasItem.Clientes            = new ML.Entities.Clientes();
                            TarjetasItem.Clientes.IdClientes = obj.IdClientes;
                            response.TarjetasList.Add(TarjetasItem);
                        }

                        return(response);
                    }
                    else
                    {
                        response.Code         = 50;
                        response.Message      = "error al buscar";
                        response.TarjetasList = new List <ML.Entities.Tarjetas>();
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                response.Code         = -100;
                response.Message      = "Reporta con sistemas" + ex;
                response.TarjetasList = new List <ML.Entities.Tarjetas>();
                return(response);
            }
        }
Beispiel #3
0
        public static ML.Response.TarjetasResponse GetSaldo(ML.Entities.Tarjetas tarjetas)
        {
            ML.Response.TarjetasResponse response = new ML.Response.TarjetasResponse();
            try
            {
                using (DL.BancoEntities context = new DL.BancoEntities())
                {
                    var GetSal = context.GetSaldo(tarjetas.Saldo);

                    if (GetSal != null)
                    {
                        response.Code         = 100;
                        response.Message      = "mapeo exitoso";
                        response.TarjetasList = new List <ML.Entities.Tarjetas>();

                        foreach (var obj in GetSal)
                        {
                            ML.Entities.Tarjetas TarjetasItem = new ML.Entities.Tarjetas();
                            TarjetasItem.Saldo = obj.GetValueOrDefault();
                            response.TarjetasList.Add(TarjetasItem);
                        }

                        return(response);
                    }

                    else
                    {
                        response.Code         = 50;
                        response.Message      = "no se encontro saldo";
                        response.TarjetasList = new List <ML.Entities.Tarjetas>();
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                response.Code         = -100;
                response.Message      = "Reporta con sistemas" + ex;
                response.TarjetasList = new List <ML.Entities.Tarjetas>();
                return(response);
            }
        }
Beispiel #4
0
        public static ML.Response.ClientesResponse GetTarjeta(ML.Entities.Tarjetas tarjetas)
        {
            ML.Response.ClientesResponse response = new ML.Response.ClientesResponse();
            try
            {
                using (DL.BancoEntities context = new DL.BancoEntities())

                {
                    var GetTar = context.GetTarjeta(tarjetas.NoTarjeta);
                    if (GetTar != null)
                    {
                        response.Code         = 100;
                        response.Message      = "Mapeo Exitoso";
                        response.ClientesList = new List <ML.Entities.Clientes>();
                        foreach (var obj in GetTar)
                        {
                            ML.Entities.Clientes ClientesItem = new ML.Entities.Clientes();
                            ClientesItem.Nombre = obj.ToString();
                            response.ClientesList.Add(ClientesItem);
                        }

                        return(response);
                    }

                    else
                    {
                        response.Code         = 50;
                        response.Message      = "no se encontraron datos";
                        response.ClientesList = new List <ML.Entities.Clientes>();
                        return(response);
                    }
                }
            }
            catch (Exception ex)
            {
                response.Code         = -100;
                response.Message      = "Reporta con sistemas" + ex;
                response.ClientesList = new List <ML.Entities.Clientes>();
                return(response);
            }
        }