twPRJMATERIALS. Реализация табличного врапера 'Материальные ресурсы' Назад В начало Вперед

Файл: Example\Src\VIP\Core\twPrjMaterials.vip

Издание 01.2007. Добавлены директивы документирования.

Включен в проект начиная с издания 03.2005.

//******************************************************************************
//													(c) корпорация Галактика
// Демопроект 1.0 - Ядро приложения
// Реализация табличного врапера 'Материальные ресурсы'
//******************************************************************************

#include IPrjMaterials.vih

#component "C_CORE"

//******************************************************************************
#doc
 Реализация табличного врапера 'Материальные ресурсы'
#end

interface twPrjMaterials;
  create view as select * from PrjMaterials;

  property IPrjMaterials.NRec	 : comp   absolute PrjMaterials.NRec	 read write;
  property IPrjMaterials.cMaterial  : comp   absolute PrjMaterials.cMaterial  read write;
  property IPrjMaterials.cMaster	: comp   absolute PrjMaterials.cMaster	read write;
  property IPrjMaterials.MasterCode : word   absolute PrjMaterials.MasterCode read write;
  property IPrjMaterials.Status	 : byte   absolute PrjMaterials.Status	 read write;
  property IPrjMaterials.QuantP	 : double absolute PrjMaterials.QuantP	 read write;
  property IPrjMaterials.QuantF	 : double absolute PrjMaterials.QuantF	 read write;
  property IPrjMaterials.SummP	: double absolute PrjMaterials.SummP	read write;
  property IPrjMaterials.SummF	: double absolute PrjMaterials.SummF	read write;

  var _HaveRel2Obj : boolean;

//------------------------------------------------------------------------------

constructor Init;
{
  _HaveRel2Obj := HaveObjRel4Obj( IPrjMaterials(Self) );
  result := true;
};

//------------------------------------------------------------------------------

function IModify.doInsert: Word;
{
  result := insert current PrjMaterials;
}

//------------------------------------------------------------------------------

function IModify.doUpdate: Word;
{
  if (_HaveRel2Obj)
	if (CheckObjRel4UpdatePK(IPrjMaterials(Self)))
	 result := update current PrjMaterials;
	else
	 result := tsOperationAbortedByTrigger;
  else
	result := update current PrjMaterials;
}

//------------------------------------------------------------------------------

function IModify.doDelete: Word;
{ if (_HaveRel2Obj)
	if (CheckObjRel4Delete(IPrjMaterials(Self)))
	result := delete current PrjMaterials;
	else
	result := tsOperationAbortedByTrigger;
  else
	result := delete current PrjMaterials;
}

//------------------------------------------------------------------------------

function IManualIndex.Count: LongInt;
{
  result := RecordsInTable(#PrjMaterials);
}

//------------------------------------------------------------------------------

  implementation IModify.doFlush abstract;

  implementation IManualIndex.IndexActivated abstract;
  implementation IManualIndex.IndexDeactivated abstract;
  implementation IManualIndex.FilterChanged abstract;
  implementation IManualIndex.Find abstract;
  implementation IManualIndex.Move abstract;
  implementation IManualIndex.GetAddr abstract;
  implementation IManualIndex.GetDirect abstract;

  index IPrjMaterials.PrjMaterials0 auto;
  index IPrjMaterials.PrjMaterials01 auto;
  index IPrjMaterials.REF_PrjMaterials_4 auto;

end.