; ; @Temp = ShowSearchBox("SupplierSearch","INFOMATION",tbNo.CValue); if(@Temp != StringEmpty()) { tbNo.CValue = @Temp; UpdateForm(false, ""); if(Search("SearchSupplierWithNo", tbNo.CValue)) { ChangeMode("View"); } } if( txtName.CValue == "") { txtName.CValue = txtShortName.CValue; txtName.Focus(); } Search("SearchDepartment"); SetDataGridColumnDataSource(1,"dtLinkMan"); Search("SearchDuty"); SetDataGridColumnDataSource(2,"dtLinkMan"); Search("SearchIsMain"); SetDataGridColumnDataSource(7,"dtLinkMan"); @SetFlag=1; @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee); if(@temp != "") { ResumeColumnEvent("#Principal.No_Employee"); #Principal.No_Employee = @temp; ClearColumnEvent(); } @SetFlag=0; Search("SearchIsMain"); SetDataGridColumnDataSource(2,"dtPrinciple"); if(Search("SearchSupplierWithNo",#SupplierList.No_Supplier)) { ChangeMode("View"); } if(ckDisplay.Checked) Search("SearchAllSupplierList"); else Search("SearchSupplierList"); if(Search("SearchSupplierFirst", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchSupplierPrevious", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchSupplierNext", tbNo.CValue)) { ChangeMode("View"); } if(Search("SearchSupplierLast", tbNo.CValue)) { ChangeMode("View"); } ; ChangeMode("Search"); ChangeMode("Modify"); Delete(); ChangeMode("Search"); #Supplier.CountryName = cbCountry.Text; PrintReport(); ; ; ; ; ; if(toolBar.ExpandForm==true) { pnRight.Visible=true; if(!@HaveSearchSupplierList) { Search("SearchSupplierList"); @HaveSearchSupplierList=true; } } else { pnRight.Visible=false; } if(@SetFlag==0) { return; } if(Search("GetEmployeeNameByNo",#Principal.No_Employee)) { #Principal.Name_Employee=#Employee.Name_Employee; #Principal.ID_Employee=#Employee.ID_Employee; if(!Equals(#Employee.SuspendDate_Employee,DBNull())) MessageBox("该员工已停用!",@Title); } else { MessageBox("该员工不存在!",@Title); #Principal.Name_Employee=""; #Principal.ID_Employee=GuidEmpty(); @temp = ShowSearchBox("EmployeeSearch","INFOMATION",#Principal.No_Employee); if(@temp != "") { ResumeColumnEvent("#Principal.No_Employee"); #Principal.No_Employee = @temp; ClearColumnEvent(); } } ;
;
Empty(); NewInstance(); tbNo.ReadOnly=false; txtShortName.ReadOnly=true; txtName.ReadOnly=true; txtRegistedAddress.ReadOnly=true; cbCountry.Enabled=false; txtPostalCode.ReadOnly=true; pcPhone.ReadOnly=true; pcFax.ReadOnly=true; dttCreateDate.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; dtLinkMan.ReadOnly=true; dtPrinciple.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnablePrint=false; #Supplier.CreateDate_Supplier=DBNull(); #Supplier.SuspendDate_Supplier=DBNull(); #Supplier.LastModUser_Supplier=DBNull(); #Supplier.LastModDate_Supplier=DBNull(); if(ckDisplay.Checked) #Supplier.IsDisplay=1; else #Supplier.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; dtpIsSuspend.Enabled=true; txtComment.ReadOnly=false; dtLinkMan.ReadOnly=false; dtPrinciple.ReadOnly=false; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=false; toolBar.EnablePrint=false; #Supplier.No_Supplier=tbNo.CValue; #Supplier.CreatorName_Supplier=GetCurrentUser(); #Supplier.ID_Supplier=NewGuid(); #Supplier.ID_Creator=GetLoginUserID(); #Supplier.Country_Supplier=40; #Supplier.CreateDate_Supplier=DateTimeNow(); #Supplier.SuspendDate_Supplier=DBNull(); #Supplier.LastModUser_Supplier=DBNull(); #Supplier.LastModDate_Supplier=DBNull(); Search("SearchDefaultPhone"); Search("SearchDefaultFax"); MergeTable("#DefaultFax","#Fax"); MergeTable("#DefaultTelephone","#Telephone"); if(ckDisplay.Checked) #Supplier.IsDisplay=1; else #Supplier.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; pcPhone.ReadOnly=true; pcFax.ReadOnly=true; dtpIsSuspend.Enabled=false; txtComment.ReadOnly=true; dtLinkMan.ReadOnly=true; dtPrinciple.ReadOnly=true; toolBar.EnableSubmit=false; toolBar.EnableModify=GetRight(@Title,"修改"); toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=GetRight(@Title,"打印"); if(ckDisplay.Checked) #Supplier.IsDisplay=1; else #Supplier.IsDisplay=0; UpdateForm(true, ""); @Status=2; tbNo.ReadOnly=true; txtShortName.ReadOnly=false; txtName.ReadOnly=false; txtRegistedAddress.ReadOnly=false; cbCountry.Enabled=true; txtPostalCode.ReadOnly=false; pcPhone.ReadOnly=false; pcFax.ReadOnly=false; dtpIsSuspend.Enabled=true; txtComment.ReadOnly=false; dtLinkMan.ReadOnly=false; dtPrinciple.ReadOnly=false; toolBar.EnableSubmit=GetRight(@Title,"新增"); toolBar.EnableModify=false; toolBar.EnableDelete=GetRight(@Title,"删除"); toolBar.EnablePrint=false; #Supplier.LastModUser_SupplierName=GetCurrentUser(); #Supplier.LastModUser_Supplier=GetLoginUserID(); #Supplier.LastModDate_Supplier=DateTimeNow(); if(ckDisplay.Checked) #Supplier.IsDisplay=1; else #Supplier.IsDisplay=0; UpdateForm(true, ""); txtShortName.Focus(); @Status=3; =0;@i=@i-1) { SetPosition("#Linkman", @i); if(Equals(#Linkman.ID_Linkman,GuidEmpty())) #Linkman.ID_Linkman = NewGuid(); #Linkman.ID_Person = #Supplier.ID_Supplier; } for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1) { SetPosition("#Principal", @i); if(Equals(#Principal.ID_Principal,GuidEmpty())) #Principal.ID_Principal = NewGuid(); if(Equals(#Principal.ID_Employee, GuidEmpty())) { dtPrinciple.CurrentRowIndex=@i; tbDetail.SelectedIndex=2; MessageBox("该员工不存在!",@Title); ResumeLayout(); return; } #Principal.ID_Person = #Supplier.ID_Supplier; } 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=#Supplier.ID_Supplier; } 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=#Supplier.ID_Supplier; } ResumeLayout(); New(); } else if(@Status == 3) { SuspendLayout(); for(@i=RowCount("#Linkman")-1;@i>=0;@i=@i-1) { SetPosition("#Linkman", @i); if(Equals(#Linkman.ID_Linkman,GuidEmpty())) #Linkman.ID_Linkman = NewGuid(); #Linkman.ID_Person = #Supplier.ID_Supplier; } for(@i=RowCount("#Principal")-1;@i>=0;@i=@i-1) { SetPosition("#Principal", @i); if(Equals(#Principal.ID_Principal,GuidEmpty())) #Principal.ID_Principal = NewGuid(); if(Equals(#Principal.ID_Employee, GuidEmpty())) { dtPrinciple.CurrentRowIndex=@i; tbDetail.SelectedIndex=2; MessageBox("该员工不存在!",@Title); ResumeLayout(); return; } #Principal.ID_Person = #Supplier.ID_Supplier; } 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=#Supplier.ID_Supplier; } 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=#Supplier.ID_Supplier; } ResumeLayout(); #Supplier.LastModDate_Supplier=DateTimeNow(); Update(); } ChangeMode("View"); ]]>