www.pudn.com > Delphi-Script-30.rar > brparts.js, change:2012-04-12,size:900b


//USEUNIT Edparts 
//USEUNIT Datamod 
 
 
// EdParts, DataMod; 
 
function GetPartNo() 
{ 
  return MastData.PartsSource.Dataset.Fields(0).Value; 
} 
 
function SetPartNo(NewPartNo) 
{ 
  MastData.PartsSource.Dataset = MastData.Parts; 
  MastData.Parts.Locate("PartNo", NewPartNo, 0); 
} 
 
function ActivateQuery(Sender) 
{ 
  if  (!ActivateBtn.Down) 
    MastData.PartsSource.Dataset = MastData.Parts 
  else 
  { 
    MastData.PartsQuery.Close; 
    MastData.PartsQuery.Open; 
    MastData.PartsSource.Dataset = MastData.PartsQuery; 
  } 
} 
 
function EditBtnClick(Sender) 
{ 
  if (ActivateBtn.Down) 
  { 
    Edparts.Edit(MastData.PartsQueryPartNo.Value); 
    MastData.PartsQuery.Close; 
    MastData.PartsQuery.Open; 
  } 
  else 
    Edparts.Edit(MastData.PartsPartNo.Value); 
} 
 
function CloseBtnClick(Sender) 
{ 
  Close; 
} 
 
function FormShow(Sender) 
{ 
  MastData.Parts.Open; 
}