martes, 25 de mayo de 2010

documentacion

1. Construcción de la Base de datos y las tablas del sistema.
Para crear la base de datos con las tablas de nuestro sistema se realizo el siguiente proceso:
Dentro de visual C#, creamos un nuevo proyecto para la construcción de nuestro sistema, en la interfaz de C#, en Archivo- nuevo- proyecto se creo la forma del proyecto.
Luego se creo la Base de Datos. En el explorados de soluciones, agregar nuevo ítem y seleccionamos el icono de Base de datos para crear la base de datos, luego sobre la base de datos agregar nuevo tabla, esto para agregar la tabla con los campos que se necesitan.

Esto es para realizar la Base de datos y crear las tablas.
2. El proyecto esta dividido en seis formularios de Windows que fueron añadidos al proyecto, cada formulario esta programado y tiene su funcionalidad propia lo que hace a Yareli sistems un sistema con una interfaz de usuario muy amigable y llamativa como se muestra en le siguiente figura 12.

Diseñar la interfaz del usuario.
En este punto se definen las características de la interfaz tales como el color , también se toma en cuenta los botones como: dar altas, registrar venta, generar informe, salir, como lo muestra la figura.
En la figura . se muestra la interfaz principal…. es la forma principal el menú en la cual da la bienvenida al sistema y da un botón de entrada al programa.

PROGRAMACION
se programo el menu principal del sistema cuenta
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

}

private void progressBar1_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
Form2 formularioNuevo = new Form2();
formularioNuevo.Show();

{
if (progressBar1.Value == progressBar1.Maximum)
progressBar1.Value = progressBar1.Minimum;

progressBar1.PerformStep();


}
}
}
}



FORM 2. LOGIN


Esta pantalla es de login en ella se tendrá que registrar el usuario y cuenta con un botón para entrar al sistema.
PROGRAMACION.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Panel_de_Control formularioNuevo = new Panel_de_Control();
formularioNuevo.Show();
}
}
}




FORM 3. PANEL DE CONTROL
En este formulario se encuentran varios botones los cuales nos llevaran al registro de clientes, proveedores, bajas (ventas), facturas, garantías, devolucines e un informe completo del inventario.
PROGRAMACION
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Panel_de_Control : Form
{
public Panel_de_Control()
{
InitializeComponent();
}

private void pictureBox2_Click(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
Registro formularioNuevo = new Registro();
formularioNuevo.Show();
}

private void button2_Click(object sender, EventArgs e)
{
Productos formularioNuevo = new Productos();
formularioNuevo.Show();
}

private void button3_Click(object sender, EventArgs e)
{
Ventas formularioNuevo = new Ventas();
formularioNuevo.Show();
}

private void button4_Click(object sender, EventArgs e)
{
Proveedores formularioNuevo = new Proveedores();
formularioNuevo.Show();
}

private void button5_Click(object sender, EventArgs e)
{
Facturas formularioNuevo = new Facturas();
formularioNuevo.Show();
}

private void button6_Click(object sender, EventArgs e)
{
Garantias formularioNuevo = new Garantias();
formularioNuevo.Show();
}


FORM 4. REGISTRO
En este formulario da de alta un registro del cliente el cual se guarda en la base de datos.
PROGRAMACION
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.SqlTypes;

namespace WindowsFormsApplication1
{
public partial class Registro : Form
{
public Registro()
{
InitializeComponent();
}
public SqlConnection conexion;
public SqlCommand comando;
public SqlDataReader reader;
public string cad_conexion = @"Server = .\SQLEXPRESS;
DataBase = NEGOCIOs;
Integrated Security=True";
public void limpiar()
{
textBox1.Text = null;
textBox3.Text = null;
textBox4.Text = null;
textBox5.Text = null;
textBox2.Text = null;
textBox6.Text = null;
textBox7.Text = null;
textBox8.Text = null;
textBox9.Text = null;
textBox10.Text = null;
textBox11.Text = null;
textBox12.Text = null;
textBox13.Text = null;
textBox14.Text = null;
textBox15.Text = null;
}

private void textBox2_TextChanged(object sender, EventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{

}

private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text.Trim() == "")
{
MessageBox.Show("Ingresa el id_cliente");
textBox1.Focus();
return;

}
if (textBox2.Text.Trim() == "")
{
MessageBox.Show("Debes teclear la colonia");
textBox2.Focus();
return;

}
if (textBox3.Text.Trim() == "")
{
MessageBox.Show(" Debes teclear el n.exterior");
textBox3.Focus();
return;

}
if (textBox4.Text.Trim() == "")
{
MessageBox.Show("Debes teclear la calle");
textBox4.Focus();
return;
}
if (textBox5.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el apellido materno");
textBox5.Focus();
return;

}
if (textBox6.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el apellido paterno");
textBox6.Focus();
return;
}
if (textBox7.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el nombre");
textBox7.Focus();
return;
}
if (textBox8.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el codigo postal");
textBox8.Focus();
return;
}if (textBox9.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el municipio");
textBox9.Focus();
return;
}if (textBox10.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el estado");
textBox10.Focus();
return;
}
if (textBox11.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el tel.casa");
textBox11.Focus();
return;
}if (textBox12.Text.Trim() == "")
{
MessageBox.Show("Debes teclear la poblacion");
textBox12.Focus();
return;
}
if (textBox13.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el tel.movil");
textBox13.Focus();
return;
}if (textBox14.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el correo electronico");
textBox14.Focus();
return;
}if (textBox15.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el rfc");
textBox15.Focus();
return;
}

string id_clientes;
string nombre;
string apellido_paterno;
string apellido_materno;
string calle;
string n_exterior;
string colonia;
string codigo_postal;
string poblacion;
string municipio;
string estado;
string tel_casa;
string tel_movil;
string correo_electronico;
string rfc;
try
{
int criteria = Int32.Parse(textBox2.Text);
id_clientes = textBox1.Text;
nombre = textBox7.Text;
apellido_paterno = textBox6.Text;
apellido_materno = textBox5.Text;
calle = textBox4.Text;
n_exterior= textBox3.Text;
colonia = textBox2.Text;
codigo_postal = textBox8.Text;
poblacion = textBox12.Text;
municipio = textBox9.Text;
estado = textBox10.Text;
tel_casa = textBox11.Text;
tel_movil = textBox13.Text;
correo_electronico = textBox14.Text;
rfc = textBox15.Text;

conexion = new SqlConnection(cad_conexion);
conexion.Open();
string cad_select = "SELECT * from NEGOCIOs where registro=" + criteria;
comando = new SqlCommand(cad_select, conexion);
reader = comando.ExecuteReader();

if (reader.HasRows)
{
MessageBox.Show("Ya existe ese codigo del cliente");
textBox1.Focus();
limpiar();
}

else
{
reader.Close();
string cad_insert = "INSERT into NEGOCIOs (id_clientes,nombre,apellido_paterno,apellido_materno,calle,n_exterior,colonia,codigo_postal,poblacion,municipio,estado,tel_casa,tel_movil,correo_electronico,rfc) ";
cad_insert += "VALUES (" + "'" + id_clientes + "','" + "" + nombre + "','" + "" + apellido_paterno + "','" + "" + apellido_materno + "','" + "" + calle + "','" + "" + n_exterior + "','" + "" + colonia + "','" + ""+ codigo_postal + "','" + "" + poblacion + "','" + "" + municipio + "','" + "" + estado + "','" + "" + tel_casa + "','" + "" + tel_movil + "','" + "" + correo_electronico + "','" + "" + rfc + "')";
comando.CommandText = cad_insert;
comando.ExecuteNonQuery();

MessageBox.Show("Cliente registrado");
textBox2.Focus();
limpiar();
}
conexion.Close();
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
textBox2.Focus();

}


private void Form2_Load(object sender, EventArgs e)
{

}

private void button2_Click(object sender, EventArgs e)
{

Close();
}


}
}


FORM 5 PRODUCTOS.
En este formulario se dan de alta los productos que entran a la empresa y se guardan en la base de datos.
PROGRAMACION
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Productos : Form
{
public Productos()
{
InitializeComponent();
}
}
}

FORM 5 VENTAS
En este formulario se registran las ventas (salidas) de los productos y se dan de baja de la base de datos.
PROGRAMACION
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.SqlTypes;

namespace WindowsFormsApplication1
{
public partial class Ventas : Form
{
public Ventas()
{
InitializeComponent();

}
public SqlConnection conexion;
public SqlCommand comando;
public SqlDataReader reader;
public int cant2;
public string cad_conexion = @"Server = .\SQLEXPRESS;
DataBase = NEGOCIOs;
Integrated Security=True";
public void limpiar()
{

textBox1.Text = null;
textBox2.Text = null;
textBox3.Text = null;
textBox4.Text = null;

}

private void button1_Click(object sender, EventArgs e)
{


if (textBox1.Text.Trim() == "")
{
MessageBox.Show("Ingresa el id_ventas");
textBox1.Focus();
return;

}
if (textBox2.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el art_vendido");
textBox2.Focus();
return;

}
if (textBox3.Text.Trim() == "")
{
MessageBox.Show(" Debes teclear el total");
textBox3.Focus();
return;

}
if (textBox4.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el id_producto");
textBox4.Focus();
return;
}
if (textBox6.Text.Trim() == "")
{
MessageBox.Show("Debes teclear el id_cliente");
textBox6.Focus();
return;


}
string id_ventas;
string art_vendido;
string total;
string id_producto;
string id_cliente;
try
{
int criteria = Int32.Parse(textBox2.Text);
id_ventas = textBox1.Text;
id_cliente = textBox6.Text;
art_vendido = textBox2.Text;
id_producto = textBox4.Text;
total = textBox3.Text;

conexion = new SqlConnection(cad_conexion);
conexion.Open();
string cad_select = "SELECT * from NEGOCIOs where id_ventas=" + criteria;
comando = new SqlCommand(cad_select, conexion);
reader = comando.ExecuteReader();

if (reader.HasRows)
{
MessageBox.Show("Ya existe ese codigo de la venta");
textBox1.Focus();
limpiar();
}

else
{
reader.Close();
string cad_insert = "INSERT into NEGOCIOs (id_ventas,art_vendido,total,id_produto,id_cliente) ";
cad_insert += "VALUES (" + "'" + id_ventas + "','" + "" + art_vendido + "','" + "" + total + "','" + "" + id_producto + "','" + "" + id_cliente + "')";
comando.CommandText = cad_insert;
comando.ExecuteNonQuery();

MessageBox.Show("venta registrada");
textBox2.Focus();
limpiar();
}
conexion.Close();
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
textBox2.Focus();

}


private void Form2_Load(object sender, EventArgs e)
{

}

FORM 6. PROVEEDORES
En este formulario se dan de alta los proveedores de la empresa y se guardan en la base de datos.
PROGRAMACION
sing System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Data.SqlTypes;


namespace WindowsFormsApplication1
{
public partial class Proveedores : Form
{
public Proveedores()
{
InitializeComponent();
}

private void textBox5_TextChanged(object sender, EventArgs e)
{

}
}
}



FORM 7 FACTURAS
En este formulario se guardan las facturas que se realizan al hacer una venta y se guardan en la base de datos.
PROGRAMACION
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Facturas : Form
{
public Facturas()
{
InitializeComponent();

FORM 8 GARANTIAS
En este formulario se dan de alta las garantías que se le proporcioanan al cliente y se guardan en la base de datos.
PROGRAMACION
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Garantias : Form
{
public Garantias()
{
InitializeComponent();
}
}

FORM 9 INFORME
En este formulario se encuentra la base de datos del informe de los clientes registrados en el sistema.

lunes, 24 de mayo de 2010

DERMINACION DEL TIPO DE RESTRICCION QUE SE VA A UTILIZAR

TIPO DE INTEGRIDAD TIPO DE RESTRICCION
dominio Default
Check
referential
Entidad PRIMARY KEY
UNIQUE
Referencial FOREING KEY
CHECK

CARACTERISTICAS GESTOR DE BASE DE DATOS

CARACTERISTICAS GESTOR DE BASE DE DATOS
• MANEJADOR DE BASE DE DATOS
El sistema manejador de base de datos es la porción mas importante del software de un sistema de base de datos. Un DBMS es una colección de numerosas rutinas de software interrelacionadas, cada una de las cuales es responsable de alguna tarea cada una de las cuales es responsable de alguna tarea especifica los principales funciones de un DBMS son:
*crear y organizar la Base de Datos
*establecer y mantener las trayectorias de acceso a la base de datos de tal forma que los datos puedan ser accesados.
*manejar los datos de acuerdo a las peticiones de los usuarios.

• HERRAMIENTAS DE ADMINISTRACION DE BASE DE DATOS.
Rapidamente surgió la necesidad de contar con un sistema de administración para controlar tanto los datos como los usuarios.
La administración de base de datos se realiza con un sistema llamado DBMSC (Database management system). es un conjunto de servicios(aplicaciones de software ) para administrar bases de datos, que permites.
Un fácil acceso a los datos
El acceso a la información por múltiples usuarios .

miércoles, 24 de marzo de 2010

Empresa

Una empresa dedicada ala venta de accesorios para equipos de computo y equipos de computo cuenta con un sistema de trabajo mecanico manual es deseo de esta empresa estar a la vanguardia tecnoligica y ala par con sus competidores regionales nacionales e internacionales, ya que esta empresa también se dedica al rubro regional, nacional e internacional.
Las entidades que maneja esta empresa son:
• Clientes
• Proveedores
• Productos
• Ventas
• Facturas
• Devoluciones
• Garantías
• Entre otros.

miércoles, 10 de febrero de 2010