Файл: Разработка информационной системы учёта товаров магазина мелисса.docx
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 06.11.2023
Просмотров: 603
Скачиваний: 1
СОДЕРЖАНИЕ
Анализ существующих разработок и обоснование выбора технологии проектирования
2 ОБОСНОВАНИЕ ПРОЕКТНЫХ РЕШЕНИЙ
Обоснование проектных решений по информационному
Обоснование проектных решений по программному
Обоснование проектных решений по технологическому
Обоснование выбора программных средств
Используемые классификаторы и системы кодирования
Характеристика первичных документов с нормативно- справочной и входной оперативной информацией
Характеристика даталогической модели БД
Характеристика результатной информации
Характеристика результатных документов
Структурная схема пакета (дерево вызова процедур и
Технологическое обеспечение задачи (комплекса задач, АРМ)
Схема технологического процесса сбора, передачи, обработки и выдачи информации
Целесообразность разработки с экономической точки зрения
Проведем оценку инвестиционного проекта информационной системы по формуле (3.2):
DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=1;
DataModule2->goods_select->Open(); Form3->ShowModal();
}//
//СПИСАНИЕ ТОВАРА
voidfastcall TForm1::Button3Click(TObject *Sender)
{Application->CreateForm(classid(TForm3), &Form3);
Form3->type_doc->Caption="Списание товара (Расходная накладная)"; Form3->type->Caption="3";
Form3->state_doc->Caption="Сохранён, не проведён";DataModule2->new_doc-
>ParamByName("VIN_TYPE")->AsInteger=3;
DataModule2->new_doc->ParamByName("VIN_USER")->AsInteger=1; DataModule2->new_doc->Prepare();
DataModule2->new_doc->ExecProc();
Form3->number_doc->Caption=DataModule2->new_doc-
>ParamByName("VNEWID")->AsString; DataModule2->IBTransaction1->Commit(); DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=3; DataModule2->person_select->Open();
DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=1;
DataModule2->goods_select->Open(); Form3->ShowModal();
}//
//ВОЗВРАТ ТОВАРА
voidfastcall TForm1::Button4Click(TObject *Sender)
{Application->CreateForm(classid(TForm3), &Form3);
Form3->type_doc->Caption="Возврат товара (Приходная накладная)"; Form3->type->Caption="4";
Form3->state_doc->Caption="Сохранён, не проведён";
DataModule2->new_doc->ParamByName("VIN_TYPE")->AsInteger=4; DataModule2->new_doc->ParamByName("VIN_USER")->AsInteger=1; DataModule2->new_doc->Prepare();
DataModule2->new_doc->ExecProc();
Form3->number_doc->Caption=DataModule2->new_doc-
>ParamByName("VNEWID")->AsString; DataModule2->IBTransaction1->Commit(); DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=2; DataModule2->person_select->Open();
DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=0;
DataModule2->goods_select->Open(); Form3->ShowModal();
}
voidfastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{DataModule2->IBTransaction1->Commit();}
voidfastcall TForm1::Button5Click(TObject *Sender)
{Application->CreateForm(classid(TForm4), &Form4); Form4->PageControl1->ActivePage=0;
Form4->ShowModal();
}
voidfastcall TForm1::Button9Click(TObject *Sender)
{Application->CreateForm(classid(TForm8), &Form8); DataModule2->title_select->Close();
DataModule2->title_select->ParamByName("VIN_SHOWDEL")->AsInteger=0; DataModule2->title_select->ParamByName("VIN_STARTDATE")-
>AsDate=Form8->DateTimePicker1->Date;
DataModule2->title_select->ParamByName("VIN_ENDDATE")-
>AsDate=Form8->DateTimePicker2->Date;
DataModule2->title_select->ParamByName("VIN_METHOD")->AsInteger=0; DataModule2->title_select->ParamByName("VIN_VALUE")->AsInteger=1; DataModule2->title_select->ParamByName("VIN_USERID")->AsInteger=1; DataModule2->title_select->Open();
Form8->ShowModal();}
voidfastcall TForm1::Button6Click(TObject *Sender)
{Application->CreateForm(classid(TForm10), &Form10); Form10->ShowModal();}
voidfastcall TForm1::Button7Click(TObject *Sender)
{ Application->CreateForm(classid(TForm11), &Form11); Form11->ShowModal();}
voidfastcall TForm1::Button8Click(TObject *Sender)
{Application->CreateForm(classid(TForm12), &Form12); Form12->ShowModal();}
Unit3.cpp#include
#pragma package(smart_init) #pragma resource "*.dfm" TForm3 *Form3;
fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
voidfastcall TForm3::DBGrid1DblClick(TObject *Sender)
{
DataModule2->edit_title->ParamByName("VIN_ACTION")->AsInteger=0; DataModule2->edit_title->ParamByName("VIN_ID")-
>AsInteger=StrToInt(number_doc->Caption);
DataModule2->edit_title->ParamByName("VIN_PERSON")-
>AsInteger=DataModule2->person_select->FieldByName("VID")->AsInteger; DataModule2->edit_title->ParamByName("VIN_STATE")->AsInteger=1; DataModule2->edit_title->ParamByName("VIN_SUMM")-
>AsFloat=DataModule2->get_content->FieldByName("summ")->AsFloat; DataModule2->edit_title->Prepare();
DataModule2->edit_title->ExecProc(); ShowMessage("Контрагент успешно изменён!"); Button1->Enabled=True;
}
voidfastcall TForm3::Button1Click(TObject *Sender)
{
DataModule2->doc_ex->ParamByName("VIN_DOCID")-
>AsInteger=StrToInt(Form3->number_doc->Caption); DataModule2->doc_ex->ParamByName("VIN_PERSON")-
>AsInteger=DataModule2->person_select->FieldByName("VID")->AsInteger; DataModule2->doc_ex->ParamByName("VIN_USER")->AsInteger=1; DataModule2->doc_ex->Prepare();
DataModule2->doc_ex->ExecProc();
DataModule2->edit_title->ParamByName("VIN_ACTION")->AsInteger=1; DataModule2->edit_title->ParamByName("VIN_ID")-
>AsInteger=StrToInt(number_doc->Caption);
DataModule2->edit_title->ParamByName("VIN_PERSON")-
>AsInteger=DataModule2->person_select->FieldByName("VID")->AsInteger; DataModule2->edit_title->ParamByName("VIN_STATE")->AsInteger=2; DataModule2->edit_title->ParamByName("VIN_SUMM")-
>AsFloat=StrToFloat(Form3->itog->Caption); DataModule2->edit_title->Prepare(); DataModule2->edit_title->ExecProc(); DataModule2->IBTransaction1->Commit(); Form3->Close();
}
voidfastcall TForm3::DBGrid2CellClick(TColumn *Column)
{
DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
}
// voidfastcall TForm3::GRID_GOODSDblClick(TObject *Sender)
{
int doctype;
doctype=StrToInt(Form3->type->Caption);
DataModule2->edit_content->ParamByName("VIN_ID")->AsInteger=-1; DataModule2->edit_content->ParamByName("VIN_DOCID")-
>AsInteger=StrToInt(Form3->number_doc->Caption); DataModule2->edit_content->ParamByName("VIN_DOCTYPE")-
>AsInteger=doctype;
DataModule2->edit_content->ParamByName("VIN_GOODSID")-
>AsInteger=DataModule2->goods_select->FieldByName("VID")->AsInteger; switch(doctype)
{
case 1: Application->CreateForm(classid(TForm5), &Form5); Form5->name_goods->Caption=DataModule2->goods_select-
>FieldByName("VGOODSNAME")->AsString; Form5->ShowModal();break;
case 2: Application->CreateForm(classid(TForm9), &Form9); Form9->name_goods->Caption=DataModule2->goods_select-
>FieldByName("VGOODSNAME")->AsString; DataModule2->price_select->Close();
DataModule2->price_select->ParamByName("VIN_GOODSID")-
>AsInteger=DataModule2->goods_select->FieldByName("VID")->AsInteger; DataModule2->price_select->ParamByName("VIN_ACT")->AsInteger=1; DataModule2->price_select->Open();
Form9->ShowModal();break;
case 3: Application->CreateForm(classid(TForm9), &Form9); Form9->name_goods->Caption=DataModule2->goods_select-
>FieldByName("VGOODSNAME")->AsString; DataModule2->price_select->Close();
DataModule2->price_select->ParamByName("VIN_GOODSID")-
>AsInteger=DataModule2->goods_select->FieldByName("VID")->AsInteger; DataModule2->price_select->ParamByName("VIN_ACT")->AsInteger=1; DataModule2->price_select->Open();
Form9->ShowModal();break;
case 4: Application->CreateForm(classid(TForm5), &Form5);
Form5->name_goods->Caption=DataModule2->goods_select-
>FieldByName("VGOODSNAME")->AsString; Form5->ShowModal();break;
}}
Unit4.cpp#include
#pragma package(smart_init) #pragma resource "*.dfm" TForm4 *Form4;
fastcall TForm4::TForm4(TComponent* Owner)
: TForm(Owner)
{
}
voidfastcall TForm4::DBGrid5CellClick(TColumn *Column)
{DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();}
// voidfastcall TForm4::TabSheet1Show(TObject *Sender)
{DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();}
voidfastcall TForm4::TabSheet2Show(TObject *Sender)
{DataModule2->groop_select->Open();}
voidfastcall TForm4::TabSheet3Show(TObject *Sender)
{DataModule2->units_select->Open();}
//
//КАТЕГОРИИ НОМЕНКЛАТУРЫ
voidfastcall TForm4::Button1Click(TObject *Sender)
{String name;
name=InputBox("Создать новый элемент", "Наименование", ""); DataModule2->edit_groop->ParamByName("VIN_ACTION")->AsInteger=1;
DataModule2->edit_groop->ParamByName("VIN_ID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->edit_groop->ParamByName("VIN_NAME")->AsString=name; DataModule2->edit_groop->Prepare();
DataModule2->edit_groop->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
// voidfastcall TForm4::Button2Click(TObject *Sender)
{String name;
name=InputBox("Изменить текущий элемент", "Наименование", DataModule2-
>groop_select->FieldByName("VNAME")->AsString);
DataModule2->edit_groop->ParamByName("VIN_ACTION")->AsInteger=2; DataModule2->edit_groop->ParamByName("VIN_ID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->edit_groop->ParamByName("VIN_NAME")->AsString=name; DataModule2->edit_groop->Prepare();
DataModule2->edit_groop->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
// voidfastcall TForm4::Button3Click(TObject *Sender)
{DataModule2->edit_groop->ParamByName("VIN_ACTION")->AsInteger=3; DataModule2->edit_groop->ParamByName("VIN_ID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->edit_groop->ParamByName("VIN_NAME")->AsString=""; DataModule2->edit_groop->Prepare();
DataModule2->edit_groop->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
//
//ЕДИНИЦЫ ИЗМЕРЕНИЯ
voidfastcall TForm4::Button4Click(TObject *Sender)
{String name;
name=InputBox("Создать новый элемент", "Наименование", ""); DataModule2->edit_units->ParamByName("VIN_ACTION")->AsInteger=1;
DataModule2->edit_units->ParamByName("VIN_ID")->AsInteger=DataModule2-
>units_select->FieldByName("FID")->AsInteger;
DataModule2->edit_units->ParamByName("VIN_NAME")->AsString=name; DataModule2->edit_units->Prepare();
DataModule2->edit_units->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
// voidfastcall TForm4::Button5Click(TObject *Sender)
{String name;
name=InputBox("Изменить текущий элемент", "Наименование", DataModule2-
>units_select->FieldByName("FUNITNAME")->AsString);
DataModule2->edit_units->ParamByName("VIN_ACTION")->AsInteger=2; DataModule2->edit_units->ParamByName("VIN_ID")->AsInteger=DataModule2-
>units_select->FieldByName("FID")->AsInteger;
DataModule2->edit_units->ParamByName("VIN_NAME")->AsString=name; DataModule2->edit_units->Prepare();
DataModule2->edit_units->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
// voidfastcall TForm4::Button6Click(TObject *Sender)
{DataModule2->edit_units->ParamByName("VIN_ACTION")->AsInteger=3; DataModule2->edit_units->ParamByName("VIN_ID")->AsInteger=DataModule2-
>units_select->FieldByName("FID")->AsInteger;
DataModule2->edit_units->ParamByName("VIN_NAME")->AsString=""; DataModule2->edit_units->Prepare();
DataModule2->edit_units->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
//НОМЕНКЛАТУРА
voidfastcall TForm4::Button7Click(TObject *Sender)
{Application->CreateForm(classid(TForm6), &Form6); Form6->Caption="Создать новую позицию";
DataModule2->edit_goods->ParamByName("VIN_ACTION")->AsInteger=1; Form6->ShowModal();}
voidfastcall TForm4::Button8Click(TObject *Sender)
{Application->CreateForm(classid(TForm6), &Form6); Form6->Caption="Редактировать текущую позицию"; Form6->Edit1->Text=DataModule2->goods_select-
>FieldByName("VGOODSNAME")->AsString; Form6->Edit2->Text=DataModule2->goods_select-
>FieldByName("VARTICLE")->AsString;
Form6->Edit3->Text=DataModule2->goods_select-
>FieldByName("VCOMMENT")->AsString;
DataModule2->edit_goods->ParamByName("VIN_ACTION")->AsInteger=2; Form6->ShowModal();}
// voidfastcall TForm4::Button9Click(TObject *Sender)
{DataModule2->edit_goods->ParamByName("VIN_ACTION")->AsInteger=3; DataModule2->edit_goods->ParamByName("VIN_ID")-
>AsInteger=DataModule2->goods_select->FieldByName("VID")->AsInteger; DataModule2->edit_goods->ParamByName("VIN_GOODSNAME")-
>AsString="";
DataModule2->edit_goods->ParamByName("VIN_ARTICLE")->AsString=""; DataModule2->edit_goods->ParamByName("VIN_GROOP")->AsString=""; DataModule2->edit_goods->ParamByName("VIN_UNIT")->AsString=""; DataModule2->edit_goods->ParamByName("VIN_COMMENT")->AsString=""; DataModule2->edit_goods->Prepare();
DataModule2->edit_goods->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->groop_select->Open(); DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->Open();
DataModule2->units_select->Open();}
//КОНТРАГЕНТЫ
voidfastcall TForm4::Button10Click(TObject *Sender)
{Application->CreateForm(classid(TForm7), &Form7); Form7->Caption="Создать новую позицию";
DataModule2->edit_person->ParamByName("VIN_ID")->AsInteger=-1; DataModule2->edit_person->ParamByName("VIN_NEWTYPE")->AsInteger=1; Form7->ShowModal();}
// voidfastcall TForm4::Button11Click(TObject *Sender)
{Application->CreateForm(classid(TForm7), &Form7); Form7->Caption="Редактировать текущую позицию"; DataModule2->edit_person->ParamByName("VIN_ID")-
>AsInteger=DataModule2->person_select->FieldByName("VID")->AsInteger; DataModule2->edit_person->ParamByName("VIN_NEWTYPE")->AsInteger=-1; Form7->Edit1->Text=DataModule2->person_select-
>FieldByName("vshortname")->AsString;
Form7->Edit2->Text=DataModule2->person_select->FieldByName("vfullname")-
>AsString;
Form7->Edit3->Text=DataModule2->person_select->FieldByName("vaddr")-
>AsString;
Form7->Edit4->Text=DataModule2->person_select->FieldByName("vaddr2")-
>AsString;
Form7->Edit5->Text=DataModule2->person_select->FieldByName("vphone")-
>AsString;
Form7->Edit6->Text=DataModule2->person_select->FieldByName("vemail")-
>AsString;
Form7->Edit7->Text=DataModule2->person_select->FieldByName("vschet")-
>AsString;
Form7->Edit8->Text=DataModule2->person_select->FieldByName("vbik")-
>AsString;
Form7->Edit9->Text=DataModule2->person_select->FieldByName("vkpp")-
>AsString;
Form7->Edit10->Text=DataModule2->person_select->FieldByName("vinn")-
>AsString;
Form7->Edit11->Text=DataModule2->person_select->FieldByName("vokpo")-
>AsString;
Form7->Edit12->Text=DataModule2->person_select->FieldByName("vogrn")-
>AsString;
Form7->ShowModal();}
// voidfastcall TForm4::Button12Click(TObject *Sender)
{DataModule2->edit_person->ParamByName("VIN_ID")-
>AsInteger=DataModule2->person_select->FieldByName("VID")->AsInteger;
DataModule2->edit_person->ParamByName("VIN_NEWTYPE")->AsInteger=0; DataModule2->edit_person->ParamByName("VIN_SHORTNAME")-
>AsString="";
DataModule2->edit_person->ParamByName("VIN_FULLNAME")->AsString=""; DataModule2->edit_person->ParamByName("VIN_ADDR")->AsString=""; DataModule2->edit_person->ParamByName("VIN_ADDR2")->AsString=""; DataModule2->edit_person->ParamByName("VIN_PHONE")->AsString=""; DataModule2->edit_person->ParamByName("VIN_EMAIL")->AsString=""; DataModule2->edit_person->ParamByName("VIN_SCHET")->AsString=""; DataModule2->edit_person->ParamByName("VIN_BIK")->AsString=""; DataModule2->edit_person->ParamByName("VIN_KPP")->AsString=""; DataModule2->edit_person->ParamByName("VIN_INN")->AsString=""; DataModule2->edit_person->ParamByName("VIN_OKPO")->AsString=""; DataModule2->edit_person->ParamByName("VIN_OGRN")->AsString=""; DataModule2->edit_person->Prepare();
DataModule2->edit_person->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->person_select->Open();}
// voidfastcall TForm4::RadioButton1Click(TObject *Sender)
{DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=1; DataModule2->person_select->Open();
DataModule2->edit_person->ParamByName("VIN_GROUP")->AsInteger=1;} voidfastcall TForm4::RadioButton2Click(TObject *Sender)
{DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=2; DataModule2->person_select->Open();
DataModule2->edit_person->ParamByName("VIN_GROUP")->AsInteger=2;} voidfastcall TForm4::RadioButton3Click(TObject *Sender)
{DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=3; DataModule2->person_select->Open();
DataModule2->edit_person->ParamByName("VIN_GROUP")->AsInteger=3;}
//
Unit8.cpp#include
#include "Unit5.h" #include "Unit6.h" #include "Unit7.h" #include "Unit9.h"
#pragma package(smart_init) #pragma resource "*.dfm" TForm8 *Form8;
fastcall TForm8::TForm8(TComponent* Owner)
: TForm(Owner)
{
}
voidfastcall TForm8::Button1Click(TObject *Sender)
{DataModule2->title_select->Close();
DataModule2->title_select->ParamByName("VIN_SHOWDEL")->AsInteger=0; DataModule2->title_select->ParamByName("VIN_STARTDATE")-
>AsDate=Form8->DateTimePicker1->Date;
DataModule2->title_select->ParamByName("VIN_ENDDATE")-
>AsDate=Form8->DateTimePicker2->Date;
DataModule2->title_select->ParamByName("VIN_METHOD")->AsInteger=5; DataModule2->title_select->ParamByName("VIN_VALUE")->AsInteger=0; DataModule2->title_select->ParamByName("VIN_USERID")->AsInteger=1; DataModule2->title_select->Open();}
// voidfastcall TForm8::DBGrid1DblClick(TObject *Sender)
{Application->CreateForm(classid(TForm3), &Form3); DataModule2->person->Close();
DataModule2->person->ParamByName("VID")->AsInteger=DataModule2-
>title_select->FieldByName("VPERSONID")->AsInteger; DataModule2->person->Open();
Form3->number_doc->Caption=DataModule2->title_select-
>FieldByName("VID")->AsString; int typedoc;
int statedoc;
typedoc=DataModule2->title_select->FieldByName("VTYPEID")->AsInteger; statedoc=DataModule2->title_select->FieldByName("VSTATEID")->AsInteger; switch(typedoc)
{
case 1: Form3->type_doc->Caption="Приход товара (Приходная накладная)"; Form3->type->Caption="1";
DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=1; DataModule2->person_select->Open();
DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=0;
DataModule2->goods_select->Open(); break;
case 2: Form3->type_doc->Caption="Продажа товара (Расходная накладная)"; Form3->type->Caption="2";
DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=2; DataModule2->person_select->Open();
DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=1;
DataModule2->goods_select->Open(); break;
case 3: Form3->type_doc->Caption="Списание товара (Расходная накладная)"; Form3->type->Caption="3";
DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=3; DataModule2->person_select->Open();
DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=1;
DataModule2->goods_select->Open(); break;
case 4: Form3->type_doc->Caption="Возврат товара (Приходная накладная)"; Form3->type->Caption="4";
DataModule2->person_select->Close();
DataModule2->person_select->ParamByName("VIN_GROUP")->AsInteger=2; DataModule2->person_select->Open();
DataModule2->goods_select->Close();
DataModule2->goods_select->ParamByName("VIN_CURRID")-
>AsInteger=DataModule2->groop_select->FieldByName("VID")->AsInteger; DataModule2->goods_select->ParamByName("VIN_AVAILABLE")-
>AsInteger=0;
DataModule2->goods_select->Open(); break;
}
switch(statedoc)
{case 1: Form3->state_doc->Caption="Сохранён, не проведён";break; case 2: Form3->state_doc->Caption="Проведён";break;} if(statedoc==2)
{Form3->DBEdit1->Visible=True; Form3->Button1->Visible=False; Form3->DBGrid1->Visible=False; Form3->DBGrid4->Enabled=False; Form3->GroupBox2->Visible=False;} DataModule2->get_content->Close();
DataModule2->get_content->ParamByName("VIN_DOCID")-
>AsInteger=DataModule2->title_select->FieldByName("VID")->AsInteger; DataModule2->get_content->Open();
float s; s=0;
DataModule2->get_content->First(); while(!DataModule2->get_content->Eof)
{s=s+DataModule2->get_content->FieldByName("summ")->AsFloat; DataModule2->get_content->Next();}
Form3->itog->Caption=FloatToStr(s); Form3->ShowModal();
}
// voidfastcall TForm8::N1Click(TObject *Sender)
{
int state;
state=DataModule2->title_select->FieldByName("VSTATEID")->AsInteger; switch(state){
case 1:
DataModule2->edit_title->ParamByName("VIN_ACTION")->AsInteger=1; DataModule2->edit_title->ParamByName("VIN_ID")->AsInteger=DataModule2-
>title_select->FieldByName("VID")->AsInteger;
DataModule2->edit_title->ParamByName("VIN_PERSON")->AsInteger=0; DataModule2->edit_title->ParamByName("VIN_STATE")->AsInteger=3; DataModule2->edit_title->ParamByName("VIN_SUMM")->AsFloat=0; DataModule2->edit_title->Prepare();
DataModule2->edit_title->ExecProc(); DataModule2->IBTransaction1->Commit(); DataModule2->title_select->Open(); break;
case 2: ShowMessage("Нельзя удалять документ, который ПРОВЕДЁН"); break;
case 3: ShowMessage("Документ уже удалён"); break;
}
}