Re: Параметры интерфейса
Добавлено: 23 июл 2014, 17:51
Поменял в поле status на ppstatus.name. Когда сразу открываешь, то отображает наименование статуса, после открытия списка все равно выводятся item1, item2, item3 и невозможно ничего выбратьedward_K писал(а):сделайте маленький фейс и смотрите на нем. Из очевидного - почему status не из таблицы?
Код: Выделить всё
#include %src%\src\normzapas.vih;
#include %src%\src\vipInterface.h;
!#include %src%\src\GetKau.vih
!#include %src%\src\Galnet.ccm;
interface Normzapas 'Нормы страхового запаса';
!#include %src%\src\GetKau.var
show at (,,92,25);
const
cmPrintDoc = 3440;
end;
var
nr,mcnrec,katednrec,katpodrnrec,linenrec,formatnrec,katstannrec,ctitle,titlenrec,specnrec: comp;
pptitlenrec,unitm:comp;
wkl,grant_s, check_del, checkspecif,check_screen:boolean;
res,check_i : word;
nmc:string;
pdate, pbdate, pedate : date;
statusnnrec:comp;
UnMea,plancopy:string;
somewindow:longint;
n:longint;
wValues: array [1..3] of word;
lValues: array [1..3] of comp;
sValues: array [1..1] of string;
begindate,enddate:date;
sort1,teh_poteri,dek1,dek2,dek3,summ_plan,poludek1,poludek2,poludek3,summ_polu:double;
sum_gresbordur,gresbordur1,gresbordur2,gresbordur3:double;
sum_vstavka,vstavka1,vstavka2,vstavka3:double;
maxi,maxs:word;
butpick:longInt;
nomer_plana,formatname:string;
linia_name,podrasd,titlenpp:string;
status_plana,old_status,old_linia :comp;
v1 : iSecurity_norm;
create view normz
var status,linia_filter,grup_filter,format_filter, nomer_plana: word;
x:integer;
fldselect:longint;
linia,gruppa,etalon,format,titlenrec,specifnrec,specifnrec2,specifnrec3, pmc:comp;
(Vsego,meash)
as select katpodr.name,normzapas.npp, *
from normzapas, normzapasspec, katpodr, katmc, x$users, katpodr katpodr_2, ppstatus//, katmc katmc_2
where(( normzapas.cpodrazd==katpodr.nrec
and normzapas.atl_nrec == normzapasspec.cnorm
and normzapasspec.cmc==katmc.nrec
! and comp(userid) == normzapas.atl_owner
and normzapas.atl_owner==x$users.atl_nrec
and katpodrnrec == katpodr_2.nrec
! and katmc.nrec == katmc_2.nrec
! and pmc == katmc.nrec
))
order by normzapas.npp;
window NormCorrect 'Редактирование норм';
show at(,,,28);
toolbar F_Common::tbPrintDoc;
handleevent
cmPrintDoc:
{
UpdateTable();
res:=RunInterface('ireport',titlenrec);
}
end;
screen sCornormzapas(,,sci1EnEsc); //SciAqaSwitchItemName
show at (,,,10);
table katpodr;
bevel be1 {1,0,110,10,bsRaised, bsFrame};
fields
normzapas.pdate :protect;
normzapas.pbdate:noprotect;
normzapas.pedate:noprotect;
normzapas.npp:protect,noPickButton; //:noprotect; //(,,sciAQACancel1)
katpodr.name :pickButton, protect;
! status : [ list 'item 1', 'item 2', 'item 3' ];
ppstatus.name (,,SciAqaSwitchItemName) : [ list 'item 1', 'item 2', 'item 3' ];
<<
Дата Начало действия Конец действия
.@@@@@@@@@ .@@@@@@@@@ .@@@@@@@@@
Номер Структурное подразделение
.@@@@@@@@@@@@ .@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Статус .@@@@@@@@@@@@@@@@@@@@@
>>
end;
! browse bCornormzapas(,,Sci13478Esc )//F1,F4,F7,F8,Esc//(,,sci178EnEsc)
browse bCornormzapas(,,Sci178EnEsc )//F1,F4,F7,F8,Esc//(,,sci178EnEsc) sci1478EnEscTreeI
show at (,11,,22)
table normzapasspec;
fields
katmc.name 'Наименование МЦ' : [20], pickButton;
normzapasspec.kol 'Количество':[5,'666.88'],noprotect,noPickButton;
end;
procedure grants();
{
if(v1.fSecurityPolicy(sGetTune('USER.descr'),normzapas.atl_nrec,normzapas.cstatus) = FALSE )
{
cfsSetProp('bnormzapas','StatusCtx', Sci17EnEsc);
cfsSetProp('bCornormzapas','StatusCtx',sciAQACancel1);
cfsSetProp('status','StatusCtx',SciAqaSwitchItemName);
SetFormat(sCornormzapas);
// cfsSetProp('sCorPPlan_nogrant','StatusCtx',sciAQACancel1);
// SetFieldOption(#ppspecif.npp,ofProtected);
grant_s:=false;
// message('grant_s false');
}
else if(v1.fSecurityPolicy(sGetTune('USER.descr'),normzapas.atl_nrec,normzapas.cstatus) = true )
{
if( getfirst x$users where (( sGetTune('USER.descr') == x$users.XU$LOGINNAME )) = tsOk )
{
// cfsSetCurrentContainer('Plan.PlanCorrect.sCorPPlan');
// cfsCreateObject('button', 'sCorPPlan', 'Etalons', false, butpick);
if (x$users.xu$type=1)
{
// SetFieldOption(#ppspecif.npp,ofSelectable);
// if (x$users.xu$type=1 and x$users.xu$loginname='pivovarchukaa')
// {
//message('full_grants');
cfsSetProp('Bnormzapas','StatusCtx',Sci178EnEsc);
SetFormat(sCornormzapas);
cfsSetProp('bCornormzapas','StatusCtx',Sci13478Esc);
cfsSetProp('sCornormzapas','StatusCtx',SciAqaSwitchItemName);
// }
// message('grant_s true');
}
else
{
//message('grants');
cfsSetProp('Bnormzapas','StatusCtx',Sci178EnEsc);
SetFormat(sCornormzapas);
cfsSetProp('bCornormzapas','StatusCtx',Sci13478Esc);
cfsSetProp('sCornormzapas','StatusCtx',SciAqaSwitchItemName);
}
grant_s:=true;
}
}
rescanpanel(#normzapas);
}
procedure spisok2(prava:boolean);
{
var i,j:longint;
i:=1;
j:=0;
prava:=true;
titlenrec:=normzapas.atl_nrec;
if prava=true
{
n:=RecordsInTable(#ppstatus);
SetLimit(sValues,n);
SetLimit(lValues,n);
SetLimit(wValues,n);
_loop ppstatus
{
wValues[i] := j;
lValues[i] := ppstatus.atl_nrec;
sValues[i] := ppstatus.name;
i:=i+1;
j:=j+1;
message (sValues[i]);
}
}
else
{
n:=RecordsInTable(#ppstatus)-1;
SetLimit(sValues,n);
SetLimit(lValues,n);
SetLimit(wValues,n);
_loop ppstatus
{
if ppstatus.atl_nrec<>comp(281474976710657)
{
wValues[i] := j;
lValues[i] := ppstatus.atl_nrec;
sValues[i] := ppstatus.name;
i:=i+1;
j:=j+1;
}
}
}
SetEnumList (sCornormzapas, #status, sValues,wValues);
! SetEnumList (sCorPPlan_nogrant, #status, sValues,wValues);
! SetEnumList (sCorPPlan_full_grants, #status, sValues,wValues);
if getfirst ppstatus where((normzapas.cstatus==ppstatus.atl_nrec))=tsOk
{
n:=n+1;
for (i:=1;i<n;i++)
{
if ppstatus.atl_nrec=lValues[i]
{
selectFieldInFormat(sCornormzapas ,#status);
status:=wValues[i];
! selectFieldInFormat(sCorPPlan_nogrant ,#status);
! status:=wValues[i];
! selectFieldInFormat(sCorPPlan_full_grants ,#status);
! status:=wValues[i];
}
}
}
else
{
set status:=wValues[1];
}
old_status:=lValues[status+1];
RescanPanel(sCornormzapas);
! RescanPanel(sCorPPlan_nogrant);
! RescanPanel(sCorPPlan_full_grants);
Rescanpanel(#normzapasspec);
Rescanpanel(#normzapas);
}
tableevent table normzapasspec
cmSetDefault:
{
set normzapasspec.cnorm :=normzapas.atl_nrec
}
cmUpdateRecord :
{ //if grant_s=false
//{
update current normzapasspec;
//}
}
cminsertrecord:
{
insert current normzapasspec;
UpDatePanels();
}
cmDeleteRecord :
{
Delete Current normzapasspec;
}
end;
end;
browse bnormzapas(,,Sci178EnEsc)
table normzapas;
fields
normzapas.pdate 'Дата' : [15] , protect, noAutoSize;
normzapas.npp 'Номер' : [25], protect, noAutoSize;
katpodr.name 'Подразделение' : [25] , protect, noAutoSize;
x$users.xu$fullname 'Создатель':[20],protect,noAutoSize;
end;
//end;
tableevent table normzapas
cmSetDefault: {
normzapas.pdate:=Cur_Date();
normzapas.cpodrazd:=0;
normzapas.npp := 1;
SetModified(true);
UpDateTableWithInserted
PutCommand(cmDefault);
}
cmUpdateRecord :{ //if grant_s=false
//{
update current normzapas;
//}
}
cmInsertRecord :{
insert current normzapas;
! insert current normzapasspec;
UpDatePanels();
}
cmDeleteRecord :
{
if Message('Удалить нормы?', yesButton + noButton) = cmYes
{
Delete Current normzapas;
Delete Current normzapasspec;
}
}
cmCheckRecord:
{
MakeValid(#normzapas);
if isvalid(#normzapas)
{
update current normzapas;
}
if isnew
{
Putcommand(cmInsertRecord);
}
}
cmCheckField:
{
updatetable;
SetModified(true);
case CurField of
#normzapas.pbdate:
{
update current normzapas;
RescanPanel(#normzapas);
}
#normzapas.pedate:
{
update current normzapas;
RescanPanel(#normzapas);
}
#normzapas.pdate:
{
update current normzapas;
RescanPanel(#normzapas);
}
#normzapas.npp:
{
update current normzapas;
RescanPanel(#normzapas);
}
end;
}
end;
handleEvent
cmInit:
{
RescanPanel(Scornormzapas);
Rescanpanel(#normzapas);
}
cmPick:
{
Updatetable();
case CurField of
#katpodr.name:
{
katpodrnrec:=normzapas.cpodrazd;
res:=RunInterface('Z_KATPODR::GETANYPODR',katpodrnrec);
normzapas.cpodrazd:=katpodrnrec
update current normzapas;
if getfirst katpodr where((normzapas.cpodrazd==katpodr.nrec))=tsOk
{
}
RescanPanel(#normzapas);
}
#katmc.name:
{
pmc := normzapasspec.cmc;
res := runinterface('L_MCU::GetSomeMC_KatMC', pmc, false, -12345);//вызов интерфейса выбора МЦ без ввода количества
! res := runinterface('L_MCU::GetSomeMC', pmc);
! res := runinterface('iGetKau.GetCodeKau', pmc);
normzapasspec.cmc := pmc;
update current normzapasspec;
if getfirst katmc where((normzapasspec.cmc==katmc.nrec))=tsOk
{
}
RescanPanel(#normzapasspec);
}
end;
}
cmCheckField : update current normzapas;
cmCancel:
{
}
cmPrintDoc:
{
UpdateTable();
res:=RunInterface('ireport',titlenrec);
}
cmClose:
{
CloseWindow(cmDefault);
}
cmDefault:
{
PutCommand(cmCheckField);
runwindowmodal(NormCorrect);
Rescanpanel(#normzapas);
}
cmInsert:
{
! message('cminsert1');
! titlenrec:=normzapas.atl_nrec;
! maxs:=normzapas.npp;
! specnrec:=normzapas.npp;
!! _loop normzapas where ((titlenrec==normzapas.atl_nrec))
!! {
! if (maxs<normzapas.npp) or (maxs=normzapas.npp)
! {
! message('cminsert2');
! normzapas.npp:=normzapas.npp+1;
! update current normzapas;
! }
!// maxs:=maxs+1;
!! }
! maxs:=maxs+1;
}
cmDelete:
{
}
cmDone:
{
rescanpanel(#normzapas);
}
end;
end.