; ; @Temp = ShowSearchBox("TransporterSearch","INFOMATION",tbNo.CValue); if(@Temp != StringEmpty()) { tbNo.CValue = @Temp; ActiveControlEvent("tbNo", "Enter"); UpdateForm(false, ""); if(Search("SearchTransporterWithNo", tbNo.CValue)) { Search("SearchMainPrincipal"); ChangeMode("View"); } } UpdateForm(false, "cbMainPrincipal"); Search("SearchMainPrincipal"); UpdateForm(true, "cbMainPrincipal"); Search("SearchZone"); SetDataGridColumnDataSource(0,"dgFreightMode"); Search("SearchName"); SetDataGridColumnDataSource(1,"dgFreightMode"); if(Search("SearchTransporterWithNo",#TransporterList.No_Transporter)) { ChangeMode("View"); } if(ckDisplay.Checked) Search("SearchAllTransporterList"); else Search("SearchTransporterList"); if(Search("SearchTransporterFirst", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchTransporterPrevious", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchTransporterNext", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchTransporterLast", tbNo.CValue)) { ChangeMode("View"); } ; ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); #Transporter.CountryName = cbCountry.Text; PrintReport(); ; ; ; ; ; if(toolBar.ExpandForm==true) { pnRight.Visible=true; if(!@HaveSearchTransporterList) { Search("SearchTransporterList"); @HaveSearchTransporterList=true; } } else { pnRight.Visible=false; } ;
;
Empty(); NewInstance(); tbNo.ReadOnly=false; txtShortName.ReadOnly=true; txtName.ReadOnly=true; txtRegistedAddress.ReadOnly=true; cbCountry.Enabled=false; txtPostalCode.ReadOnly=true; cbMainPrincipal.Enabled=false; txtLinkman.ReadOnly=true; dttCreateDate.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnablePrint=false; pcPhone.ReadOnly=true; pcFax.ReadOnly=true; dgFreightMode.ReadOnly=true; #Transporter.CreateDate_Transporter=DBNull(); #Transporter.SuspendDate_Transporter=DBNull(); #Transporter.LastModUser_Transporter=DBNull(); #Transporter.LastModDate_Transporter=DBNull(); if(ckDisplay.Checked) #Transporter.IsDisplay=1; else #Transporter.IsDisplay=0; UpdateForm(true, ""); tbNo.Focus(); @Status=0; Empty(); NewInstance(); tbNo.ReadOnly=true; txtShortName.ReadOnly=false; txtName.ReadOnly=false; txtRegistedAddress.ReadOnly=false; cbCountry.Enabled=true; txtPostalCode.ReadOnly=false; cbMainPrincipal.Enabled=true; txtLinkman.ReadOnly=false; dtpIsSuspend.Enabled=true; txtComment.ReadOnly=false; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnablePrint=false; dgFreightMode.ReadOnly=false; #Transporter.No_Transporter=tbNo.CValue; #Transporter.CreatorName_Transporter=GetCurrentUser(); #Transporter.ID_Transporter=NewGuid(); #Transporter.Creator_Transporter=GetLoginUserID(); #Transporter.Country_Transporter=40; #Transporter.CreateDate_Transporter=DateTimeNow(); #Transporter.SuspendDate_Transporter=DBNull(); #Transporter.LastModUser_Transporter=DBNull(); #Transporter.LastModDate_Transporter=DBNull(); Search("SearchDefaultFax"); Search("SearchDefaultPhone"); MergeTable("#DefaultFax","#Fax"); MergeTable("#DefaultTelephone","#Telephone"); if(ckDisplay.Checked) #Transporter.IsDisplay=1; else #Transporter.IsDisplay=0; UpdateForm(true, ""); pcPhone.ReadOnly=false; pcFax.ReadOnly=false; txtShortName.Focus(); @Status=1; tbNo.ReadOnly=false; txtShortName.ReadOnly=true; txtName.ReadOnly=true; txtRegistedAddress.ReadOnly=true; cbCountry.Enabled=false; txtPostalCode.ReadOnly=true; cbMainPrincipal.Enabled=false; txtLinkman.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=GetRight(@Title,"打印"); pcPhone.ReadOnly=true; pcFax.ReadOnly=true; dgFreightMode.ReadOnly=true; if(ckDisplay.Checked) #Transporter.IsDisplay=1; else #Transporter.IsDisplay=0; UpdateForm(true, ""); @Status=2; tbNo.ReadOnly=true; txtShortName.ReadOnly=false; txtName.ReadOnly=false; txtRegistedAddress.ReadOnly=false; cbCountry.Enabled=true; txtPostalCode.ReadOnly=false; cbMainPrincipal.Enabled=true; txtLinkman.ReadOnly=false; dtpIsSuspend.Enabled=true; txtComment.ReadOnly=false; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=false; pcPhone.ReadOnly=false; pcFax.ReadOnly=false; dgFreightMode.ReadOnly=false; #Transporter.LastModUser_TransporterName=GetCurrentUser(); #Transporter.LastModUser_Transporter=GetLoginUserID(); #Transporter.LastModDate_Transporter=DateTimeNow(); if(ckDisplay.Checked) #Transporter.IsDisplay=1; else #Transporter.IsDisplay=0; UpdateForm(true, ""); txtShortName.Focus(); @Status=3; =0;@i=@i-1) { SetPosition("#FreightMode", @i); if(Equals(#FreightMode.ID_FreightMode,GuidEmpty())) #FreightMode.ID_FreightMode = NewGuid(); #FreightMode.ID_Transporter = #Transporter.ID_Transporter; } for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1) { SetPosition("#Telephone",@i); if(Equals(#Telephone.ID_Telephone,GuidEmpty())) #Telephone.ID_Telephone=NewGuid(); #Telephone.ID_Person=#Transporter.ID_Transporter; } for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1) { SetPosition("#Fax",@i); if(Equals(#Fax.ID_Fax,GuidEmpty())) #Fax.ID_Fax=NewGuid(); #Fax.ID_Person=#Transporter.ID_Transporter; } ResumeLayout(); New(); } else if(@Status == 3) { SuspendLayout(); for(@i=RowCount("#FreightMode")-1;@i>=0;@i=@i-1) { SetPosition("#FreightMode", @i); if(Equals(#FreightMode.ID_FreightMode,GuidEmpty())) #FreightMode.ID_FreightMode = NewGuid(); #FreightMode.ID_Transporter = #Transporter.ID_Transporter; } for(@i=RowCount("#Telephone")-1;@i>=0;@i=@i-1) { SetPosition("#Telephone",@i); if(Equals(#Telephone.ID_Telephone,GuidEmpty())) #Telephone.ID_Telephone=NewGuid(); #Telephone.ID_Person=#Transporter.ID_Transporter; } for(@i=RowCount("#Fax")-1;@i>=0;@i=@i-1) { SetPosition("#Fax",@i); if(Equals(#Fax.ID_Fax,GuidEmpty())) #Fax.ID_Fax=NewGuid(); #Fax.ID_Person=#Transporter.ID_Transporter; } ResumeLayout(); #Transporter.LastModDate_Transporter=DateTimeNow(); Update(); } ChangeMode("View"); ]]>