示例#1
0
 //FUNCIONES DE BUSQUEDA DE CLIENTE
 public bool searchCliente(String RFC)
 {
     BD bd = new BD();
     List<String[]> data;
     data = bd.Execute("SELECT * FROM cliente WHERE RFC = '" + RFC + "';");
     foreach (String[] cad in data)
     {
         this.RFC = cad[0];
         this.Nombre = cad[1];
         this.Colonia = cad[2];
         this.Calle = cad[3];
         this.Numero = cad[4];
         this.NumInt = cad[5];
         this.CodigoPostal =Convert.ToInt32(cad[6]);
         this.DelegMunip = cad[7];
         this.Estado = cad[8];
         this.Correo = cad[9];
         this.Telefono = cad[10];
     }
     if (String.IsNullOrEmpty(this.RFC))
         return false;
     return true;
 }
示例#2
0
        public void pushFactura()
        {
            BD bd = new BD();
            getFolio();
            foreach (Articulo aux in arts)
            {
                bd.ExecuteNonQuery("INSERT INTO articulo VALUES(NULL, '" + aux.nombre + "','" + aux.cantidad.ToString() + "','" + aux.precio.ToString() + "','" + aux.tipo + "',"+folio+");");
            }

            bd.ExecuteNonQuery("INSERT INTO factura VALUES(" + folio + ",'" + cliente.rfc + "','" + DateTime.Today.ToString("yyyy-MM-dd") + "')");
            this.printFact();
        }
示例#3
0
 public bool creaCliente(String RFC, String Nombre, String Colonia, String Calle,String Numero, String NumeroInt, int CodigoPostal, String DelegMunip, String Estado, String Correo, String Telefono)
 {
     BD bd = new BD();
     if (bd.ExecuteNonQuery("INSERT INTO cliente VALUES ('" + RFC + "','" + Nombre + "','" + Colonia + "','" + Calle + "','" + Numero + "','" + NumeroInt + "','" + CodigoPostal + "','" + DelegMunip + "','" + Estado + "','" + Telefono + "','" + Correo + "');"))
     {
         MessageBox.Show("CLIENTE DADO DE ALTA CORRECTAMENTE");
         this.RFC = RFC;
         this.Nombre = Nombre;
         this.Colonia = Colonia;
         this.Calle = Calle;
         this.Numero = Numero;
         this.NumInt = NumeroInt;
         this.CodigoPostal = CodigoPostal;
         this.DelegMunip = DelegMunip;
         this.Estado = Estado;
         this.Telefono = Telefono;
         this.Correo= Correo;
         return true;
     }
     else
     {
         MessageBox.Show("CLIENTE NO DADO DE ALTA CONSULTE AL ADMIN");
         return false;
     }
 }
示例#4
0
 private void getFolio()
 {
     BD bd = new BD();
     List<String[]> rs =bd.Execute("SELECT Folio FROM factura ORDER BY Folio ASC");
     if (rs.Count != 0)
     {
         foreach (String[] data in rs)
         {
             folio = Convert.ToInt32(data[0]);
             folio++;
         }
     }
 }