= :VMY_GOODSID)
INTO VMY_AMOUNT_DISPLAY, :VMY_PRICE_DISPLAY;
/* РАСЧИТАТЬ НОВОЕ КОЛИЧЕСТВО */
IF (:VMY_AMOUNT_DISPLAY IS NULL) THEN VMY_AMOUNT_DISPLAY = 0;
VMY_AMOUNT = (:VMY_AMOUNT_DISPLAY + :VMY_AMOUNT);
/* РАСЧИТАТЬ НОВУЮ ЦЕНУ */
IF (:VMY_PRICE_DISPLAY IS NOT NULL) THEN
IF ((:VMY_PRICE_DISPLAY = 0) OR ((:VMY_PRICE_DISPLAY <>
:VMY_PRICE))) THEN
VMY_PRICE = 0;
/* ОБНОВИТЬ ТАБЛИЦУ */ UPDATE TGOODS
SET FAMOUNT = :VMY_AMOUNT,
FPRICE = :VMY_PRICE WHERE FID = :VMY_GOODSID;
END /* FOR */ End
create or alter procedure PDOCUMTITLES_GETTITLE ( VIN_SHOWDEL smallint,
VIN_STARTDATE date,
VIN_ENDDATE date, VIN_METHOD smallint, VIN_VALUE integer, VIN_USERID integer)
returns (
VID bigint,
VTYPENAME varchar(20), VTYPEID smallint, VSTATEID smallint, VSTATENAME varchar(15), VDATE date,
VTIME time, VPERSONID bigint, VPERSON varchar(30), VUSER varchar(20), VSUMM decimal(15,2))
as BEGIN
FOR SELECT D.FID, D.FTYPE,b.ftype, D.FSTATE,a.FSTATE, D.FDATE, D.FTIME, D.FPERSON, P.FSHORTNAME, U.FLOGIN, D.FSUMM
FROM ((((TDOCUMTITLES D
LEFT JOIN TPERSON P ON D.FPERSON = P.FID) LEFT JOIN TUSERS U ON D.FUSER = U.FID)
LEFT JOIN tdocumstate a ON D.fstate = a.fid) LEFT JOIN tdocumtype b ON D.ftype = b.fid) WHERE ((:VIN_SHOWDEL = 0 AND
D.FSTATE IN (1, 2) /*ОТОБРАЖАТЬ ТОЛЬКО НЕ УДАЛЕННЫЕ*/ OR (:VIN_SHOWDEL = 1)) /*ОТОБРАЖАТЬ ВСЕ*/
AND
((:VIN_METHOD = 0 AND D.FUSER = :VIN_USERID)
OR (:VIN_METHOD IN (1, 2) AND D.FPERSON = :VIN_VALUE AND D.FUSER =
:VIN_USERID)
OR (:VIN_METHOD = 3 AND D.FTYPE = :VIN_VALUE AND D.FUSER =
:VIN_USERID)
OR (:VIN_METHOD = 5 AND (:VIN_VALUE = 0 OR (:VIN_VALUE > 0 AND D.FUSER = :VIN_VALUE))))
AND (D.FDATE BETWEEN :VIN_STARTDATE AND :VIN_ENDDATE)
OR (:VIN_METHOD = 0 AND D.FSTATE = 0 AND D.FUSER = :VIN_USERID)) INTO :VID, :VTYPEid, :VTYPEname, :VSTATEID, :VSTATENAME, :VDATE, :VTIME,
:VPERSONID, :VPERSON, :VUSER, :VSUMM DO
BEGIN SUSPEND; END
create or alter procedure PGOODS_GETGOODS ( VIN_CURRID integer not null, VIN_AVAILABLE smallint,
VIN_FINDTEXT varchar(40), VIN_SHOWDEL integer)
returns (
VID integer,
VGOODSNAME varchar(150), VARTICLE varchar(30), VUNIT varchar(10), VCOMMENT varchar(30), VPRICE varchar(15),
VAMOUNT varchar(10),VSTATEsmallint)asBEGIN/*VIN_CURRID=>=0Returncategorycontent-1FindAUTO-2Find byBARCODE-3FindbyID-4Find byName:-5Find byArticle*/FOR SELECT G.FID, G.FSTATE, G.FGOODSNAME,G.FARTICLE, G.FCOMMENT,U.FUNITNAME,G.FAMOUNT, G.FPRICEFROM(TGOODSGLEFT JOIN TUNITS U ON G.FUNIT = U.FID)WHERE((:VIN_CURRID >0ANDG.fgroop=:VIN_CURRID)OR(:VIN_CURRID =-1AND(G.FGOODSNAME CONTAINING (:VIN_FINDTEXT) ORG.FARTICLE LIKE :VIN_FINDTEXT ||'%'))OR(:VIN_CURRID=-3ANDG.FID=:VIN_FINDTEXT)OR (:VIN_CURRID = -4 AND G.FGOODSNAME CONTAINING(:VIN_FINDTEXT))OR (:VIN_CURRID = -5 AND G.FARTICLE LIKE :VIN_FINDTEXT || '%'))AND((:VIN_SHOWDEL=0AND(G.FSTATE = 1)) /*ОТОБРАЖАТЬ ТОЛЬКО НЕ УДАЛЕННЫЕ*/OR(:VIN_SHOWDEL=1))/*ОТОБРАЖАТЬВСЕ*/AND((:VIN_AVAILABLE = 0) /*ОТОБРАЖАТЬ БЕЗ УЧЕТА НАЛИЧИЯ*/OR(:VIN_AVAILABLE=1 ANDG.FAMOUNT IS NOT NULL)) /*ОТОБРАЖАТЬ ТОЛЬКО ТОВАРЫ ВНАЛИЧИИ*/INTO:VID,:VSTATE,:VGOODSNAME,:VARTICLE,:VCOMMENT,:VUNIT,:VAMOUNT, :VPRICEDOBEGINIF(:VPRICE=0)THENVPRICE='<несколько>';SUSPEND;END
CREATE OR ALTER TRIGGER TSTORE_BI FOR TSTOREACTIVEBEFOREINSERTPOSITION0ASBEGINIF(NEW.FIDISNULL)THENNEW.FID = GEN_ID(GEN_TSTORE_ID,1);ENDCREATE SEQUENCE GEN_TDOCUMCONTENT_ID;CREATE SEQUENCE GEN_TDOCUMTITLES_ID;CREATESEQUENCE GEN_TGOODS_ID;CREATE SEQUENCE GEN_TGROOP_ID;CREATE SEQUENCE GEN_TPERSON_ID;CREATE SEQUENCE GEN_TSTORE_ID;CREATE SEQUENCE GEN_TUNITS_ID;CREATESEQUENCEGEN_TUSERS_ID;
Unit1.cpp
#include #pragma hdrstop #include "Unit1.h" #include "Unit2.h" #include "Unit3.h" #include "Unit5.h" #include "Unit4.h" #include "Unit6.h" #include "Unit7.h" #include "Unit8.h" #include "Unit10.h" #include "Unit11.h" #include "Unit12.h" #include "Unit9.h"
Программный код win-приложения
Приложение Г
#pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1;
fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//ПРИХОД ТОВАРА
voidfastcall TForm1::Button1Click(TObject *Sender)
{Application->CreateForm(classid(TForm3), &Form3);
Form3->type_doc->Caption="Приход товара (Приходная накладная)"; Form3->type->Caption="1";
Form3->state_doc->Caption="Сохранён, не проведён";
DataModule2->new_doc->ParamByName("VIN_TYPE")->AsInteger=1; 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=1; 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();}////ПРОДАЖАТОВАРАvoidfastcallTForm1::Button2Click(TObject*Sender){Application->CreateForm(classid(TForm3),&Form3);Form3->type_doc->Caption="Продажа товара (Расходная накладная)";Form3->type->Caption="2";Form3->state_doc->Caption="Сохранён,непроведён";DataModule2->new_doc->ParamByName("VIN_TYPE")->AsInteger=2;
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=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();}voidfastcallTForm1::Button6Click(TObject*Sender){Application->CreateForm(classid(TForm10), &Form10);Form10->ShowModal();}voidfastcallTForm1::Button7Click(TObject*Sender){Application->CreateForm(classid(TForm11), &Form11);Form11->ShowModal();}voidfastcallTForm1::Button8Click(TObject*Sender){Application->CreateForm(classid(TForm12), &Form12);Form12->ShowModal();}
Unit3.cpp#include
#pragma hdrstop #include "Unit3.h" #include "Unit1.h" #include "Unit2.h" #include "Unit5.h" #include "Unit4.h" #include "Unit6.h" #include "Unit7.h" #include "Unit8.h" #include "Unit9.h"
#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 hdrstop #include "Unit4.h" #include "Unit1.h" #include "Unit2.h" #include "Unit3.h" #include "Unit5.h" #include "Unit6.h" #include "Unit7.h" #include "Unit8.h"
#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;}
//
1 ... 19 20 21 22 23 24 25 26 27