Está en la página 1de 14

#include <cstdlib> #include <iostream.h> #include <conio.

h>

struct Proveedores { char nombre[40], direccion[30]; int telefono; struct Proveedores *sig; } *inicio=NULL, *c=NULL;

struct inventario { char nombre[40], seccion[30]; int fecha; struct inventario *sig; } *in=NULL, *d=NULL;

struct ventas { char nombre[40], cantidad[30]; int codigo; struct ventas *sig; } *inici=NULL, *e=NULL;

using namespace std;

void bienvenida(); void menu(); void proveedores(); void inventario(); void ventas(); void salir(); void ingresar_proveedores(); void visualizar_proveedores(); void eliminar_proveedores(); void ingresar_inventario(); void visualizar_inventario(); void eliminar_inventario(); void ingresar_ventas(); void visualizar_ventas(); void eliminar_ventas();

int opcion, contra= 123, pass, ope; int total, i;

int main(int argc, char *argv[])

bienvenida(); }

void bienvenida(){ cout << " cout << " cout << " cout << " cout << " cout << " cout << " cout << " cout << " cout << " cout << " cout << " cin >> pass; UNIVERSIDAD NACIONAL ABIERTA Y A DISTANCIA" << endl << endl; " << endl << endl; Cead-FLORENCIA " << endl << endl; SISTEMA DE INFORMACION, PARA EL" << endl; REGISTRO DE INVENTARIOS DE LA" << endl; DISTRIBUIDORA " << endl << endl; DISTRIMAXI" << endl << endl; " << endl << endl; DESARROLLADO POR:" << endl; Didimo Cala Mejia - Grupo 22" <<endl << endl; Codigo: 1117496522" <<endl << endl; INGRESAR CONTRASENA" <<endl;

if (pass == contra){ menu(); } else{ cout << "Contrasena incorrecta" <<endl; system("PAUSE"); bienvenida(); }

} void menu(){ system("cls"); cout << " cout << " cout << " cout << " cout << " cout << " cout << " cout << " MENU PRINCIPAL" << endl; Opciones:" << endl; " << endl; 1.Proveedores" << endl; 2.Inventario" << endl; 3.Ventas" << endl; 4.Salir" << endl; " << endl;

cout << "Ingresar la opcion que desea ver: "; cin >> opcion;

if( opcion == 1 ){ proveedores(); system("PAUSE"); proveedores(); } else if( opcion == 2 ) { inventario(); system("PAUSE"); inventario(); } else if( opcion == 3 ) { ventas();

system("PAUSE"); ventas(); } else if( opcion == 4 ) { salir(); } else{ cout << "Elija una Opcion Valida" << endl; system("PAUSE"); menu(); } } void proveedores(){ system("cls"); cout << " ADMINISTRAR PROVEEDORES" << endl;

cout << "Opciones:" << endl; cout << "1. Ingresar proveedores" << endl; cout << "2. Visualizar proveedores" << endl; cout << "3. Eliminar proveedores" << endl; cout << "4. Retornar al menu principal" << endl; cout << " " << endl;

cout << "Escriba la opcion que desea realizar: "; cin >> ope;

if (ope == 1){ ingresar_proveedores();

} else if (ope == 2){ visualizar_proveedores(); } else if (ope == 3){ eliminar_proveedores(); } else if (ope== 4){ menu(); } else{ cout << "Elija una opcion valida"; system("PAUSE"); proveedores(); }

} void inventario(){ system("cls"); cout << " ADMINISTRAR INVENTARIO" << endl;

cout << "Opciones:" << endl; cout << "1. Ingresar inventario" << endl; cout << "2. Visualizar inventario" << endl; cout << "3. Eliminar inventario" << endl; cout << "4. Retornar al menu principal" << endl; cout << " " << endl;

cout << "Escriba la opcion que desea realizar: "; cin >> ope;

if (ope == 1){ ingresar_inventario(); } else if (ope == 2){ visualizar_inventario(); } else if (ope == 3){ eliminar_inventario(); } else if (ope== 4){ menu(); } else{ cout << "Elija una opcion valida"; system("PAUSE"); inventario(); } }

void ventas(){ system("cls"); cout << " cout << "Opciones:" << endl; ADMINISTRAR VENTAS" << endl;

cout << "1. Ingresar ventas" << endl; cout << "2. Visualizar ventas" << endl; cout << "3. Eliminar ventas" << endl; cout << "4. Total ventas" << endl; cout << "5. Retornar al menu principal" << endl; cout << " " << endl;

cout << "Ingresar la opcion que desea realizar: "; cin >> ope;

if (ope == 1){ ingresar_ventas(); } else if (ope == 2){ visualizar_ventas(); } else if (ope == 3){ eliminar_ventas(); } else if (ope == 4){ ventas(); } else if (ope== 5){ menu(); } else{ cout << "Elija una opcion correcta";

system("PAUSE"); ventas(); } } void salir(){ system("cls"); bienvenida(); }

void ingresar_proveedores(){ system("cls"); inicio=(struct Proveedores *)malloc(sizeof(struct Proveedores)); cout<<"Nombre: "; cin>>inicio->nombre; cout<<"Direccion: "; cin>>inicio->direccion; cout<<"Telefono: "; cin>>inicio->telefono; if (c==NULL){ c=inicio; inicio->sig=NULL; } else{ inicio->sig=c; c=inicio; }

system("PAUSE"); proveedores(); } void visualizar_proveedores(){ system("cls"); if (c==NULL){ cout<<"NO HAY ELEMENTOS A LISTAR"; } else{ inicio=c; while (inicio!=NULL){ cout<<"Nombre: "<<inicio->nombre<<endl; cout<<"Posicion: "<<inicio->direccion<<endl; cout<<"Telefono: "<<inicio->telefono<<endl; inicio=inicio->sig; } }

system("PAUSE"); proveedores(); } void eliminar_proveedores() { system("cls"); cout << "ELIMINAR PROVEEDOR" << endl;

system("PAUSE"); proveedores(); }

void ingresar_inventario(){ system("cls"); in=(struct inventario *)malloc(sizeof(struct inventario)); cout<<"Nombre: "; cin>>in->nombre; cout<<"seccion: "; cin>>in->seccion; cout<<"fecha: "; cin>>in->fecha; if (d==NULL){ d=in; in->sig=NULL; } else{ in->sig=d; d=in; }

system("PAUSE"); inventario();

} void visualizar_inventario(){ system("cls"); if (d==NULL){ cout<<"NO HAY ELEMENTOS A LISTAR"; } else{ in=d; while (in!=NULL){ cout<<"Nombre: "<<in->nombre<<endl; cout<<"Posicion: "<<in->seccion<<endl; cout<<"fecha: "<<in->fecha<<endl; in=in->sig; } }

system("PAUSE"); inventario(); } void eliminar_inventario() { system("cls"); cout << "ELIMINAR INVENTARIO" << endl; system("PAUSE"); inventario(); }

void ingresar_ventas(){ system("cls"); inici=(struct ventas *)malloc(sizeof(struct ventas)); cout<<"Nombre: "; cin>>inici->nombre; cout<<"codigo: "; cin>>inici->codigo; cout<<"cantidad: "; cin>>inici->cantidad; if (e==NULL){ e=inici; inici->sig=NULL; } else{ inici->sig=e; e=inici; }

system("PAUSE"); ventas(); } void visualizar_ventas(){ system("cls");

if (e==NULL){ cout<<"NO HAY ELEMENTOS A LISTAR"; } else{ inici=e; while (inici!=NULL){ cout<<"Nombre: "<<inici->nombre<<endl; cout<<"codigo: "<<inici->codigo<<endl; cout<<"cantidad: "<<inici->cantidad<<endl; inici=inici->sig; } }

system("PAUSE"); ventas(); } void eliminar_ventas() { system("cls"); cout << "ELIMINAR VENTAS" << endl; system("PAUSE"); ventas(); }

También podría gustarte