示例#1
0
 // methods for listing all facturas
 public static List<factura> listAllRentFacturas()
 {
     List<factura> list = new List<factura>();
     using (SqlConnection con = DBcomun.getConnection())
     {
         SqlCommand comand = new SqlCommand("SELECT facturasAlquiler.ID AS CodigoFactura, facturasAlquiler.casoID AS NumeroCaso, facturasAlquiler.TotalBalance AS BalanceTotal, facturasAlquiler.Pago AS PagoRealizado, facturasAlquiler.NuevoBalance, facturasAlquiler.ProximoPago AS FechaProximoPago, customers.name AS NombreCli, customers.lastname AS ApellidCli, customers.idcard AS CedulaoPasaporte, services.cService AS Servicio, facturasAlquiler.Detalles AS DetallesPago FROM facturasAlquiler INNER JOIN customers ON customers.ID = facturasAlquiler.clienteID INNER JOIN services ON services.ID = facturasAlquiler.servicioID", con);
         SqlDataReader re = comand.ExecuteReader();
         while(re.Read())
         {
             factura pFactura = new factura();
             pFactura.ID_Factura = re["CodigoFactura"].ToString();
             pFactura.Apellido_Cliente = re["ApellidCli"].ToString();
             pFactura.Balance_Total = re["BalanceTotal"].ToString();
             pFactura.Caso_NO = re["NumeroCaso"].ToString();
             pFactura.Fecha_Proximo_Pago = re["FechaProximoPago"].ToString();
             pFactura.Nombre_Cliente = re["NombreCli"].ToString();
             pFactura.Nuevo_Balance = re["NuevoBalance"].ToString();
             pFactura.Pago_Realizado = re["PagoRealizado"].ToString();
             pFactura.Servicio = re["Servicio"].ToString();
             list.Add(pFactura);
         }
         con.Close();
     }
     return list;
 }
示例#2
0
        // methods for listing all facturas
        public static List <factura> listAllRentFacturas()
        {
            List <factura> list = new List <factura>();

            using (SqlConnection con = DBcomun.getConnection())
            {
                SqlCommand    comand = new SqlCommand("SELECT facturasAlquiler.ID AS CodigoFactura, facturasAlquiler.casoID AS NumeroCaso, facturasAlquiler.TotalBalance AS BalanceTotal, facturasAlquiler.Pago AS PagoRealizado, facturasAlquiler.NuevoBalance, facturasAlquiler.ProximoPago AS FechaProximoPago, customers.name AS NombreCli, customers.lastname AS ApellidCli, customers.idcard AS CedulaoPasaporte, services.cService AS Servicio, facturasAlquiler.Detalles AS DetallesPago FROM facturasAlquiler INNER JOIN customers ON customers.ID = facturasAlquiler.clienteID INNER JOIN services ON services.ID = facturasAlquiler.servicioID", con);
                SqlDataReader re     = comand.ExecuteReader();
                while (re.Read())
                {
                    factura pFactura = new factura();
                    pFactura.ID_Factura         = re["CodigoFactura"].ToString();
                    pFactura.Apellido_Cliente   = re["ApellidCli"].ToString();
                    pFactura.Balance_Total      = re["BalanceTotal"].ToString();
                    pFactura.Caso_NO            = re["NumeroCaso"].ToString();
                    pFactura.Fecha_Proximo_Pago = re["FechaProximoPago"].ToString();
                    pFactura.Nombre_Cliente     = re["NombreCli"].ToString();
                    pFactura.Nuevo_Balance      = re["NuevoBalance"].ToString();
                    pFactura.Pago_Realizado     = re["PagoRealizado"].ToString();
                    pFactura.Servicio           = re["Servicio"].ToString();
                    list.Add(pFactura);
                }
                con.Close();
            }
            return(list);
        }
示例#3
0
        public static List <factura> searchFacturasVenta(string CasoNO, string CedulaPasaporte, string nombre, string apellido)
        {
            List <factura> list = new List <factura>();

            using (SqlConnection con = DBcomun.getConnection())
            {
                SqlCommand comand = new SqlCommand(string.Format("SELECT facturasVenta.ID, facturasVenta.casoID AS NumeroCaso, services.cService, customers.name, customers.lastname, facturasVenta.TotalBalance, facturasVenta.Pago, facturasVenta.NuevoBalance FROM facturasVenta INNER JOIN customers ON customers.ID = facturasVenta.ClienteID INNER JOIN services ON services.ID = facturasVenta.servicioID " +
                                                                 " WHERE facturasVenta.casoID LIKE '{0}%' AND customers.name LIKE '{1}%' AND customers.lastname LIKE '{2}%' AND customers.idcard LIKE '{3}%'",
                                                                 CasoNO, nombre, apellido, CedulaPasaporte), con);
                SqlDataReader re = comand.ExecuteReader();
                while (re.Read())
                {
                    factura pFactura = new factura();
                    pFactura.ID_Factura         = re["ID"].ToString();
                    pFactura.Apellido_Cliente   = re["lastname"].ToString();
                    pFactura.Balance_Total      = re["TotalBalance"].ToString();
                    pFactura.Caso_NO            = re["NumeroCaso"].ToString();
                    pFactura.Fecha_Proximo_Pago = "No se ha registrado";
                    pFactura.Nombre_Cliente     = re["name"].ToString();
                    pFactura.Nuevo_Balance      = re["NuevoBalance"].ToString();
                    pFactura.Pago_Realizado     = re["Pago"].ToString();
                    pFactura.Servicio           = re["cService"].ToString();
                    list.Add(pFactura);
                }
                con.Close();
            }
            return(list);
        }
示例#4
0
        public static List <factura> listAllVentafacturas()
        {
            List <factura> list = new List <factura>();

            using (SqlConnection con = DBcomun.getConnection())
            {
                SqlCommand    comand = new SqlCommand("SELECT facturasVenta.ID, facturasVenta.casoID AS NumeroCaso, services.cService, customers.name, customers.lastname, facturasVenta.TotalBalance, facturasVenta.Pago, facturasVenta.NuevoBalance FROM facturasVenta INNER JOIN customers ON customers.ID = facturasVenta.ClienteID INNER JOIN services ON services.ID = facturasVenta.servicioID", con);
                SqlDataReader re     = comand.ExecuteReader();
                while (re.Read())
                {
                    factura pFactura = new factura();
                    pFactura.ID_Factura         = re["ID"].ToString();
                    pFactura.Apellido_Cliente   = re["lastname"].ToString();
                    pFactura.Balance_Total      = re["TotalBalance"].ToString();
                    pFactura.Caso_NO            = re["NumeroCaso"].ToString();
                    pFactura.Fecha_Proximo_Pago = "No se ha registrado";
                    pFactura.Nombre_Cliente     = re["name"].ToString();
                    pFactura.Nuevo_Balance      = re["NuevoBalance"].ToString();
                    pFactura.Pago_Realizado     = re["Pago"].ToString();
                    pFactura.Servicio           = re["cService"].ToString();
                    list.Add(pFactura);
                }
                con.Close();
            }
            return(list);
        }
示例#5
0
 public static List<factura> listAllDivorciosAccidenteFacturas()
 {
     List<factura> list = new List<factura>();
     using(SqlConnection con = DBcomun.getConnection())
     {
         SqlCommand comand = new SqlCommand("SELECT facturasDivorciosAccidente.ID, facturasDivorciosAccidente.casoID AS NumeroCaso, services.cService, customers.name, customers.lastname, facturasDivorciosAccidente.TotalBalance, facturasDivorciosAccidente.Pago, facturasDivorciosAccidente.NuevoBalance FROM facturasDivorciosAccidente INNER JOIN customers ON customers.ID = facturasDivorciosAccidente.ClienteID INNER JOIN services ON services.ID = facturasDivorciosAccidente.servicioID", con);
         SqlDataReader re = comand.ExecuteReader();
         while (re.Read())
         {
             factura pFactura = new factura();
             pFactura.ID_Factura = re["ID"].ToString();
             pFactura.Apellido_Cliente = re["lastname"].ToString();
             pFactura.Balance_Total = re["TotalBalance"].ToString();
             pFactura.Caso_NO = re["NumeroCaso"].ToString();
             pFactura.Fecha_Proximo_Pago = "No se ha registrado";
             pFactura.Nombre_Cliente = re["name"].ToString();
             pFactura.Nuevo_Balance = re["NuevoBalance"].ToString();
             pFactura.Pago_Realizado = re["Pago"].ToString();
             pFactura.Servicio = re["cService"].ToString();
             list.Add(pFactura);
         }
         con.Close();
     }
     return list;
 }
示例#6
0
 public static List<factura> searchFacturasVenta(string CasoNO, string CedulaPasaporte, string nombre, string apellido)
 {
     List<factura> list = new List<factura>();
     using(SqlConnection con = DBcomun.getConnection())
     {
         SqlCommand comand = new SqlCommand(string.Format("SELECT facturasVenta.ID, facturasVenta.casoID AS NumeroCaso, services.cService, customers.name, customers.lastname, facturasVenta.TotalBalance, facturasVenta.Pago, facturasVenta.NuevoBalance FROM facturasVenta INNER JOIN customers ON customers.ID = facturasVenta.ClienteID INNER JOIN services ON services.ID = facturasVenta.servicioID " + 
             " WHERE facturasVenta.casoID LIKE '{0}%' AND customers.name LIKE '{1}%' AND customers.lastname LIKE '{2}%' AND customers.idcard LIKE '{3}%'",
             CasoNO, nombre, apellido, CedulaPasaporte), con);
         SqlDataReader re = comand.ExecuteReader();
         while (re.Read())
         {
             factura pFactura = new factura();
             pFactura.ID_Factura = re["ID"].ToString();
             pFactura.Apellido_Cliente = re["lastname"].ToString();
             pFactura.Balance_Total = re["TotalBalance"].ToString();
             pFactura.Caso_NO = re["NumeroCaso"].ToString();
             pFactura.Fecha_Proximo_Pago = "No se ha registrado";
             pFactura.Nombre_Cliente = re["name"].ToString();
             pFactura.Nuevo_Balance = re["NuevoBalance"].ToString();
             pFactura.Pago_Realizado = re["Pago"].ToString();
             pFactura.Servicio = re["cService"].ToString();
             list.Add(pFactura);
         }
         con.Close();
     }
     return list;
 }