Parameters.ParamByName('S5').Value:=ExcelApp.Cells[iPosRow,8];
Parameters.ParamByName('S6').Value:=ExcelApp.Cells[iPosRow,9];
Parameters.ParamByName('S7').Value:=ExcelApp.Cells[iPosRow,10];
Parameters.ParamByName('S8').Value:=ExcelApp.Cells[iPosRow,11];
ExecSQL;
end;
iPosRow:=iPosRow+1;
End;
ExcelApp.Quit;
With ADOQuery Do
Begin
SQL.Clear;
SQL.Add('Select Spid,BM,ZL,S1,S2,S3,S4,S5,S6,S7,S8 From #tmp');
Open;
With DBGridEh Do
Begin
Columns[0].FieldName:='Spid';
Columns[1].FieldName:='BM';
Columns[2].FieldName:='ZL';
Columns[3].FieldName:='S1';
Columns[4].FieldName:='S2';
Columns[5].FieldName:='S3';
Columns[6].FieldName:='S4';
Columns[7].FieldName:='S5';
Columns[8].FieldName:='S6';
Columns[9].FieldName:='S7';
Columns[10].FieldName:='S8';
end;
End;
With ADOQueryCM Do
Begin
SQL.Clear;
SQL.Add('Select VT,OP From _CM');
Open;
End;
With DBGridCM Do
Begin
Columns[0].FieldName:='VT';
Columns[1].FieldName:='OP';
End;
DBGridEh.AutoFitColWidths:=true;
DBGridCM.AutoFitColWidths:=true;
PC.ActivePageIndex:=PC.ActivePageIndex+1;
end;
except
On E:Exception do
Begin
Application.MessageBox(PAnsiChar(E.message),'数据导入导出',36);
End;
end;
End;
1:
Begin
With ADOQueryD Do
Begin
SQL.Clear;
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,1 as CM ,S1 From #TMP Where S1<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,2 as CM ,S2 From #TMP Where S2<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,3 as CM ,S3 From #TMP Where S3<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,4 as CM ,S4 From #TMP Where S4<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,5 as CM ,S5 From #TMP Where S5<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,6 as CM ,S6 From #TMP Where S6<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,7 as CM ,S7 From #TMP Where S7<>0');
SQL.Add('Insert Into #Tmp1 (Spid,CM,SL)'
+'Select Spid,8 as CM ,S8 From #TMP Where S8<>0');
ExecSQL;
SQL.Clear;
{DSDSDetailD}
SQL.Add('Select a.SPid as SPid,'
+' b.SPECid as YSdm,'
+' c.SPECid as CMdm ,'
+' a.SL as Total,'
+' 1 as InsertEdit '
+' From #TMP1 a '
+' Left Join '
+' (Select Spid,SPECid From ISPcsmgrp Where LBtype=0) b '
+' On a.Spid=b.Spid'
+' Left Join '
+' (Select SPid,SPECid,VT from ISPcsmgrp '
+' left join _cm on _cm.OP=ISPcsmgrp.SPECid Where LBtype=1) c '
+' On a.Cm=c.VT and a.Spid=c.Spid ');
Open;
End;
With ADOQueryM Do
Begin
SQL.Clear;
SQL.add('Select a.Spid as Spid,ZL as SLTotal,'+cmbPrice.Value+' as CKJmoney'
+',1 as ZZKdiscount,'+cmbPrice.Value+' as DJmoney'
+','+cmbPrice.Value+'*ZL as JEmoney'
+' From #Tmp a Left Join '
+' (Select Spid,CkJJ,CKjj1,CkJJ2 From ISPinfo) b '
+' on a.Spid=b.Spid');
OPen;
End;
//DSDSDETAILD SPid YSdm CMdm Total BYTotal InsertEdit
//ISPcsmgrp Spid,SPECid,LBtype
//#tmp1 HH,CM,SL
PC.ActivePageIndex:=Pc.ActivePageIndex+1;
DBGridEhR.AutoFitColWidths:=true;
DBGridEhM.AutoFitColWidths:=true;
DBGridEhD.AutoFitColWidths:=true;
End;
end;
end;
procedure TfrmIOData.txtServerPortKeyPress(Sender: TObject; var Key: Char);
begin
if not (key in ['0'..'9',#8,#13]) then
key:=#0;
Tab(Key);
end;
procedure TfrmIOData.txtServerNameKeyPress(Sender: TObject; var Key: Char);
begin
if not (key in ['0'..'9','a'..'z','A'..'Z','_','.',#8,#13]) then
key:=#0;
Tab(Key);
end;
procedure TfrmIOData.txtServerIDKeyPress(Sender: TObject; var Key: Char);
begin
if not (key in ['0'..'9','a'..'z','A'..'Z','_',#8,#13]) then
key:=#0;
Tab(Key);
end;
procedure TfrmIOData.txtServerPWDKeyPress(Sender: TObject; var Key: Char);
begin
Tab(Key);
end;
procedure TfrmIOData.FormShow(Sender: TObject);
begin
PC.ActivePageIndex:=0;
end;
procedure TfrmIOData.chkDJBHClick(Sender: TObject);
begin
if chkDJBH.Checked then
txtDJBH.Enabled:=false
else
txtDJBH.Enabled:=true;
end;