Информационно поисковая система «Процессоры»

Автор работы: Пользователь скрыл имя, 04 Октября 2009 в 08:57, Не определен

Описание работы

описание применения

Файлы: 4 файла

Описание применения.doc

— 33.00 Кб (Просмотреть файл, Скачать файл)

Пояснялка1.doc

— 592.50 Кб (Просмотреть файл, Скачать файл)

Программа.doc

— 109.00 Кб (Скачать файл)

#include<conio.h>

#include<string.h>

#include<stdio.h> 

int draw_window(int col_bg,int col_end,int row_bg,int row_end,int color);

int draw_table_col(int col,int row_bg,int row_end);

int up_menu(int col_bg,int col_end,int row,int color);

int down_menu(int col_bg,int col_end,int row,int color);

int clean_row(int col_bg,int col_end,int row,int color);

int start_window(void);

int help(void);

int work_window(void); 

int up_menu_new(int col_bg,int col_end,int row,int color);

int up_menu_edit(int col_bg,int col_end,int row,int color1,int color2);

int up_menu_filter(int col_bg,int col_end,int row,int color1,int color2);

int up_menu_sort(int col_bg,int col_end,int row,int color1,int color2,int color3);

int up_menu_find(int col_bg,int col_end,int row,int color1,int color2);

int head_table(void);

int work_table(void);

int button_ok(int col_bg,int row_bg);

int button_cancel(int col_bg,int row_bg);

int button(int col_bg,int row_bg);

int sort_info(int m,int n);

int sort_info_1(void); 

int window_add_new(void);

int window_edit(void);

int window_filter(void); 

int edit(int nscr,int s);

int delete(int nscr,int s);

int set_of(int n,int nscr,int fil,int d);

int add(void);

int copy_add(void);

int print_to_screen(int nscr,int fil,int d,int n);

int search(int m,int n); 

main()

{

int ikey,key,m,n,n1,rikey,b,nscr=0,fil=0,s=0,d=0;

FILE *f_dat,*f_tmp;

struct IG{

            char proizv[20];

            char tip[20];

            char marka[20];

            int hz;

            char socket[10];

            int cena;

        }IG;

clrscr();

start_window();

work_window();

f_dat=fopen("data.dat","rt");

if(f_dat==NULL) {fclose(f_dat);f_dat=fopen("data.dat","wt");}

  A:

fcloseall();

switch(s)

  {

      case 0: sort_info_1(); break;

      case 1: sort_info_1(); break;

      case 2: sort_info(4,2); break;

      case 3: sort_info(4,3); break;

  }

work_table();

nscr=print_to_screen(nscr,fil,d,n);

gotoxy(80,25);

if(fil!=0)

  {

      gotoxy(20,6);

      textbackground(5);

      cprintf("F2-возврат к просмотру.");

      gotoxy(80,25);

  } 

do

{

      rikey=0;

      if((key=getch())==0) key=getch();

      switch(key)

       {

        case 59: help(); getch(); work_window(); goto A;

        case 60: fil=0; nscr=0; goto A;

        case 73: nscr--; if(nscr<0) nscr=0; goto A;

        case 81: nscr++; goto A;

        case 193: key=45; break;

        case 68: up_menu_new(1,80,1,3);

                  m=0;

                  n=0;

                  nscr=0;

                  clean_row(1,80,25,3);

                  gotoxy(10,25); cprintf("Esc-возврат  к просмотру");

                  gotoxy(50,25); cprintf("Enter-Выбор  операции");

                  gotoxy(80,25);

                  do

                  {

                  if((ikey=getch())==0) ikey=getch();

                  switch(ikey)

                   {

                   case 77: m++; n=0; if(m>4) m=0;break;

                   case 75: if(m>0) {m--; n=0;} else m=4;break;

                   case 80: if(m==1||m==2||m==3){n++; if(n>1) n=0;}; if(m==4){n++; if(n>2) n=0;};break;

                   case 72: if(m==1||m==2||m==3){if(n>0) n--; else n=1;};if(m==4){if(n>0) n--; else n=2;};break;

                   case 13: rikey=ikey; ikey=27; break;

                   case 45: key=ikey; break;

                   case 193: key=ikey; break;

                   }

                  if(m==0)

                   {

            head_table(); work_table(); up_menu_new(1,80,1,3);

                               nscr=print_to_screen(nscr,fil,d,n);

            if(rikey==13){

                         window_add_new();

                         add();

                         b=button(25,21);

                         if(b==0) copy_add();

                         work_window();

                         goto A;

                         }

                  }

                  if(m==1&&n==0) {

                          head_table(); work_table();

                          up_menu_edit(1,80,1,4,3);

                          nscr=print_to_screen(nscr,fil,d,n);

                          if(rikey==13)

                              {

                                                             clean_row(1,80,25,3);

                               gotoxy(10,25); cprintf("Esc-возврат  к просмотру");

                               gotoxy(46,25); cprintf("Enter-Выбрать запись для редактирования");

                               up_menu(1,80,1,3);

                               head_table();

                               edit(nscr,s);

                               clean_row(1,80,25,3);

                               work_table();

                                                             nscr=print_to_screen(nscr,fil,d,n);

                              }

                         }

              if(m==1&&n==1) {

                          head_table(); work_table();

                          up_menu_edit(1,80,1,3,4);

                                                        nscr=print_to_screen(nscr,fil,d,n);

                          if(rikey==13)

                              {

                                                             clean_row(1,80,25,3);

                               gotoxy(10,25); cprintf("Esc-Возврат к просмотру");

                               gotoxy(46,25); cprintf("Delete-Удаление записи");

                               up_menu(1,80,1,3);

                               head_table();

                               delete(nscr,s);

                              }

                         }

              if(m==2&&n==0) {head_table();

                          up_menu_filter(1,80,1,4,3);

                                                        nscr=print_to_screen(nscr,fil,d,n);

                          if(rikey==13)

                              {

                               head_table();

                               window_filter();

                               clean_row(1,80,25,3); 

                               gotoxy(20,25);

                               cprintf("Ввод с учетом регистра.");

                               search(m,n);

                               n1=button(28,15);

                               if(n1==0)

                        {

                         fil=1;

                        }

                               work_window();

                               goto A;

                              }

                          }

              if(m==2&&n==1) {head_table();

                          up_menu_filter(1,80,1,3,4);

                                                        nscr=print_to_screen(nscr,fil,d,n);

                          if(rikey==13)

                              {

                               head_table();

                               window_filter();

                                                             textbackground(2);

                               gotoxy(26,12);

                               cprintf("       Введите socket      ");

                               clean_row(1,80,25,3);

                               gotoxy(20,25);

                               cprintf("Ввод с учетом регистра.");

                               search(m,n);

                               n1=button(28,15);

                               if(n1==0)

                        {

                         fil=1;

                        }

                               work_window();

                               goto A;

                              }

                          }

              if(m==3&&n==0) {head_table();

                          work_table();

                          up_menu_find(1,80,1,4,3);

                                                        nscr=print_to_screen(nscr,fil,d,n);

                          if(rikey==13)

                              {

                               head_table();

                               window_filter();

                                                             textbackground(2);

                               gotoxy(36,11);

                               cprintf("  Поиск    ");

                               gotoxy(28,12);

                               cprintf("   Введите производителя   ");

                               gotoxy(47,13);

                               cprintf(" поиск ");

                               clean_row(1,80,25,3);

                               gotoxy(20,25);

                               cprintf("Ввод с учетом регистра.");

                               search(m,n);

                               n1=button(28,15);

                               if(n1==0)

                        {

                         fil=1;

                        }

                               work_window();

                               goto A;

                              }

                         }

              if(m==3&&n==1) {head_table();

                          up_menu_find(1,80,1,3,4);

                                                        nscr=print_to_screen(nscr,fil,d,n);

                          if(rikey==13)

ФИНАЛ.C

— 33.06 Кб (Скачать файл)

Информация о работе Информационно поисковая система «Процессоры»